Unit 7: Low-level design questions
Practise the classic LLD questions end to end: requirements, classes, patterns, the key code and concurrency.
The big picture
Every LLD question tests the same skills: turning requirements into clean classes, using a pattern where something varies, and handling two users acting at once. Do each question yourself first, then compare with the notes.
Lessons in this unit
- Design a parking lot: Design the classes for a multi-floor car park that assigns spots, issues tickets and charges fees.
- Design an elevator system: Design the classes and scheduling logic for a building's lifts.
- Design Splitwise (expense sharing): Design an expense-sharing app where friends split bills and can see who owes whom.
- Design a vending machine: Design a vending machine that sells items, accepts coins and gives change.
- Design an LRU cache: Design a fixed-size cache that removes the least recently used item when full, with get and put in O(1).
- Design an order-matching engine (stock exchange): Design the core of a stock exchange: an order book that matches buy and sell orders.