Build it yourself
Machine coding for mobile and AI engineers: caches, loaders, sync, retries and guards, with every solution explained line by line.
9problems
Kotlin 2coroutines and Flow
68passing tests
iOSequivalents for each
How the round works
45 minutes, one component
1
Clarify
Scope, scale, threading model, what is out of scope.
2
API first
Write the public interface and the state it owns.
3
Core logic
The happy path, then the concurrency story.
4
Edge cases
Failure, cancellation, kills, duplicates.
5
Test it
Show how you would test it with fakes.
6
Extend
Priorities, persistence, metrics: talk trade-offs.
Problems
14 topicsPick a component
01 · Medium · 30 minLRU cache with a memory budgetO(1) get and put, evicting the least recently used item when bytes exceed a limit.LruCache.kt02 · Hard · 45 minImage loader with coalescing and two cache tiersMemory, then disk, then network, and fifty identical requests become one download.ImageLoader.kt03 · Hard · 45 minOffline outbox with idempotent syncWrites persist first, sync later, survive kills, and are never applied twice.Outbox.kt04 · Medium · 25 minRetry with exponential backoff and jitterRetries that recover calmly instead of stampeding a struggling server.Backoff.kt05 · Medium · 30 minSearch-as-you-type with debounce and cancellationOne request per pause in typing, and never a stale result on screen.SearchViewModel.kt06 · Medium · 35 minCursor-based infinite feedPrefetch before the bottom, one request at a time, no duplicates, no stale pages.FeedPaginator.kt07 · Hard · 45 minResumable multipart uploaderUpload a 4 GB video in parts, a few at a time, and resume after a kill.ResumableUploader.kt08 · Medium · 25 minClient-side token bucket rate limiterAllow bursts, then a steady rate, so your app cannot DDoS your own API.RateLimiter.kt09 · Hard · 40 minList diffing for animated UI updatesTurn old and new lists into deletes, inserts, moves and reloads, in O(n log n).ListDiff.kt
AI machine coding
Kernels, adapters, guards, checkpointsTier 3 · Edge cases · 45 minBlock-Allocated PagedAttention Triton KernelBuild the block table and the kernel that reads it, so multi-tenant batches never fragment GPU memory.Tier 2 · Mechanisms · 35 minFused Flash-Softmax Triton KernelFusing softmax into one kernel cuts memory reads from 4n to n and writes from 2n to n.Tier 3 · Edge cases · 40 minEntity-Relation Graph Mining & GraphRAG PipelineEntity graphs and community summaries answer corpus-wide questions that chunk retrieval cannot.Tier 2 · Mechanisms · 35 minPyTorch LoRA Linear Layer ImplementationWrites a drop-in replacement for nn.Linear with trainable low-rank adapters and dropout.Tier 1 · Whole picture · 35 minPyTorch Fully Sharded Data Parallel (FSDP)PyTorch's native sharding: wrap per block, and each block gathers its weights only while it runs.Tier 2 · Mechanisms · 30 minLlama-Guard Jailbreak & Safety ClassifierModerates input and output with a dedicated classifier, and fails closed whenever actions are at stake.Tier 2 · Mechanisms · 35 minGuardrails AI Structured Pydantic Output ValidationNever passes unvalidated model output downstream: validate against a schema and re-ask with the exact errors.Tier 3 · Edge cases · 40 minAsync Zero-Redundancy Optimizer CheckpointingSaves sharded state in the background, so checkpoints stop stalling GPUs.