How to Pass the Uber Backend Low-Level Design Interview

Uber’s backend low-level design (LLD) round, widely known as the machine coding round, has a reputation for being notoriously rigorous. You cannot just sketch out high-level pseudocode here like you might in a standard algorithm interview. Uber expects clean, object-oriented, and highly concurrent code that actually compiles, runs, and passes tests within a strict 90 to 120-minute time limit. They want to see exactly how you translate a vague problem statement into a fully functioning, extensible system. This means you will need to lean heavily on appropriate design patterns, thread-safe data structures, and rock-solid edge-case handling. The goal is not just to make it work, but to build a foundation that a team of engineers could safely contribute to without breaking existing functionality.
The Uber Backend Engineering Interview Process
Before breaking down the code, it helps to understand where the LLD round fits into the broader Uber interview loop. The machine coding round is often the hardest hurdle because it requires a rare blend of speed, architectural foresight, and syntactical accuracy. Unlike the High-Level Design (HLD) round where you draw boxes representing databases and load balancers, the LLD round requires you to implement the actual internal logic of one of those boxes.
| Round | Duration | Focus Area |
|---|---|---|
| Phone Screen | 45-60 mins | Data structures, algorithms, and basic problem-solving skills. |
| Machine Coding / LLD | 90-120 mins | Working OO code, design patterns, concurrency, and handling edge cases. |
| System Design (HLD) | 60 mins | Scalability, distributed architecture, and technical trade-offs. |
| Domain / Deep Dive | 60 mins | Past experience, deep technical probing, and architecture review. |
| Behavioral | 45-60 mins | Uber cultural values, conflict resolution, and teamwork. |
Core Concepts for Uber's Machine Coding Round
Beating the Uber machine coding round means showing absolute mastery over object-oriented principles (SOLID) and concurrency. Your interviewer wants to see modular code designed so that new features can drop right in without modifying existing classes. You will need to be totally comfortable with design patterns. Think Strategy for interchangeable algorithms like pricing models, Observer for pub-sub event handling (like notifying a rider when a driver moves), and Factory for object creation. Because Uber's systems handle massive bursts of concurrent requests, your in-memory data structures also have to be completely thread-safe. A simple HashMap will not survive this round; you need to understand when to use ConcurrentHashMap, when to use atomic variables, and when you absolutely must lock a resource.

