Backend developer interview question · 5+ years
You are designing a Python service that fans out to many slow downstreams. What shapes the design?
The strongest answer
Async end to end so waiting costs a task rather than a thread, with bounded concurrency per downstream, timeouts on every call and a budget for the whole request
Why it works
Right, and the bound per downstream is what stops you from becoming their outage.
What a good answer covers
- Async suits many concurrent waits.
- Bound concurrency per dependency.
- Timeout every call, budget the request.
- Measure with real downstream latency.
Answers that fall short
- Close, but not the strongest: One thread per downstream call, sized to the busiest hour
Threads work but cost far more per waiting call. - Weak: Synchronous code and more replicas; simplicity beats concurrency
Replicas scale cost linearly for work that is almost all waiting. - Red flag: A process per request, which isolates failures best
Process per request is a very expensive way to wait.
Who gets asked this
- Backend developer
- Full-stack developer
- Automation developer
- DevOps / SRE / cloud
- Data analyst / BI
- Data engineer
- Data science / ML / AI
- AI engineer
More Backend developer questions
- Your service calls three internal APIs and one is intermittently slow. What do you build in?
- You are asked to make a payments service active in two regions. What is the first design question?
- Product wants dashboards over the transactional database. When do you say no and build a separate analytical…
- Design multi-tenancy for a product where some tenants are regulated.
- One endpoint renders PDFs and pegs a core for about two seconds. It is stalling an otherwise healthy Node…
- Your worker cannot keep up with the producer and memory climbs. What is the right answer?
- A payment endpoint can be retried by clients. How do you stop double charges?
- What is a cell-based architecture and when is it worth the complexity?