Claude Sonnet 5 vs DeepSeek V4 Pro for code review
Claude Sonnet 5 wins, 89–78
Same 12 code review tasks, marked blind by three rival labs. Claude Sonnet 5 took 7 tasks, DeepSeek V4 Pro took 2, 3 tied. Tested 18 Aug 2026.
Where they differed most
Review this. It runs in a Node service behind a load balancer, on more than one instance, against a shared database. async function reserveStock(sku, qty) { const row = await db.get('SELECT qty FROM stock WHERE sku = ?', sku); if (row.qty < qty) return { ok: false, reason: 'insufficient' }; await db.run('UPDATE stock SET qty = ? WHERE sku = ?', row.qty - qty, sku); return { ok: true }; } Describe the failure that happens under concurrency as a sequence of events between two requests, so a non-specialist could follow it, and say what the customer experiences as a result. Name the second, simpler defect that has nothing to do with concurrency. Then give the corrected version, and say what makes your fix safe when two instances run it at the same moment.
## The concurrency failure, step by step Imagine stock for SKU "WIDGET" is 10, and two customers try to buy at nearly the same instant. Customer A wants 8, Customer B wants 5. Each request lands on a different instance behind the load balancer. 1. **Instance 1** (serving A) reads the stock row: qty = 10. 2. **Instance 2** (serving B) reads the stock row: qty = 10. (This happens before Instance 1 has written anything back.) 3. Instance 1 checks: is 10 ≥ 8? Yes → proceeds. 4. Instance 2 checks: is 10 ≥ 5? Yes → proceeds. 5. Instance 1 writes: q…
Here’s the breakdown. --- **The concurrency failure — a step-by-step story** Imagine two customers, Alice and Bob, both trying to reserve the last item of a popular SKU that has only **1 unit** left in stock. 1. **Alice’s request** reads the current stock: `SELECT qty …` → finds `1`. 2. **Bob’s request** reads the current stock: `SELECT qty …` → *also* finds `1`, because Alice’s request hasn’t written anything yet. 3. Both requests check: `1 >= qty_needed`. Both pass the check with `true`. 4. **Alice’s request** runs the `UPDATE`, setting s…
Task by task
| Task | Claude Sonnet 5 | DeepSeek V4 Pro |
|---|---|---|
| The pagination that skips page one | 6 | 3 |
| Nothing wrong with it | 8 | 8 |
| Three things wrong in six lines | 8 | 9 |
| Two customers, one last item | 9 | 5 |
| Rank by what breaks | 10 | 8 |
| The review, as JSON | 9 | 7 |
| Slow is not the same as wrong | 10 | 8 |
| Overdue at one in the morning | 9 | 8 |
| Write only the comment | 10 | 10 |
| The complaint that is not a defect | 8 | 9 |
| Right, and unusable | 10 | 10 |
| Refuse the rubber stamp | 10 | 9 |
Full receipts: Claude Sonnet 5, DeepSeek V4 Pro · judges gemini-3.1-pro-preview, gpt-5.6-terra, grok-4.5
Questions people ask
Which is better for code review: Claude Sonnet 5 or DeepSeek V4 Pro?
Claude Sonnet 5 — it scored 89/100 against 78/100 on our 12-task code review suite, winning 7 tasks to 2 with 3 tied. Every answer was marked blind by three judges from three rival AI labs.
How was this tested?
Both models answered the identical published code review tasks. Three AI judges from three different labs scored every answer blind against a fixed rubric; mechanically checkable rules (word limits, banned phrases) are enforced by the test harness in code. The raw outputs and judge verdicts are downloadable.
More code review head-to-heads: Claude Sonnet 5 vs GPT-5.6 Sol · DeepSeek V4 Pro vs GPT-5.6 Sol · Claude Sonnet 5 vs GPT-5.5 · DeepSeek V4 Pro vs GPT-5.5 · Claude Sonnet 5 vs Grok 4.5 · Claude Sonnet 5 vs GLM 5.2
Full ranking: Best AI for code review · model pages: Claude Sonnet 5, DeepSeek V4 Pro