Launch special: 50% off Pro monthly with code LAUNCH50 Upgrade now
Skip to main content
← All problems
chini-002-checkout

E-commerce Checkout with Idempotent Payments

Process checkouts without ever charging a customer twice. Survive a downstream payment-API outage.

Source: Classic system-design interview corpus (Stripe / payment gateway design)

Prompt

Design a checkout system that takes a cart and processes payment.

Functional:
- POST /checkout accepts an order, returns an order id.
- Payment is processed via an external payment provider that may time out.
- Every checkout must be idempotent: a retried checkout must NOT charge the user twice.

Non-functional:
- Survive a 5x peak (e.g., flash sale) without dropping more than 5% of orders.
- Survive a slow payment provider (added latency) without blocking the whole queue.
- Survive a brief payment-provider outage by queueing or circuit-breaking.

Return a Chinilla CanvasState. Include a queue, a retry behavior, and a circuit-breaker on the payment-provider edge.

Constraints

Max components
12
Required behaviors
queue, retry, circuitbreaker
Monthly budget
$800

Stress scenarios

Baseline orders

baseline

Steady checkout traffic.

5x flash sale

spike

Order volume spikes 5x for the duration.

Slow payment provider

latency

Payment provider response time grows by 1500ms.

Payment provider outage

outage

Payment provider is down. System must queue or fail safely (no double-charge).

Pass criteria (overall)

Min stability score
75
Max drop rate
3.0%
Min delivery rate
95.0%
Max errors
3

Submit your run

Submissions go through the chini-bench CLI. It calls your model with your key, scores the result locally, and posts to the leaderboard. Nothing leaves your machine except the canvas it produces.

End-to-end:
pip install git+https://github.com/collapseindex/chini-bench-cli.git
export OPENROUTER_API_KEY=...

chini-bench run chini-002-checkout \
  --provider openrouter --model google/gemini-2.0-flash-001 \
  --as alice --x alice --linkedin alice-builds
Or inspect the prompt first:
chini-bench prompt chini-002-checkout
Providers: openai · anthropic · google · openrouter · ollama

Leaderboard

Rank Submitter Model Score Stability Delivery Design Pass Links
#1 alex default
A anthropic/claude-sonnet-4.6
94 87.0 100.0 100.0 X
#2 alex default
O openai/gpt-5.4
89 75.0 100.0 100.0 X
#3 alex default
X x-ai/grok-4.20
86 69.0 100.0 100.0 X
#4 alex default
G google/gemini-3.1-pro-preview
80 56.0 100.0 100.0 X
Per-scenario breakdown of the top run
Scenario Health Drop rate Delivered Pass
baseline 87.0 0.0% 60
flash-sale 85.0 0.0% 300
payment-slow 87.0 0.0% 15
payment-outage 88.0 0.0% 12