Build a small JSON API in any one language from the tabs: `GET /echo?msg=hi` (returns the msg), `GET /users/:id` (returns `{id, name}` from an in-memory map, 404 if missing), `POST /users` (accepts `{name, email}`, validates, returns 201). Load-test it with `wrk` or `oha` on your laptop. Submit the source file, a README with the test command + result, and your p99 latency number at 1000 req/sec.
map<int, User> + a lock. A concurrent map is overkill for this project.wrk -c100 -t4 -d10s http://localhost:8080/users/42 is the standard benchmark. Save its output verbatim in your README.$ wrk -c100 -t4 -d10s http://localhost:8080/users/42
Running 10s test @ http://localhost:8080/users/42
4 threads and 100 connections
Thread Stats Avg Stdev Max +/- Stdev
Latency 11.23ms 2.11ms 35.14ms 74.31%
Req/Sec 2.24k 0.14k 2.61k 82.00%
Requests/sec: 8954.02
Transfer/sec: 1.23MB
Measured:
p50: 9.8ms
p95: 14.7ms
p99: 22.1ms
throughput: ~9k rps on an M2 laptop
/users GET that lists all users. Put it behind pagination (?limit=10&cursor=...).--cpus=1 and re-measure. How much did you lose?