MachineCodingLab: Machine coding & low-level design practice in Java, Python, Go and C++
Free, open-source machine coding round and low-level design (LLD) practice: build and debug real backend services such as a rate limiter, LRU cache and job queue, with test suites you run in the browser in Java, Python, Go or C++.
Projects
- Rate Limiter (Easy, build): Protect an inference gateway with token-bucket and sliding-window limits that hold up under 100 concurrent threads.
- Comments & Replies (Easy, build): Model threaded comments with depth limits, soft deletes and snapshot-safe reads in a thread-safe service.
- URL Shortener Service (Medium, build): Base62 codes, custom aliases, dedup, expiry boundaries and click stats for campaign links.
- Reservation Service Incident (Medium, debug): On-call: stop double bookings, fix back-to-back stays and stale cancellations, then repair a corrupted export.
- File Deduplication (Medium, build): Find byte-identical files with a size, hash, compare pipeline that survives hash collisions and unreadable files.
- Feature Flags & A/B (Medium, build): Deterministic FNV-1a bucketing, targeting rules, percentage rollouts and weighted experiment variants.
- Image Transform Pipeline (Medium, build): Concurrent transforms with ordered results, per-image failure isolation, FIFO admission and a hard memory budget.
- Loan Lifecycle & Balances (Medium, debug): Repair a loan ledger: illegal state transitions, overpayments, lost updates and a transfer that deadlocks.
- Return Risk Assessment (Easy, debug): Make a rule-based risk scorer match its rulebook exactly, boundaries included, and harden the batch API.
- Comment Moderation (Medium, debug): Fix whole-word banned-term matching, moderation state transitions, racing moderators and a flaky webhook.
- Retry-Safe Issue Service (Hard, build): Auth, idempotent creates, optimistic locking with If-Match, opaque cursor pagination, served over real HTTP.
- Movie Recommendations (Medium, debug): Fix a genre-preference recommender: candidate filtering, scoring math, tie-breaks and leaking shared state.
- Keyword & User Blocking (Medium, build): Token-based phrase matching, strike windows and auto-blocks that stay exact when 20 threads race.
- Persistent Private Watchlists (Medium, debug): Fix ownership leaks, duplicate entries, zombie deletes and id reuse in a file-backed store with atomic writes.
- Password Reset (Easy, debug): Config keys, zero-padded codes, clock injection, timezones, single-use codes and attempt limits.
- TTL + LRU Cache (Medium, build): A bounded cache with expiry, least-recently-used eviction, stats and stampede-proof single-flight loading.
- Retrying Job Queue (Hard, build): Leases with unique tokens, priority scheduling, exponential backoff, dead letters and zombie-worker protection.
- Leaderboard Service (Medium, debug): Fix best-score tracking, 1-2-2-4 ranking, tie order, a corrupted TreeSet, pagination and lost concurrent updates.