Low-level design

Machine-coding case studies

Full interview designs. 6 lessons where the diagrams draw themselves, one class and one message at a time, with the theory and the code beside them.

  • 6 lessons
  • Animated diagrams

Sign in with Google or GitHub and you land straight on this page. DSA comes with the all labs plan and every ChaiCode batch.

6 lessons, each with diagrams that draw themselves.

In this module

  • The classic machine-coding round. Multi-level lot, vehicles of different sizes, ticket on entry, fee on exit. We go requirements → classes → patterns → flow.
  • Select a product, insert coins, dispense the item, return change. The textbook use-case for modelling behaviour as a STATE machine instead of a tangle of flags.
  • Group expense sharing: add an expense, split it (equally / exact / by %), and track who owes whom, then simplify the debts.
  • A clean OO model of a turn-based board game, board, players, moves, and win detection, designed so it generalises to N×N or other grid games.
  • Browse shows, pick seats, and book them, where the whole difficulty is concurrency: two users must never book the same seat.
  • Multiple elevators, hall and cabin requests, and a scheduler that decides which car goes where, modelled with a direction State machine and a pluggable dispatch Strategy.

More low-level design

Start Machine-coding case studies

Sign in and the first lesson opens with its diagram ready to play.

DSA comes with the all labs plan and every ChaiCode batch.