Uber interview prep
8 practice questions on the topics candidates reported from Uber interviews, with answers. The questions are ours; each one links to the interview report that names its topic.
DSA 5
-
Fire spreads one cell per minute through a grid, and you must find the longest you can wait at the start and still reach the exit ahead of it. What is the standard approach?
- Simulate every possible waiting time from scratch with no reuse
- A multi-source BFS from all fires gives the minute each cell burns; then binary search on the waiting time, checking each candidate with a BFS of your own moves
- Sort the cells by distance from the exit
- A single DFS from the start
Show the answer
B. A multi-source BFS from all fires gives the minute each cell burns; then binary search on the waiting time, checking each candidate with a BFS of your own moves
If you can survive waiting w minutes, you can survive any shorter wait, so the answer is monotonic and binary search applies. Each check is O(rows x columns), giving O(rows x columns x log(rows x columns)).
This topic is named in a candidate’s interview report: SDE intern interview, 2025, on Reddit.
-
To pick index i with probability proportional to w = [1, 3, 2], you build the prefix sums [1, 4, 6], draw a whole number r from 1 to 6, and return the first index whose prefix sum is at least r. Which index does r = 5 give?
- 0
- 2
- 1
- None; r must be drawn again
Show the answer
B. 2
5 is more than 4, so index 1 is passed over, and 6 >= 5 gives index 2. r = 1 gives index 0, r = 2 to 4 give index 1 and r = 5 or 6 give index 2, so the chances are 1/6, 3/6 and 2/6, as the weights say. A binary search over the prefix sums makes each pick O(log n).
This topic is named in a candidate’s interview report: SDE intern on-campus interview, 2024, on GeeksforGeeks.
-
A binary tree in level order is [1, 3, 2, 5, null, null, 9, 6, null, 7], where null is a missing child. A level's width counts every position from its leftmost to its rightmost node, missing ones included. What is the maximum width?
- 4
- 7
- 8
- 2
Show the answer
B. 7
Number the nodes like a heap: a node at position p has children 2p and 2p + 1. The last level holds 6 under 5 and 7 under 9, at positions 8 and 14 when the root is 1, so its width is 14 - 8 + 1 = 7. A BFS that keeps each node's position finds this in O(n); renumber from 0 at each level so the positions do not overflow on deep trees.
This topic is named in a candidate’s interview report: SDE intern on-campus interview, 2024, on GeeksforGeeks.
-
Boxes (width, height): (5, 4), (6, 4), (6, 7), (2, 3). A box fits inside another only if both its width and its height are strictly smaller. What is the largest number of boxes you can nest one inside another?
- 4
- 2
- 1
- 3
Show the answer
D. 3
(2, 3) goes in (5, 4), which goes in (6, 7): 3 boxes. Sort by width rising and, for equal widths, by height falling, then find the longest strictly rising run of heights, the LIS, in O(n log n). Sorting equal widths by falling height stops (6, 4) and (6, 7) from both being counted.
This topic is named in a candidate’s interview report: Summer intern on-campus interview, 2023, on GeeksforGeeks.
-
What is the binary number 101101 written in base 6?
- 225
- 113
- 45
- 231
Show the answer
B. 113
In decimal, 101101 is 32 + 8 + 4 + 1 = 45. Divide by 6 repeatedly: 45 = 7 x 6 + 3 and 7 = 1 x 6 + 1, then 1. Reading the remainders from last to first gives 113, and indeed 1 x 36 + 1 x 6 + 3 = 45.
This topic is named in a candidate’s interview report: Summer intern on-campus interview, 2023, on GeeksforGeeks.
Operating systems 1
-
What is the key difference between two processes and two threads of one process?
- Processes have separate address spaces; threads of one process share memory
- Threads cannot run at the same time
- Processes share memory; threads do not
- Threads each need their own copy of the program code
Show the answer
A. Processes have separate address spaces; threads of one process share memory
Threads share the process's heap, globals and open files, so they communicate cheaply but need locks. Processes are isolated, so one crashing does not take the other down, and they talk through pipes, sockets or shared memory.
This topic is named in a candidate’s interview report: SDE intern on-campus interview, 2024, on GeeksforGeeks.
Software engineering 1
-
A system records each passenger's arrival and departure at an airport and must report how long each one stayed. Which design fits?
- Keep one list of all events and scan it from the start at every departure
- Sort every passenger by name once a minute
- Store departures only, since arrival times can be estimated
- On arrival, store the time in a hash map keyed by passenger ID; on departure, look it up, record the stay and remove the entry
Show the answer
D. On arrival, store the time in a hash map keyed by passenger ID; on departure, look it up, record the stay and remove the entry
Each event costs O(1), and the map holds only the people now inside. For an average stay, keep a running total and count instead of storing every stay. Decide early what happens with a departure that has no arrival, such as one lost in a restart.
This topic is named in a candidate’s interview report: Summer intern on-campus interview, 2023, on GeeksforGeeks.
Aptitude 1
-
A movie is rated 4 by a regular user and 2 by a critic, whose rating counts twice. What is its weighted average rating?
- 3.0
- 2.67
- 3.33
- 2.0
Show the answer
B. 2.67
Weighted average = (4 x 1 + 2 x 2) / (1 + 2) = 8 / 3 = 2.67. Storing the weighted sum and the total weight per movie lets each new rating update it in O(1).
This topic is named in a candidate’s interview report: SDE intern interview, 2025, on Reddit.