Case Studies
Worked OOD interview problems — Parking Lot, Elevator, ATM, Chess, Hotel, LinkedIn, and more. Each one demonstrates a class of design decisions.
Case studies are the substrate of LLD interview prep. Each problem in this topic is a real interview prompt from a major company's loop, presented end-to-end: requirements clarification, use case diagram, class diagram, sequence diagrams for key flows, activity diagram for non-trivial state, Java implementation sketch, and trade-off discussion. The 21 case studies here span five archetypes — physical resources (Parking Lot, Elevator, Locker, Vending), transactional (ATM, Movie Booking, Stock Brokerage, Airline), content / social (Stack Overflow, Facebook, LinkedIn, ESPNcricinfo), gaming (Chess, Blackjack, Jigsaw), and operational (Library, Hotel, Restaurant, Car Rental, Amazon Shopping, Meeting Scheduler).
For effective prep, work through 5-7 case studies deeply rather than 21 superficially. The patterns repeat — once you've done Parking Lot you've effectively done half of Hotel and Movie-Booking; once you've done Vending Machine you've done a quarter of ATM. Internalise the *approach*, not the answer.
Key concepts
- Every system writeup follows the same 9-section structure — interviewers expect that flow
- Functional vs non-functional requirements must be separated explicitly
- The class diagram is the centrepiece — get it right and the rest follows
- Concurrent access (seat booking, locker assignment) is the most-asked follow-up
- State machines on the central aggregate (rental, order, ticket, booking) are the load-bearing structure
- Multi-aggregate transactions (booking + seat-hold + payment) recur — design the seam, not the saga
- A clear, defended Java implementation sketch beats a sprawling exhaustive one
Reference template
// Reading a system writeup
## Context — what the problem is and isn't
## Requirements — functional + non-functional, separated
## Use case diagram — actors and headline use cases
## Class diagram — entities, relationships, multiplicities
## Sequence diagram — one or two key flows in dynamic detail
## Activity diagram — only where state machine is non-trivial
## Java implementation — sketch one or two classes in full
## Trade-offs — what we gave up, what would change at 10x scale
## Mock interview follow-ups — questions a real interviewer asks next Adapt to your problem; the structure is the load-bearing part.
Common pitfalls
- Modelling for an imaginary future instead of stated requirements
- Drowning the class diagram with helper classes and DTOs that don't belong
- Skipping the sequence diagram and waving hands at 'orchestration'
- Forgetting concurrency — every booking / locker / queue system gets a race-condition question
Related topics
Items (21)
- Parking Lot
The canonical OOD interview problem. Multi-floor lot, spot types, tickets, payment. The first hour of every LLD prep.
System Foundational - Elevator System
Single and multi-elevator scheduling, request handling, state machine, edge cases (maintenance mode, emergency stop).
System Intermediate - Library Management System
Books, members, borrowing/returning, reservations, fines. The classic CRUD-plus-rules domain model.
System Foundational - Amazon Locker Service
Locker assignment, package lifecycle, OTP-based pickup, expiry, capacity planning across sizes.
System Intermediate - Vending Machine
State-pattern showcase — idle, selection, payment, dispense. Coin and bill handling, refund flow.
System Foundational - Meeting Scheduler
Calendar, rooms, attendees, conflicts, recurring events. Where availability search meets booking integrity.
System Intermediate - Movie Ticket Booking System
Theatres, shows, seats, holds, payment, concurrent booking. The seat-lock race condition every candidate misses.
System Intermediate - ATM System
Card, PIN, account, transaction, cash dispenser, hardware abstraction. State machine plus banking ops.
System Foundational - Chess Game
Board, pieces, moves, rules engine, check/checkmate, game state. Polymorphism over piece behaviour.
System Intermediate - Hotel Management System
Rooms, room types, reservations, check-in/out, billing, housekeeping. A multi-actor domain done right.
System Intermediate - Amazon Online Shopping System
Catalogue, cart, order, payment, inventory, shipping. The end-to-end e-commerce domain in one OOD.
System Advanced - Online Blackjack Game
Player, dealer, deck, hand, round. State machine on the round and a Strategy for dealer policy — the cleanest cards-game OOD.
System Intermediate - Car Rental System
Fleets, reservations, pickup/return, insurance, billing. State machine on the rental and a Strategy for tiered pricing.
System Intermediate - Stack Overflow
Questions, answers, votes, comments, badges, tags. Reputation as derived state; moderation as a workflow.
System Advanced - Restaurant Management System
Tables, reservations, orders, menu, bill, waiter, chef. Order state machine plus table-assignment Strategy.
System Intermediate - Facebook
Users, friendships, posts, reactions, comments, groups, pages. Friendship state machine plus Observer for notifications.
System Advanced - Online Stock Brokerage System
Accounts, portfolios, market/limit/stop orders, matching, transactions. Order state plus price-time matching strategy.
System Advanced - Jigsaw Puzzle
Puzzle, piece, solver. The lightest case study — focus is the class model and a recursive backtracking solver.
System Foundational - Airline Management System
Aircraft, flights, schedules, crew, bookings, seats, itineraries. Multi-aggregate transactional design at scale.
System Advanced - ESPNcricinfo
Tournaments, matches, innings, overs, balls, scorecards. Ball-by-ball event stream plus Observer for live-score subscribers.
System Advanced - LinkedIn
Profiles, connections, feed, messaging, search. Social-graph mechanics expressed as an object model.
System Advanced