Compare candidate profiles

Sample Email Scorecard · Preview

Candidate Assessment Report

Candidate ID
screen-c4a9
Task
Python / FastAPI: Concurrent Checkout Race Condition
Duration
38 min / 45 min limit
Session
6 prompts · 2 steers · gemini-3.8-flash
Overall Score
91/ 100
Integrity & Signals
  • Tests Unmodified
  • Diff-to-Prompt Correlated
  • No Unmonitored Code Dumps

4-Vector Score Breakdown

Expand any dimension to review the evidence behind the score.

Functional Pass

Weight: 40%
40/40

All 4 PyTest specs passing (2 baseline + 2 async concurrency specs).

View reasoning

Both baseline checkout flows and both concurrent contention tests passed against the isolated CI test suite. Concurrent requests no longer oversell inventory or double-charge customer balances.

Prompt & Steering

Weight: 20%
18/20

Scoped prompts to order_service.py, shared failing test output, and corrected an incomplete lock proposed by the model.

View reasoning

Candidate avoided broad file dumps and anchored prompts in concrete failing assertions. When the model initially left self.store.get_balance() and self.store.debit() outside the SKU lock, the candidate spotted the overdraft race and directed a clean critical-section rewrite.

Verification

Weight: 25%
22/25

Verified failing concurrency specs before and after each steering step; caught a lingering overdraft race before opening the PR.

View reasoning

Candidate cited concrete PyTest assertion output in follow-up prompts rather than accepting the first generated patch blindly. Minor deduction for not adding a dedicated multi-item deadlock regression test, though the existing suite passed cleanly.

Diff Quality

Weight: 15%
11/15

Clean, minimal diff (+22 / -1), zero unnecessary dependencies added, minor nit on lock dictionary cleanup.

View reasoning

Changes stayed tightly scoped to app/services/order_service.py with deterministic sorted resource-lock ordering across SKUs and user balances while preserving simulated I/O and existing HTTP status semantics. One minor nit: per-key locks in _locks are never evicted.

Auditable Session Evidence

Inspect the exact prompts, submitted git diff, and automated test run behind this scorecard.

  1. Step 1 · 04:12 Context Framing

    Scoped diagnosis with failing concurrency trace

    Candidate prompt

    "Five concurrent POST /api/v1/orders/checkout calls for SKU-WIDGET oversell when stock is 1. Here is the failing pytest output for test_concurrent_checkout_inventory_race. Inspect app/services/order_service.py and propose a minimal async lock fix across get_stock() and allocate_stock()."

    AI response summary

    Identified the non-atomic read-check-write window in OrderService.checkout() and proposed wrapping get_stock() and allocate_stock() with a per-SKU asyncio.Lock, but left get_balance() and debit() outside the lock block.

  2. Step 2 · 14:38 · Candidate Steer Critical Section Correction

    Caught partial lock and pushed back on the model

    Candidate steer

    "get_balance() and debit() still run outside the SKU lock, so concurrent checkouts for the same user_id can still overdraft the account. Lock both the sorted sku keys and user:{request.user_id} in a deterministic order using AsyncExitStack so inventory and balance checks stay atomic without deadlocks."

    AI response summary

    Refactored OrderService.checkout() to acquire deterministic sorted per-SKU and per-user asyncio.Lock instances via AsyncExitStack, keeping get_stock(), get_balance(), allocate_stock(), and debit() inside one critical section.

  3. Step 3 · 29:05 · Verification Steer Edge-Case Catch

    Verified duplicate-SKU payloads and preserved status codes

    Candidate steer

    "If a checkout payload repeats the same SKU twice in request.items, acquiring the same lock twice will deadlock. Deduplicate the lock keys with sorted(set(...)) and double-check we still raise InsufficientInventory (409) and InsufficientBalance (400)."

    AI response summary

    Deduplicated lock keys before acquiring them in sorted order, kept simulated store I/O and existing exception types untouched, and confirmed all 4 specs in tests/test_orders.py pass cleanly.

Ready to evaluate your candidates?

Want this signal for your next Python hire?

Launch an assessment ($49)

Hiring for TypeScript, Go, or another stack? Bring your own GitHub repo or request a custom task.