Skip to contentSkip to content
Verified credentials. On-chain. Forever.Learn more
Cover image for Design a Race-Free Cache for a Read-Heavy Service
Code

Design a Race-Free Cache for a Read-Heavy Service

FreeVerified credential2 weeksIntermediate

Overview

What this challenge is about.

Implement a thread-safe LRU-bounded cache in Java (or Go — your choice, defend it) with: read-write lock or copy-on-write semantics, get-or-load pattern with single-flight to dedupe concurrent loads of the same key, TTL-based eviction, and a documented consistency model (read-your-writes within a thread, bounded staleness across threads). Test under: 8 readers + 2 writers per cache, 1M operations, with cross-thread invariant checks (no torn reads). Benchmark throughput vs. a naive synchronized version and vs. an off-the-shelf library (Caffeine or Ristretto). Deliver the cache source, the test harness, the consistency-model doc, the benchmark report, and a 4-page design note for the platform team.

CredentialBlockchain-anchored
ShareableLinkedIn-ready
LanguageEnglish
PaceSelf-paced

The Brief

What you'll do, and what you'll demonstrate.

Design and implement a race-free LRU cache with single-flight loads and documented consistency, then validate against torn-read tests under heavy concurrency.

Earning criteria — what you'll demonstrate

  • Apply read-write locks or copy-on-write idioms to a real cache
  • Implement single-flight load deduplication correctly
  • Document a consistency model precisely enough that other engineers can rely on it
  • Test for torn reads under heavy concurrent load

Program Fit

Where this fits in your program.

Sharpens the same skills your degree expects you to demonstrate.

Skills

Skills you'll demonstrate.

Each one shows up on your verified credential.

Careers

Roles this prepares you for.

Real titles. Real skill bridges. Pick the one closest to your trajectory.

Career mappings coming soon.

One more thing

You can put a credential on your CV by Friday.