Courses / Machine Coding and Low-Level Design in TypeScript
Course · Beta · FreeMachine Coding and Low-Level Design in TypeScript
Start with the four ideas behind classes and the UML diagrams design rounds use. Learn SOLID and the patterns that keep appearing, each on code that breaks without it. Then work 21 design problems with one six-step method: requirements, use cases, class diagram, sequence or state diagram, code with tests, and extensions. Every snippet runs on Node 24 with node:test, and a final chapter gives five timed prompts with model answers.
0 of 28 chapters done · saved on this device
Try a scene from chapter 1
Watch for the late requirement going back to the model, not straight to the code
Read it as steps
A prompt moves through clarifying, the model, code, tests and a demo; a late requirement returns to the model
What you will be able to do
- Explain encapsulation, abstraction, inheritance and polymorphism with TypeScript you can run on Node
- Turn a vague prompt into requirements, use cases and a class diagram in the first 15 minutes
- Draw sequence and state diagrams and turn them into code that rejects illegal transitions
- Apply SOLID and the common design patterns where they pay off, and say when they do not
- Build a working, tested design for problems like a parking lot, an ATM or cinema seat booking
- Prevent double bookings and expired holds in single-threaded async code, with tests that prove it
- Extend a finished design with a new requirement while touching as few files as possible
Who it is for
Working engineers with about 2 to 10 years of experience, mostly in JavaScript or TypeScript, preparing for machine coding and low-level design rounds at product companies, GCCs and global teams. Also for engineers who write classes every day but have never drawn a state machine or applied a pattern on purpose.
You will need
Comfort writing JavaScript and basic TypeScript: functions, classes, arrays, objects and async code. Node 22.18 or later to run TypeScript files directly (every example is tested on Node 24). No Java, database, Docker or cloud account is needed.
Pick a path
Curriculum
11 modules · 28 chapters · 15 hModule 1The round0 of 1 done
What machine coding and low-level design rounds ask for, how they are scored, a method that works on any prompt, and a study plan.
Module 2Objects and object-oriented design0 of 2 done
The four ideas classes are built on, in TypeScript that runs on Node, then UML: use case, class, sequence, activity and state diagrams.
- Not started: 02Cornerstones of OOP in TypeScript: Encapsulation, Abstraction, Inheritance, Polymorphism27 min · 2 scenesClasses and the prototype chain, private state, interfaces, inheritance, polymorphism and composition
- Not started: 03Object-Oriented Design and UML: Use Case, Class, Sequence, Activity and State Diagrams37 min · 3 scenesTurn requirements into objects and relationships, and draw the five UML diagrams design problems use
Module 3Design principles and patterns0 of 2 done
SOLID, DRY, KISS, YAGNI and the Law of Demeter on code that breaks without them, then the creational, structural and behavioural patterns that recur.
- Not started: 04Design Principles: SOLID, DRY, KISS, YAGNI and the Law of Demeter35 min · 2 scenes · interview drillEach principle shown on code that breaks without it, with tests, and when applying it is overkill
- Not started: 05Design Patterns in TypeScript: Creational, Structural and Behavioural38 min · 3 scenes · interview drillSixteen patterns, each on code that breaks without it: factory, strategy, decorator, observer, state and more
Module 4Design problems I: parking, elevators and libraries0 of 4 done
A six-step method for any design problem, then three classic cases: a parking lot, a bank of elevators and a lending library.
- Not started: 06Solving a Design Problem: Requirements to Tested Code in Six Steps26 min · 2 scenesClarify, list use cases, model classes, trace the core flow, build in layers, then extend without rewrites
- Not started: 07Parking Lot: Floors, Spots, Tickets and Fees38 min · 3 scenesFit vehicles to spots, issue tickets, charge by the hour with a fake clock, and keep two gates honest
- Not started: 08Elevator System: Cars, Hall Calls and Dispatching34 min · 3 scenesModel a car as a state machine, order its stops, and choose which car answers each hall call
- Not started: 09Library Management: Catalogue, Copies, Loans, Holds and Fines28 min · 2 scenesSeparate titles from copies, index the catalogue, lend with limits and due dates, and queue holds
Module 5Design problems II: lockers, vending and blackjack0 of 3 done
Parcel lockers with pickup codes, a vending machine built on the state pattern, and a blackjack table with a shoe, hands and payouts.
- Not started: 10Parcel Locker Service: Slots, Pickup Codes and Expiry29 min · 2 scenesFit parcels to the smallest free slot, issue one-time pickup codes, and return what nobody collects
- Not started: 11Vending Machine: States, Payments and Making Change28 min · 2 scenesUse the state pattern for the machine's modes and make change from a limited coin stock
- Not started: 12Online Blackjack: Shoe, Hands, Dealer Rules and Payouts30 min · 2 scenesShuffle with an injected random source, score soft aces, play the dealer by rule, and settle bets
Module 6Design problems III: meetings, cinemas and car rental0 of 3 done
Time ranges and holds: a meeting scheduler with rooms and invites, cinema seat booking that never sells a seat twice, and car rental.
- Not started: 13Meeting Scheduler: Rooms, Calendars, Conflicts and Invites32 min · 2 scenesFind a free slot across calendars, book a fitting room without overlaps, and track every invite reply
- Not started: 14Movie Ticket Booking: Shows, Seat Holds and No Double Booking37 min · 3 scenesSeat maps, holds that expire, and why an await between check and set sells a seat twice
- Not started: 15Car Rental: Fleet, Reservations, Pricing and Returns34 min · 2 scenesCheck availability over date ranges, price a rental with add-ons, and handle late returns and damage
Module 7Design problems IV: ATMs, chess and hotels0 of 3 done
An ATM session with cash cassettes and reversals, a chess engine that validates every move, and a hotel with rooms, stays and folios.
- Not started: 16ATM: Sessions, PIN Checks, Cash Dispensing and Reversals31 min · 3 scenesRun an ATM session as a state machine, dispense notes through a chain, and reverse a failed withdrawal
- Not started: 17Chess: Board, Pieces, Legal Moves and Game End34 min · 2 scenesGenerate moves per piece, reject moves that leave the king in check, and detect checkmate and stalemate
- Not started: 18Hotel Management: Rooms, Bookings, Stays and Billing29 min · 2 scenesBook room types by date, check guests in and out, track housekeeping, and bill a folio
Module 8Design problems V: shopping, Q&A and restaurants0 of 3 done
An online store from cart to shipment, a question and answer site with votes and reputation, and a restaurant with kitchen tickets and bills.
- Not started: 19Online Shopping Store: Catalogue, Cart, Orders and Shipments38 min · 3 scenesSearch a catalogue, reserve stock at checkout, move an order through its states, and notify on events
- Not started: 20Question and Answer Site: Posts, Votes, Reputation and Moderation31 min · 2 scenesQuestions, answers and comments, one vote per member, reputation from events, and closing posts
- Not started: 21Restaurant Management: Tables, Orders, Kitchen Tickets and Bills36 min · 3 scenesSeat parties, route order items to kitchen stations, track each item, and split the bill
Module 9Design problems VI: social, trading and puzzles0 of 3 done
A social network with audiences and a merged feed, a stock brokerage with an order book, and a jigsaw puzzle with a solver.
- Not started: 22Social Network: Friends, Posts, Privacy and the News Feed31 min · 3 scenesFriend requests and follows, posts with audiences, a merged time-ordered feed, and notifications
- Not started: 23Online Stock Brokerage: Orders, Order Book, Matching and Portfolio35 min · 3 scenesMarket, limit and stop-loss orders, price-time matching with partial fills, and blocked funds
- Not started: 24Jigsaw Puzzle: Pieces, Edges, Fitting and a Solver28 min · 2 scenesModel pieces by their four edges, check fits with neighbours under rotation, and solve by backtracking
Module 10Design problems VII: airlines, cricket and careers0 of 3 done
An airline with flights, seats and bookings, a ball-by-ball cricket scorer, and a professional network with connections and jobs.
- Not started: 25Airline Management: Flights, Seats, Bookings and Crew37 min · 3 scenesCut dated flights from a weekly schedule, hold seats for a party, assign crew and rebook after a cancellation
- Not started: 26Live Cricket Scores: Innings, Overs, Ball-by-Ball Events and Commentary34 min · 2 scenesKeep a list of ball events, derive the scorecard from it, undo by removing a ball and feed live subscribers
- Not started: 27Professional Network: Profiles, Connections, Jobs and Search33 min · 3 scenesModel connections as a graph, find degrees with breadth-first search, run job applications and search by skill
Module 11Mock interview0 of 1 done
Five timed prompts, each with a model answer and a rubric, to rehearse the whole round from clarifying questions to extensions.
How this course is made
Written by the aiiolar team. Every chapter is fact-checked by a second reviewer, checked against a shared set of numbers so chapters agree, and checked for originality before it goes up. Found a mistake? Tell us and we fix it within a week.
Questions
Why TypeScript and not Java?
Most engineers this course is for write TypeScript every day, and machine coding rounds usually let you pick your language. Node now runs TypeScript files directly, so every snippet runs without a build step. Where a Java habit would mislead you, such as enums, overloading or threads, the course says so in a sentence.
How is machine coding different from a low-level design round?
Machine coding asks for working, executable code in about 90 minutes, demoed at the end. A low-level design round is usually shorter and leans on diagrams, classes and a code sketch. The first chapter covers both, and the mock chapter has prompts of each kind.
Are these the same problems other courses teach?
The problem types are the classic ones, such as a parking lot, an elevator or an ATM. The requirements, models, code and tests here are written for this course, and products are generic: a parcel locker service, not a named company's lockers.
Does every snippet really run?
Yes. Each one runs on Node 24 with type stripping, passes the TypeScript compiler under the course settings, and every output on the page was copied from a real run. Each design problem ends with node:test tests that pass.
JavaScript has one thread. Can races still happen?
Yes. A check and an update separated by an await can interleave with another request. The parking lot chapter shows two gates giving one spot to two cars and fixes it with a keyed lock, and the movie ticket chapter uses the same lock to stop one seat being held twice, with tests that prove it.
How much time should I plan?
About 15 hours of reading. Most engineers preparing for a round do one design problem a day, trying it alone for 45 to 90 minutes before reading the chapter's solution.