Gronex
Log in

Coding Problems

58 guides

What each machine coding and debugging problem tests, and how to approach it.

Hotel Room Booking SystemA hotel booking system low level design interview problem you solve in a real backend repository. Practice date-range overlap checks, half-open check-in/check-out intervals, and cancellation rules — against failing tests, not a whiteboard.Machine coding and LLDLoyalty Points and Tier Management System Coding ProblemA loyalty points system LLD interview problem you solve in a real backend repository. Practice FIFO point-lot expiry, oldest-first redemption, tier recalculation, and idempotent earn events — with failing tests. Free to try.Machine coding and LLDDistributed Job SchedulerA distributed job scheduler system design interview problem made concrete in a real repository. Practice single-owner leases, exactly-once execution, worker crash recovery, and claim races — against failing tests.Machine coding and LLDFlash Sale Inventory SystemA flash sale system design interview problem in a real backend repo: prevent overselling when thousands of buyers race the same stock. Practice atomic check-and-decrement, per-item locking, and purchase integrity — against failing tests.Machine coding and LLDFile Upload DeduplicationA file upload system design interview problem in a real backend repo: multipart upload finalization, checksum-based deduplication, and safe cleanup under concurrency — solved against failing tests.Machine coding and LLDFood Delivery Order Status Tracker Coding ProblemA food delivery order tracking system LLD problem you solve in a real backend repository. Practice order lifecycle state machines, legal transitions, cancellation rules, and status history — against failing tests.Machine coding and LLDE-Commerce Coupon EngineA coupon system low level design interview problem in a real backend repository. Practice eligibility rules, stacking, discount caps, and idempotent redemption in a checkout flow — against failing tests.Machine coding and LLDWallet Transaction and Refund System Coding ProblemA wallet system design interview problem you solve in a real backend repository. Practice ledger consistency, idempotent credits and debits, refund caps, and balance invariants — the payment wallet LLD round, with failing tests.Machine coding and LLDMessage Queue ConsumerA message queue consumer interview problem in a real backend repository. Practice at-least-once delivery, idempotent message effects, exponential backoff retries, and dead-letter queues — against failing tests.Machine coding and LLDURL ShortenerThe URL shortener interview question as a real backend repository: alias uniqueness, per-user quotas, expiry-aware resolution, and owner-only deletion — solved against failing tests, not on a whiteboard.Machine coding and LLDAuction Bidding SystemAn auction bidding system interview problem in a real backend repository. Practice race-safe bid placement, per-auction critical sections, and closing an auction exactly once while bids are still arriving.Machine coding and LLDMarketplace Escrow SystemA marketplace escrow system interview problem in a real backend repository. Practice concurrency-safe held-balance release, terminal-state guards, deadline-based auto-release, and ledger reconciliation.Machine coding and LLDFeature Flag SystemA feature flag system interview problem in a real backend repository. Practice priority-ordered rule evaluation, deterministic percentage bucketing, environment isolation, and kill-switch precedence.Machine coding and LLDSubscription BillingA subscription billing system interview problem in a real backend repository. Practice mid-cycle proration math, idempotent invoicing, subscription lifecycle states, and dunning transitions — against failing tests.Machine coding and LLDRide Booking Driver Matching Coding ProblemThe ride booking / driver matching interview problem in a real backend repository. Practice candidate selection, deterministic assignment with tie-breaks, and release-on-cancel — the Uber/Ola-style LLD round.Machine coding and LLDNotification SystemA notification system design interview problem in a real backend repository. Practice channel preferences, quiet-hours suppression, and idempotent delivery that survives retries — free to try, no signup to read.Machine coding and LLDCalendar Slot BookingA shared calendar slot booking interview problem in a real backend repository. Practice multi-attendee booking, per-owner ordered locking to prevent deadlock, and race-free double-booking checks.Machine coding and LLDInventory Stock ReservationAn inventory reservation system interview problem in a real backend repository. Practice reserved-versus-available accounting, duplicate line merging, all-or-nothing rollback, and cancel/confirm stock transitions.Machine coding and LLDAirflow DAG Dependency & Idempotent Load Coding ProblemA data engineering interview problem in a real Python repository: fix a scheduler that runs tasks out of dependency order and double-counts on retry. Practice topological execution and idempotent loads against failing tests.Machine coding and LLDPandas Join Fan-out & Deduplication Coding ProblemA data engineering interview problem in a real Python repository: a many-to-many pandas join inflates row counts and a dedup on the wrong subset hides it. Fix the join grain against failing tests.Machine coding and LLDSQL Window Function Partitioning Coding ProblemA data engineering interview problem in a real repository over SQLite: a ROW_NUMBER() with the wrong partition/order keeps the wrong row and a running-total frame is off. Fix the window functions against failing tests.Machine coding and LLDIncremental CDC Merge & Late-arriving Data Coding ProblemA data engineering interview problem in a real Python repository: an incremental watermark load drops late-arriving records and keeps a stale version on merge. Fix the incremental/CDC merge against failing tests.Machine coding and LLDData Leakage in a Feature Pipeline Coding ProblemAn ML engineering interview problem in a real Python repository: a preprocessing pipeline fits on the whole dataset before the split and a target-derived feature leaks the label. Fix the leakage against structural, bounded tests.Machine coding and LLDModel Serving Prediction API Contract Coding ProblemAn ML engineering interview problem in a real Python repository: a FastAPI /predict endpoint whose Pydantic schema and input validation do not match the contract. Fix the serving API against TestClient assertions.Machine coding and LLDML Metric Computation & Pooling Coding ProblemAn ML engineering interview problem in a real Python repository: a precision/recall miscompute and per-batch averaging that disagrees with pooled ground truth. Fix the metric functions against sklearn across thresholds.Machine coding and LLDML Training Loop Gradient Bug Coding ProblemAn ML engineering interview problem in a real Python repository: a from-scratch logistic-regression trainer whose regularization gradient has the wrong sign, so loss diverges. Fix the training loop against structural, bounded tests.Machine coding and LLDAPI Client Pagination & Retry Coding ProblemA forward deployed engineering interview problem in a real Python repository: a paginated API client drops the last page and retries without backoff or idempotency on 429. Fix the client against an injected fake transport.Machine coding and LLDCustomer Data Schema Mapping Coding ProblemA forward deployed engineering interview problem in a real Python repository: inbound CSV/JSON with inconsistent types and nulls that a mapper coerces wrong and silently drops. Fix the ingestion mapping against failing tests.Machine coding and LLDWebhook Idempotency & Ordering Coding ProblemA forward deployed engineering interview problem in a real Python repository: out-of-order and duplicate webhook events corrupt state unless you dedupe by id and apply by version. Fix the handler against failing tests.Machine coding and LLDConnector Record Reconciliation Coding ProblemA forward deployed engineering interview problem in a real Python repository: a sync job whose upsert/delete diff deletes records it should keep and misses updates. Fix the reconciliation against failing tests.Machine coding and LLDCDC Search Index SynchronizationDebug a PostgreSQL CDC projector that misses deletes, exposes uncommitted changes, and duplicates search documents when a batch is replayed.Production debuggingConnection Pool Exhausts After Failed RequestsFix a PostgreSQL report service that leaks pooled connections on exceptions and returns sessions while they are still idle in transaction.Production debuggingDatabase Overload Under A Traffic SpikeRepair an order-history endpoint whose missing index, N+1 queries, and unbounded results saturate PostgreSQL during traffic spikes.Production debuggingOne Tenant's Volume Slows Every TenantFix tenant event queries that fail partition pruning, allowing one high-volume tenant to slow reads for every customer in PostgreSQL.Production debuggingInventory Overselling Under ConcurrencyFix a PostgreSQL reservation transaction that oversells stock and creates duplicate reservations when concurrent requests and retries collide.Production debuggingCatalog Pagination Skips and Repeats ProductsReplace unstable LIMIT/OFFSET catalog pagination that skips, repeats, and scans deeply when products change between page requests.Production debuggingPayment Ledger ConsistencyRepair a refund workflow that permits unbalanced ledger entries, duplicate refunds, and balance drift outside a PostgreSQL transaction.Production debuggingRead Replica Serves Stale Data After a WriteRestore session read-after-write consistency while retaining replica reads once PostgreSQL replication catches up to the write sequence.Production debuggingOutbox Publishes Phantom and Duplicate EventsFix phantom, missing, and duplicate order events by making outbox writes atomic and concurrent PostgreSQL publishers safe.Production debuggingZero-Downtime Column Split Loses RowsRepair an expand-contract migration whose bounded backfill skips users and whose live write path leaves new columns empty.Production debuggingAllocation rate explosion in telemetry enrichment hot pathUse allocation evidence to optimize a telemetry enrichment path that creates short-lived garbage and drives constant GC without retaining memory.Production debuggingCoarse lock convoy in shared registryDiagnose a feature registry whose exclusive lock serializes cheap readers behind an expensive rebuild and destroys throughput under load.Production debuggingEvent listener registration leak in a collaboration serverUse heap evidence to find closed collaboration sessions retained by a process-wide event bus and restore listener lifecycle symmetry.Production debuggingFinalizer and cleaner backlog in a scratch file serviceMake scratch-file cleanup deterministic when finalizers cannot keep pace, leaving file descriptors and temporary files alive after jobs finish.Production debuggingFull Result Materialization Heap SpikeFix a CSV export that materializes an entire database result before chunking, making peak heap grow with rows instead of chunk size.Production debuggingHumongous allocation region pressureReshape a renderer that allocates one contiguous payload-sized buffer per request, triggering expensive GC cycles at low heap occupancy.Production debuggingLock leaked on exception pathUse a thread dump to diagnose a settlement lock that remains owned after poisoned input throws, blocking every later request forever.Production debuggingLock ordering deadlock in transfer pathRead a deadlocked ledger thread dump and establish deterministic lock ordering for simultaneous opposite-direction account transfers.Production debuggingMissed signal in a handoff queueDiagnose consumers parked during shutdown because queue state changes and condition-variable signaling do not form a correct protocol.Production debuggingOff-Heap Buffer Churn Full GC StormRead GC evidence showing full collections reclaim almost no heap, then bound native buffer churn with a reusable pool.Production debuggingRule bundle reloads never release the previous generationUse heap retainer evidence to find why hot-reloaded rule bundles, classes, and generation state never become collectible.Production debuggingPremature promotion and survivor overflow in a batch rollupReshape a batch rollup whose retained intermediates overflow survivor space and promote short-lived records into the old generation.Production debuggingThread-local retention in pooled workersTrace request contexts retained by long-lived worker thread-local storage after a payment pipeline has completely drained.Production debuggingThread pool starvation from nested task submissionDiagnose a fixed executor where every batch worker blocks waiting for shard tasks queued to the same fully occupied pool.Production debuggingUnbounded Cache Heap ExhaustionUse heap evidence to repair a freight quote cache that retains request-specific keys, misses reuse, and grows with total traffic.Production debuggingSeat Reservation SystemConcurrent seat holds, validation before mutation and listing order.Machine coding and LLDConcurrent Bank TransferTransfers between accounts without deadlocks or lost updates.Machine coding and LLDRate LimiterToken bucket and sliding window limiters, per client and under concurrency.Machine coding and LLD