Modern AI Engineering

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

  1. Requirements: two or three things the system must do, the targets for speed and uptime, and what is out of scope.
  2. Scale: a quick estimate of requests per second, and whether the system is read-heavy or write-heavy.
  3. Core idea: the one decision the whole design turns on.
  4. Architecture: the simplest version first, then one component at a time, each for a named problem.
  5. 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

QuestionKey idea
Design a URL shortenerA unique id written in base 62 gives short codes that never collide; cache the redirects, because reads far outnumber writes
Design a rate limiterA token bucket per user, with the counts in a shared store so that every gateway agrees
Design a chat app like WhatsAppA persistent connection per phone, a lookup of which server holds each user, and save before deliver
Design a news feedPush posts to followers for ordinary accounts, pull for celebrities, and merge when the feed is read
Design a ride-hailing app like UberA geospatial index: split the map into cells and search the rider's cell and its neighbours
Design a video platform like YouTubeUpload in chunks, transcode in the background, serve from a CDN
Design search autocompleteA trie of popular queries with the top results stored at each node
Design a notification systemA queue per channel, retries with backoff, and deduplication by notification id
Design a payment systemAn idempotency key on every request so that a retry never charges twice
Design a file storage service like DropboxSplit files into blocks and upload only the blocks that changed

How to answer any LLD question

  1. Clarify: ask three or four questions about scope and write the answers down.
  2. List the entities: nouns become classes and verbs become methods.
  3. Draw the class diagram: boxes, relationships, and an interface for anything that varies.
  4. Walk the main flow: one sequence diagram to check that the classes can complete the use case.
  5. Code the core: the classes for the main flow, with clear names and short methods.
  6. Extend: show which class absorbs a new requirement, and mention concurrency and edge cases.

10 LLD interview questions and the key idea behind each

QuestionKey idea
Design a parking lotSmall classes with one job each, and pricing behind an interface so it can change
Design an LRU cacheA dictionary to find items plus a doubly linked list to order them gives O(1) get and put
Design SplitwiseA Strategy for how to split, and one net balance per person for settling
Design an elevator systemThe State pattern for the lift, and a scheduling Strategy for which request to serve next
Design a vending machineThe State pattern: idle, has money, dispensing
Design a movie ticket booking systemHold a seat with an expiry and make the booking atomic, so two people cannot take one seat
Design chess or tic-tac-toePolymorphism: each piece knows its own legal moves
Design a library management systemSeparate a book title from its physical copies
Design a logging frameworkOne shared logger, and a Strategy for where the logs are written
Design a food delivery appObserver 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.

Learn it properly: the AI Engineering Bootcamp

More articles