Code RoomConnection pool proxy
MediumPrep Room Coding #3780

Connection pool proxy

System designDatabases & SQLMid–Senior~35 min

Design a connection-pool / proxy layer for a Postgres primary that can only handle ~500 concurrent backends, but sits behind 2,000 stateless app instances each wanting its own pool, spiking under load. Symptoms: connection exhaustion, memory pressure on the DB, and a thundering herd of reconnects after a failover. How do you pool connections, multiplex many clients onto few DB connections, and survive failover?

What a strong answer looks like

Clarify scale and constraints first. Propose a clean component breakdown, then go deep on the hard parts (data model, bottlenecks, consistency, failure modes) and name the trade-offs you are making.

Clarify4:00 left
Estimate4:00 planned
Design11:30 planned
Deep dive9:30 planned
Failure6:00 planned
0:00
Which questions mattered is sealed until you submit. Telling you now would just be handing over the edge cases.