All jobs / Automation developer
Automation developer interview question · 5+ years
Under load your async service exhausts database connections. What went wrong?
The strongest answer
Concurrency was unbounded, so every in-flight request took a connection — bound the pool and the concurrency together, keep remote calls out of transactions, and queue rather than open more
Why it works
Exactly. Async makes it trivial to start more work than your resources support.
What a good answer covers
- Async removes the natural limit on concurrency.
- Size the pool and bound in-flight work.
- Never hold a transaction across a network call.
- Queue instead of opening more connections.
Answers that fall short
- Close, but not the strongest: The pool was too small and should be removed entirely
Removing the pool makes it worse, not better. - Weak: Async and connection pools are incompatible
They work together; the sizing is the issue. - Red flag: The database needs a bigger max_connections and nothing else
Raising the limit moves the failure into the database.
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 Automation developer questions
- What is a decorator, really?
- You need setup and guaranteed teardown around a block. What do you write?
- Can you rely on a dict keeping insertion order?
- One synchronous database call inside an async handler makes the whole service slow. Why?
- Three independent API calls run one after another in an async function. How do you overlap them?
- How do you compose several transformation stages over a huge stream without buffering?
- A Python service does heavy numeric work per request and latency is unacceptable. What options do you weigh?