S01 · The Bootsector · L-05
ORM N+1 Fix
- Difficulty
- easy
- Type
- debugging
- Session
- Quick
- Stack
- Python python3.11
- Domain
- Database
- Est. solve
- ~20 min
01 · The task
One endpoint of a small orders service scales its query count with result size and is missing an index its access path needs. Find the offending query pattern among several efficient neighbors and make the request issue a bounded number of queries. A query counter in the harness enforces the bound.
02 · Constraints
No N+1 queries
The endpoint must issue a bounded number of queries.
03 · Skills exercised
How to playDaemon
The whole level runs through the local promptly daemon — it pulls the workspace, captures your token usage, tests locally, and submits the ranked run.
Pair this machine
One-time — approve the code under your devices.
promptly pairPull the workspace
Downloads the starter kit into the current folder and starts the solve clock.
promptly init stage-1-05-orm-n-plus-1-fixStart the captured session
Then drive your AI tool — the daemon meters every prompt and token live.
promptly start stage-1-05-orm-n-plus-1-fixSubmit for ranked grading
Runs the full hidden suite and ends the attempt.
promptly submit
Or combine steps 02–03 into one commandShortcut
promptly play pulls the workspace, launches the daemon, and starts the captured session in a single step — the same as running init then start.
promptly play stage-1-05-orm-n-plus-1-fix