Work effectively with AI coding agents. Understand them as language models running in a tool loop with limited context, which is why they guess, game the visible signal and report confidently. Recognise the shortcut and correctness tells in their code across Python, TypeScript/JavaScript, Rust, Java and Go, and know the damage each one does later. Verify changes instead of trusting them, review diffs fast for quality and security, judge when work is truly finished, and choose, design and steer tasks so agents can finish them well.
Fine on test data, broken at scale card 3 of 6

Five tells and the check for each

builds on: What the agent cannot see
- **ORM call or query inside a loop** (`o.customer.name`, `repo.find…` per item). This is N+1. *Later cost:* one extra query per row. *Check:* the query log; count queries per request. - **No `LIMIT` or pagination** on a growing table. *Later cost:* every request loads more as the table grows. *Check:* the query log, plus the real row count. - **Whole file or table in memory** (`f.read()`, `io.ReadAll`, `fetchall()`). *Later cost:* the process is killed once the data outgrows RAM. *Check:* a memory profile on a large fixture. - **`in`/`includes`/`contains` on a list inside a loop.** This is quadratic. *Later cost:* 10× the data means about 100× the time. *Check:* a large fixture plus a profile. - **Nested quantifiers** like `(a+)+`. *Later cost:* one input can hang a thread. *Check:* a long near-miss input with a timeout.
Terms on this card
ORM
Object-relational mapper: a library that maps database rows to objects and generates SQL for you, e.g. Django models, JPA/Hibernate, Prisma.
N+1
One query fetches N rows, then one more query runs per row, so N+1 queries in total instead of one or two.
query log
A log of every SQL statement the application sends to the database, used to count and inspect queries per request.
pagination
Returning results in fixed-size pages (LIMIT plus offset or a cursor) instead of all rows at once.
LIMIT
SQL clause capping how many rows a query returns.
Learn this step by step on Bytewise
Lesson goal: Recognise code that passes small tests but fails on production volumes: N+1 queries from ORM calls inside loops, unbounded queries with no pagination, reading whole files or tables into memory, quadratic list lookups in loops, and regexes prone to catastrophic backtracking. Explain why the agent cannot see this coming, and which check (query log, profile, large fixture) exposes it. · the whole lesson