Uber | Phone Screen | L5-A role
Summary
I had a phone screen interview with Uber for an L5-A role. The interview involved a data structures and algorithms problem where I had to implement methods to ingest numbers into a stream and find the minimum missing number so far.
Full Experience
There is a stream of numbers incoming. They can come in any order. We have to implement two methods.
- incoming(num : int) -> This will ingest the number
- getMissingMinSoFar() : -> This will return minimum missing number from the stream
Interview Questions (1)
Minimum Missing Number in a Stream
Implement two methods for a stream of numbers:
- incoming(num : int) -> This will ingest the number
- getMissingMinSoFar() : -> This will return minimum missing number from the stream
Example
stream.getMissingMinSoFar() -> 0
stream.incoming(0)
stream.incoming(1)
stream.getMissingMinSoFar() -> 2
stream.incoming(5) stream.getMissingMinSoFar() -> 2 stream.incoming(2) stream.getMissingMinSoFar() -> 3