Skip to content
Preptima

Machine Coding Round interview questions

Machine coding round questions such as parking lot, rate limiter, Splitwise, elevator, vending machine, and other timed build-it problems.

14 questions in Low-Level Design & OOD.

medium8

mediumCodingDesign

Design a rate limiter that allows N requests per client per minute. Write the class.

A rate limiter machine coding solution should reject fixed-window boundary bursts, usually with a token bucket. It needs no per-request history and stores two numbers per client, but only if refill is computed lazily from a timestamp rather than by running a background thread. Use this rate limiting answer to show the decision, trade-off, and evidence rather than a memorised definition.

4 minmid, senior

hard6

hardCodingDesign

Design an elevator system for a building with N lifts. When someone presses the call button, which lift answers, and where in your code is that decided?

An elevator system splits into a state machine per lift that decides its own next floor, and a dispatcher that assigns each hall call to one lift through a pluggable strategy such as a nearest-suitable-car cost. Car buttons go straight to their lift, and one control loop owns all state, so no god class and no locks.

6 minmid, senior
hardDesignCoding

Design a parking lot system — you have 90 minutes, working code at the end.

In a parking lot machine coding round, scope one deterministic flow of park, unpark and charge, model Vehicle, Slot, Level, Ticket and a ParkingLot facade, then push slot allocation and pricing behind strategy interfaces so review-time variants are configuration rather than surgery.

6 minmid, senior, staff