Testing a feature and estimating work · senior
Canary, flags, shadow traffic and load tests
Before users see a risky change you can copy traffic to it, send a small share, or turn it on step by step. Load tests must model arrival rates, not users that slow down with the system.
Explain it out loud
Explain it out loud to an AI interviewer that follows up, and see where your answer is thin.
Practise by voiceThe notes
What you must know
- Shadow (dark launch): copy real requests to the new code and throw the answers away, then compare with the old answers. It must have no side effects: no writes, SMS or payments.
- Canary: a small share of instances on the new version, compared with the old version at the same time. Before and after comparisons are confused by time of day (SRE Workbook). Decide on errors, latency and business numbers.
- Feature flag: per seller, category or share of users, sticky per user, with a kill switch that works in seconds. A canary deploy suits code changes; a flag suits business-logic changes.
- A good order for a pricing engine: shadow first to check prices, then a flag rollout (1%, 5%, 25%, 100%) with written go/no-go rules.
- Load test inputs: last sale peak and its shape, endpoint mix, data volume, third-party limits and the SLO.
- Open model: use an arrival-rate test (k6 constant-arrival-rate or ramping-arrival-rate). A closed loop of virtual users slows down when the system slows, which hides the problem (coordinated omission).
- Use a production-like size and data, stub partners or use sandboxes within limits, measure p99, errors and saturation per layer, find the first thing that breaks, fix it, and test again.
- Autoscaling is too slow for a spike: pre-scale, warm caches, and add a queue or waiting room. Also run a soak test and a failure test (one zone down), and write a go/no-go.
The red pen
Common traps: mistake → fix
Mistake: A load test with 1,000 virtual users shows real capacity
Fix: a closed loop slows down with the system; use arrival rates.
Mistake: Shadow traffic is safe by default
Fix: only if the shadow path has no side effects.
Mistake: A canary compared with last week is fair
Fix: compare with the old version at the same time.
Easy to hard
Questions interviewers ask, easy to hard
- How do you release a new pricing engine safely?
- What is the difference between a canary, a flag and shadow traffic?
- How do you load test before a festive sale?
- What is coordinated omission?
Explain it out loud
Explain it out loud to an AI interviewer that follows up, and see where your answer is thin.
Practise by voiceYour first interview is free
Sign up and start with a 15-minute interview with the full report, and an English conversation. No card needed.