Elastic·Software Engineer·Technical Phone Screen
Jun 2026
Elastic technical screen for a software engineer role, basically a live PR review on a recursive flatten utility. The whole thing was more nuanced than I expected, less about writing code and more about finding cracks in someone else's.
- Given a pull request implementing a recursive array flatten function, what correctness bugs and edge cases does the implementation fail to handle?
- What API and contract questions would you raise before approving this PR, for example around how non-array objects, null values, strings, and sparse arrays should be handled?
- How would you improve this implementation for readability, performance, and safety, including the risk of a stack overflow on deeply nested input?
- Propose a revised implementation approach and describe the minimal set of tests you would require before approving this PR.
“The `for...in` loop was the first thing I flagged because it iterates over enumerable properties, not just numeric indices, so anything added to Array.prototype would silently get included.” The rest of the author's notes on Software Engineer interview at Elastic, Technical Phone Screen round, covers how they worked through the question, what the panel pushed back on, and what they would do differently.
View Post