Questions › Technical PM › Top-Interview
Find the first missing positive number in an array.
- Technical PM
- Top-Interview
- Easy
- 10 min
Focus on developing an efficient algorithm to identify the first missing positive integer in an unsorted array. Start by discussing the constraints of the problem, particularly the need to handle negative numbers and zeroes, as they are not relevant to the solution. Consider using a linear time complexity approach, such as placing each number in its corresponding index position (i.e., number 1 at index 0, number 2 at index 1, etc.). Be prepared to explain your thought process clearly, including edge cases like empty arrays or arrays with all negative numbers. Finally, discuss the space complexity of your solution and how it can be optimized.
What this question tests
- Technical PM
- Structured problem solving
- Communication
- Trade-off reasoning
Practise this question under interview conditions. Answer it out loud against a timer with an AI interviewer that asks follow-ups, then review the scored report.
Related Technical PM questions
- Design Twitter.Top-Interview · Technical PM · Hard
- Design Facebook Messenger.Top-Interview · Technical PM · Hard
- What is a technical challenge you faced in your previous project?Top-Interview · Technical PM · Hard
- What technical contributions have you made to a project?Top-Interview · Technical PM · Hard
- Design the architecture for a hardware device that measures temperature and social distance among employees in warehouses during COVID.Top-Interview · Technical PM · Hard
- Design a language learning app for Meta.Top-Interview · Technical PM · Hard
All Technical PM questions · Product manager interview questions by skill area