Week 16 — Real LLD Questions & Greedy

advanced lld dsa devops

Goal: Practice LLD machine coding questions — design classes, relationships, and implement core logic. This is the week where OOP theory meets real implementation.

Topics

DayFocusTopics
MonLLD — Parking & ElevatorDesign a Parking Lot · Design an Elevator System
TueLLD — BookMyShow & VendingDesign BookMyShow · Design a Vending Machine
WedLLD & DSADesign Snake & Ladder · Design Library Management · Greedy Algorithms
ThuDSA PatternsBacktracking · Interval Problems · Binary Search on Answer
FriDevOps BasicsDocker Basics · Writing a Dockerfile

Key Concepts

  • Parking lot — vehicle hierarchy (car, bike, truck), strategy for spot allocation, fee calculation
  • Elevator system — state machine (idle, moving up, moving down), scheduling algorithm (LOOK, SCAN)
  • BookMyShow — seat locking with TTL, concurrency handling, payment timeout flows
  • Vending machine — state pattern (idle, coin inserted, dispensing), inventory management
  • Snake & Ladder — board modeling, dice abstraction, game loop, player turns
  • Greedy choice property — locally optimal leads to globally optimal (activity selection, fractional knapsack)
  • Backtracking template — choose, explore, unchoose (N-Queens, permutations, subsets)
  • Binary search on answer — when the answer space is monotonic (minimum time, maximum distance)
  • Interval problems — merge, insert, non-overlapping count, meeting rooms
  • Docker fundamentals — images, containers, volumes, networks, and the build-ship-run workflow
  • Dockerfile best practices — multi-stage builds, layer caching, minimal base images

Practice

  • Code the Parking Lot system end-to-end — classes, relationships, and a working CLI demo
  • Solve 2 interval problems — merge intervals and meeting rooms II
  • Containerize a simple Node.js app with a Dockerfile — use multi-stage build for production
  • Solve an N-Queens variant using the backtracking template

~12 topics · ~1.5-2 hrs/day · Focus: read the linked notes, then code each concept