Free ToolNo signup needed

Rust Take-Home Challenge Sampler

3 real-world Rust take-home prompts — the kind Discord, Cloudflare, and AWS-adjacent teams actually assign. Each one comes with the mistakes bootcamp grads most often make and an expert hint on the right approach.

3 sample challengesCommon bootcamp mistakesExpert hints included
01

Thread-Safe LRU Cache

Concurrency · Data Structures

Medium

Challenge Prompt

Implement a thread-safe LRU (Least Recently Used) cache using Arc<Mutex<>>. The cache should have a configurable capacity, support get and put operations, and evict the least recently used item when capacity is exceeded. Write unit tests that exercise concurrent access from multiple threads.

Common Bootcamp Mistakes

  • Wrapping just the HashMap without tracking insertion/access order — LRU requires eviction order, not just storage
  • Holding a MutexGuard across an .await point — this deadlocks on the next thread that tries to acquire the lock
  • Only updating recency on put but not on get — a cache hit should also promote the key to most-recently-used
  • Using Vec<K> for the ordering list — O(n) removal blows up under load; use VecDeque or a linked structure

Expert Hint

Keep two structures inside your locked state: HashMap<K, V> for O(1) lookup, and VecDeque<K> for LRU order. On every access, remove the key from VecDeque and push it to the back. On eviction, pop from the front. Wrap the whole inner struct in Arc<Mutex<LruInner>> so callers can .clone() the handle to share across threads without any unsafe.

Seeing this prompt on a real take-home?

Book a session
02

CSV Statistics CLI

Iterators · CLI · Error Handling

Easy–Medium

Challenge Prompt

Build a CLI tool that reads a CSV file and computes statistics (mean, median, min, max, and standard deviation) on every numeric column using idiomatic iterators. Accept the filename as a CLI argument. Handle missing or non-numeric values gracefully — skip them and note how many were skipped. Print a formatted summary table to stdout.

Common Bootcamp Mistakes

  • Parsing the CSV with .split(',') — breaks on quoted fields with commas inside; use the csv crate
  • Collecting into a Vec at every iterator step instead of chaining — defeats the memory advantage of iterators
  • Calling .unwrap() on every parse — a single bad row crashes the whole tool instead of skipping it
  • Computing median on an unsorted slice — you must sort first; a sorted collect here is intentional, not a mistake

Expert Hint

Pull in csv + serde_derive to deserialise rows into typed structs, then .filter_map() over the numeric fields to skip blanks cleanly. Chain your iterator to compute sum and count in one pass; collect once into a sorted Vec for median. For CLI args, std::env::args() is fine for one argument — or add clap if the prompt says 'production-quality'. Propagate errors up with anyhow::Result<()> so main() stays clean.

Seeing this prompt on a real take-home?

Book a session
03

Async HTTP Client with Retry

Async · tokio · Error Design

Hard

Challenge Prompt

Create an async HTTP client with exponential backoff retry logic using tokio. The client must: retry on 5xx responses and network-level errors; respect a configurable maximum retry count and a backoff ceiling; log each attempt with attempt number, status, and delay; return a typed error if all retries are exhausted. Write at least two tests — one for eventual success and one for exhausted retries.

Common Bootcamp Mistakes

  • Using std::thread::sleep() inside an async fn — blocks the tokio thread and starves other tasks; use tokio::time::sleep()
  • Retrying on 4xx responses — those are caller errors (bad URL, auth failure) and will never self-heal
  • Cloning the reqwest::Client on every attempt instead of once at construction — expensive and unnecessary
  • Forgetting that reqwest consumes the request body on send — you need to reconstruct the request each retry or use bytes

Expert Hint

Build a retry loop: maintain backoff_ms: u64 and double it after each failure up to a cap. Use tokio::time::sleep(Duration::from_millis(backoff_ms)).await between attempts. Only retry when err.is_connect() || err.is_timeout() or response.status().is_server_error(). Define a RetryExhausted(String) error variant so callers can match on it specifically. For tests, spin up a tiny axum test server that returns a configurable sequence of responses.

Seeing this prompt on a real take-home?

Book a session
Free resource

Get 5 more Rust challenges + solutions

We'll send the full challenge pack to your inbox — each one with a model solution, the reviewer rubric, and the top mistakes to avoid. No spam. Unsubscribe any time.

Get 5 more sample Rust challenges + solutions

Enter your email and we'll send the full challenge pack straight to your inbox.

No spam. Just the guide. Unsubscribe anytime.