Design a Connection Pool
Problem
Design a thread-safe connection pool (e.g., DB or socket connections).
Requirements
acquire(timeout)/release(conn)- Max pool size; block or fail on exhaustion
- Health-check and recycle stale connections
What evaluators look for
- Thread safety and no leaks
- Fairness for waiters
- Clean separation of pool vs connection lifecycle
Extension
Add dynamic resizing under load and connection validation on borrow.
added …