← Uber Interview Insights

Uber·Software Engineer·Technical Phone Screen·Intermediate

IntermediatePrefer not to say
Jul 2026

Summary

Uber SWE interview, technical phone screen, one coding question the whole time. Pretty focused session, no fluff.

Questions Asked (1)

Q1

Implement Promise.all() from scratch in JavaScript.

Algorithms & Data StructuresTechnical Trade-offs
Author's notes

I've seen this question floating around so I wasn't totally blindsided, but actually writing it cleanly under pressure is a different story.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by clarifying the requirements and edge cases (empty input, non-promise values, rejection handling, order preservation). Then implement a function that returns a new promise, iterates over the input, and resolves with an array of results in the original order, rejecting immediately on the first rejection. Finally, discuss trade-offs and potential optimizations.

Pro tip: Mention that native Promise.all uses a counter to track pending promises and resolves only when all are settled, and that it handles thenables by wrapping them with Promise.resolve. This shows deep understanding beyond a naive implementation.

1. Clarify requirements and edge cases

Ask about input types (iterable, array), handling of non-promise values, empty input, and rejection behavior. Confirm that order of results must match input order.

2. Design the algorithm

Outline a plan: return a new Promise; if input is empty, resolve immediately; otherwise, maintain a results array and a counter of resolved promises. For each input, wrap it in Promise.resolve and attach then/catch handlers.

3. Implement the core logic

Write code that iterates over the input, stores each result at its index, increments the counter on fulfillment, and resolves the outer promise when the counter equals the input length. Reject immediately on any rejection.

4. Test and verify

Walk through test cases: all resolve, one rejects, empty array, mixed values (promises and plain values), and order preservation. Ensure the implementation handles these correctly.

5. Discuss trade-offs and optimizations

Talk about performance (O(n) time, O(n) space), error handling, and how your implementation compares to native Promise.all. Mention potential improvements like handling iterables or using async/await.

Key Points to Mention

  • Return a new Promise that resolves with an array of results in the same order as the input.
  • Use Promise.resolve to wrap non-promise values and thenables.
  • Maintain a counter to track how many promises have resolved; resolve only when all are done.
  • Reject immediately upon the first rejection, and ensure no further resolutions occur.
  • Handle edge cases: empty input resolves immediately, and input can be any iterable.
  • Discuss time and space complexity: O(n) time and O(n) space for results.

AI-generated suggestions, not part of the candidate's original notes. May be inaccurate — verify before relying on them.