System Design Interview Questions: 20 HLD and LLD Questions with Answers
By Modern AI Engineering · · 9 min read
System design interviews reuse a small set of questions. That is good news, because each question is there to test one idea. If you know the idea, you can answer the question and its variations.
This article lists twenty questions that are widely reported from interviews at large technology companies: ten high-level design (HLD) questions and ten low-level design (LLD) questions. For each one you get the key idea the interviewer is waiting to hear.
How to answer any HLD question
- Requirements: two or three things the system must do, the targets for speed and uptime, and what is out of scope.
- Scale: a quick estimate of requests per second, and whether the system is read-heavy or write-heavy.
- Core idea: the one decision the whole design turns on.
- Architecture: the simplest version first, then one component at a time, each for a named problem.
- Trade-offs and failures: what breaks first, what you would do, and what that costs.
10 HLD interview questions and the key idea behind each
| Question | Key idea |
|---|---|
| Design a URL shortener | A unique id written in base 62 gives short codes that never collide; cache the redirects, because reads far outnumber writes |
| Design a rate limiter | A token bucket per user, with the counts in a shared store so that every gateway agrees |
| Design a chat app like WhatsApp | A persistent connection per phone, a lookup of which server holds each user, and save before deliver |
| Design a news feed | Push posts to followers for ordinary accounts, pull for celebrities, and merge when the feed is read |
| Design a ride-hailing app like Uber | A geospatial index: split the map into cells and search the rider's cell and its neighbours |
| Design a video platform like YouTube | Upload in chunks, transcode in the background, serve from a CDN |
| Design search autocomplete | A trie of popular queries with the top results stored at each node |
| Design a notification system | A queue per channel, retries with backoff, and deduplication by notification id |
| Design a payment system | An idempotency key on every request so that a retry never charges twice |
| Design a file storage service like Dropbox | Split files into blocks and upload only the blocks that changed |
How to answer any LLD question
- Clarify: ask three or four questions about scope and write the answers down.
- List the entities: nouns become classes and verbs become methods.
- Draw the class diagram: boxes, relationships, and an interface for anything that varies.
- Walk the main flow: one sequence diagram to check that the classes can complete the use case.
- Code the core: the classes for the main flow, with clear names and short methods.
- Extend: show which class absorbs a new requirement, and mention concurrency and edge cases.
10 LLD interview questions and the key idea behind each
| Question | Key idea |
|---|---|
| Design a parking lot | Small classes with one job each, and pricing behind an interface so it can change |
| Design an LRU cache | A dictionary to find items plus a doubly linked list to order them gives O(1) get and put |
| Design Splitwise | A Strategy for how to split, and one net balance per person for settling |
| Design an elevator system | The State pattern for the lift, and a scheduling Strategy for which request to serve next |
| Design a vending machine | The State pattern: idle, has money, dispensing |
| Design a movie ticket booking system | Hold a seat with an expiry and make the booking atomic, so two people cannot take one seat |
| Design chess or tic-tac-toe | Polymorphism: each piece knows its own legal moves |
| Design a library management system | Separate a book title from its physical copies |
| Design a logging framework | One shared logger, and a Strategy for where the logs are written |
| Design a food delivery app | Observer for order status updates, Strategy for assigning a rider |
What interviewers look for
- You ask about requirements and scale before you design.
- Your numbers change a design decision.
- Every component or class has a reason you can state.
- You name the trade-off of each choice without being asked.
- You say what happens when something fails, or when two users act at the same moment.
- You think aloud, and you adapt when a requirement changes.
Worked solutions with diagrams and code
A list of key ideas is a revision aid. To answer well you need to have built the designs yourself. The AI Engineering Bootcamp solves six of these questions in full: a rate limiter, a chat system and a news feed for HLD, and a parking lot, an LRU cache and Splitwise for LLD. Each solution has an architecture or UML diagram that you build one step at a time, a sequence diagram, and Python code you can run in your browser.
Frequently asked questions
What are the most common system design interview questions?
For HLD: URL shortener, rate limiter, chat app, news feed and ride hailing. For LLD: parking lot, LRU cache, Splitwise, elevator and vending machine.
How do I prepare for a system design interview?
Learn a method for HLD and one for LLD, then practise it on ten to fifteen questions. Draw every design yourself and explain each choice aloud.
What is a machine coding round?
An interview where you design the classes for a small system and write working code for the main flow, usually in 60 to 90 minutes.
Do I need to write code in a system design interview?
In an HLD round, usually not. In an LLD or machine coding round, yes: at least the core classes and the main flow.
How is a system design interview scored?
Mostly on your reasoning: whether you clarified requirements, used estimates, justified each choice and discussed trade-offs and failures. There is rarely one right answer.