Deep Dive 1: How do you design a concurrent task scheduler?
This is a classic Uber LLD question. They will ask you to build an in-memory task scheduler capable of executing tasks at a given delay or on a fixed interval, very similar to a Cron job or Java's ScheduledExecutorService. The interviewer is specifically watching how you handle thread pooling, task prioritization, and concurrency controls. If you just use a basic list and a while-loop that constantly checks the time, you will fail due to CPU starvation. You need an efficient, event-driven approach.
- Core Entities: Define a Task class containing a unique ID, a scheduled execution time (Unix timestamp), and a runnable payload. You will also need a Scheduler class to manage submission and execution, plus a WorkerThread pool to actually run the payloads.
- Data Structure: Rely on a thread-safe PriorityQueue ordered by the scheduled execution time. The task with the earliest execution time must always be at the head of the queue. If you are using Java, you can mention DelayQueue, but interviewers often ask you to build the underlying logic yourself to prove you understand it.
- Concurrency Control: This is where candidates fail. Bring in ReentrantLocks and Condition variables. When a worker thread polls the queue and finds the top task is not ready to run yet, the thread needs to wait efficiently. It calls condition.await(timeUntilExecution). It stays asleep until the required time hits, or until a new task is submitted.
- The Preemption Edge Case: What happens if Thread A is sleeping for 10 seconds waiting for Task X, but a user suddenly submits Task Y which needs to run in 2 seconds? Your submission method must insert Task Y into the PriorityQueue and immediately call condition.signalAll(). This wakes up Thread A, which recalculates the head of the queue, sees Task Y, and goes back to sleep for only 2 seconds.
- Trade-offs: Relying on a single lock for the entire queue can quickly turn into a bottleneck if thousands of tasks are submitted per second. Mentioning concepts like lock striping, multiple queues per thread, or using a concurrent skip list signals seniority to your interviewer, even if time constraints force you to stick with the simpler PriorityQueue approach for the actual code.
Deep Dive 2: How do you design a distributed rate limiter?
People usually talk about rate limiters during High-Level Design, but Uber frequently brings them up in the LLD round to test your grasp of algorithms like Token Bucket or Sliding Window Log. The main focus here is nailing the class structure and ensuring thread-safe execution for a single node, while designing the interfaces so they can easily be extended to a distributed Redis cache later on.
- Core Interfaces: Draft a RateLimiter interface with a boolean method allowRequest(String userId). Create a TokenBucketRateLimiter implementation, and a RuleManager that fetches limits (e.g., 5 requests per minute) per user or API endpoint. This separation of concerns proves you understand SOLID principles.
- Lazy Refill Strategy: Do not create a background thread that runs every second to refill tokens for millions of users. That will crash your system. Instead, refill tokens lazily. When a user makes a request, calculate the time elapsed since their last request, multiply that by the refill rate, and add those tokens to their bucket right then and there.
- Concurrency and Math: Wrapping the token count in an AtomicInteger is not enough because you have to update both the token count and the last-refill timestamp simultaneously. If two requests come in at the exact same millisecond for the same user, a race condition occurs. You must use a synchronized block or a ReentrantLock specifically keyed to that user's bucket to ensure the check-and-update operation is atomic.
- Memory Management: Account for memory footprints. If a user makes one request and never comes back, their bucket stays in your ConcurrentHashMap forever. You must implement or discuss an eviction strategy, such as a Time-To-Live (TTL) map or a periodic background cleanup thread that removes stale user records.
Deep Dive 3: Designing a Ride-Matching System
Because it is Uber, you have a high chance of being asked to design a simplified version of their core dispatch system. The prompt usually goes like this: Design a system where riders can request a ride, and the system finds the nearest available driver. The complexity lies in managing state transitions and applying different matching algorithms.
- Core Entities: You need Rider, Driver, Location, RideRequest, and Trip classes. The Trip class should act as a state machine (CREATED, MATCHED, IN_PROGRESS, COMPLETED).
- The Strategy Pattern: Uber does not just match based on distance. Sometimes they match based on driver ratings, or priority tiers (UberX vs Uber Black). Create a MatchingStrategy interface with a method findMatch(RideRequest request, List<Driver> availableDrivers). Implement a NearestDriverStrategy and a HighestRatedDriverStrategy. This shows the interviewer you know how to make systems extensible.
- The Observer Pattern: When a driver accepts a ride and starts moving, the rider needs constant updates. Implement an Observer pattern where the Trip acts as the Subject. The Rider registers as an Observer. Every time the Driver updates their Location, the Trip notifies the Rider.
- Geospatial Workarounds: In a 90-minute LLD, you will not have time to build a fully functioning QuadTree for spatial indexing. Acknowledge this upfront. Create a LocationManager interface with a method getDriversWithinRadius(Location loc, double radius). For the interview, implement a naive brute-force version that iterates through a list of available drivers, but explicitly tell the interviewer that in production, this interface would be backed by a QuadTree or Geohash service.
The 90-Minute Execution Playbook
Knowing the technical details is only half the battle; managing your time is the other. Many brilliant engineers fail the machine coding round because they spend 60 minutes arguing about requirements and only leave 30 minutes to write code. You need a strict execution strategy to ensure you cross the finish line with a working application.
- Minutes 0-15 (Requirements & Scope): Read the prompt. Ask clarifying questions. What are the scale limits? Do we need to handle multi-threading explicitly? Write down the exact use cases you will support. Do not over-engineer features they did not ask for.
- Minutes 15-30 (API & Interfaces): Draft the public methods, core interfaces, and basic models. Do not write the internal logic yet. Show this skeleton to your interviewer and ask, 'Does this structure align with what you are looking for?' Getting early buy-in prevents massive rewrites later.
- Minutes 30-70 (Core Logic & Concurrency): This is the heavy lifting. Implement the hardest parts first. If it is a scheduler, build the queue and the lock mechanisms. If it is a rate limiter, build the lazy refill logic. Leave the easy stuff (like getters, setters, and basic printing) for last.
- Minutes 70-90 (Driver Code & Edge Cases): Write a Main class that proves your code works. Spawn a few threads, submit some requests, and print the output. Handle edge cases like empty inputs, negative time values, or concurrent modifications. A working, slightly unpolished system always beats a perfectly polished system that does not compile.
How AcePrompt AI Assists You Live During Uber's Coding Rounds
Trying to write flawless, thread-safe, object-oriented code while a 90-minute clock ticks down is incredibly stressful. That is exactly where AcePrompt AI steps in as your real-time interview copilot. While the interviewer explains the LLD problem, AcePrompt listens in and instantly suggests the best design patterns, core class structures, and concurrency controls right on your screen. If you ever hit a wall with a tricky ReentrantLock implementation, forget how to properly structure a Strategy pattern, or blank on the exact syntax for a DelayQueue, AcePrompt gives you the exact, context-aware guidance required to keep coding smoothly and confidently.
Frequently asked questions
What programming language should I use for the Uber LLD round?
You can generally use any mainstream language like Java, C++, Python, or Go. That said, Java is highly recommended—and easily the most common choice—thanks to its robust built-in concurrency utilities and incredibly strong object-oriented features.
Do I need to write fully compilable code?
Absolutely. Unlike standard algorithmic whiteboard interviews, the machine coding round usually happens in an IDE or a platform like HackerRank. Your code definitely needs to compile, run, and pass basic test cases. Syntax errors will count heavily against you.
How much time is given for the machine coding round?
Candidates typically get between 90 to 120 minutes. That window includes the time you will spend reading the prompt, clarifying requirements, designing the class structure, writing the actual code, and testing it.
Are external libraries allowed in the LLD round?
Usually, no. The expectation is that you will build the solution using only the standard library of your chosen programming language. This forces you to prove your fundamental understanding of data structures and concurrency from the ground up without relying on frameworks like Spring.
More Uber interview guides
- How to pass the Uber data engineer interview
- How to pass the Uber mobile system design interview
- How to Prepare for the Uber Product Manager Jam Session
- Passing the Uber system design interview for real-time dispatch
Related comparisons
See AcePromptAI in action
Watch how AcePromptAI supports a real technical round - structured answers, tuned to your resume, in real time.
Ace your Uber LLD round with real-time AI guidance.
Get started