A fictional payments platform needs a deterministic service library. Build recency-based caching, rolling request admission, paged iteration, version lookup by time, frequency-based caching and exact token reconciliation. Each client fixture states its own operation contract. Deliver one retained file with six functions. Test eviction ties, expired windows, exhausted iteration, missing versions and impossible reconciliations. Explain how each state update preserves the relevant invariant, including failed operations.
Build a small source file that another engineer can reuse. Each step adds one function with its own contract and tests. Keep earlier functions while you add the next one.
The final file is your deliverable.
Check each helper as you go. An earlier function can still contain a defect after a new helper passes, so review the combined file before handing it over.