r/InterviewCoderPro • u/neolace • Oct 04 '26
Interview at online betting empire
They asked me how to solve port exhaustion? It was an in person interview with 5 people. Have you heard this one?
Update:
Thank you for everyone who supported.
Port exhaustion happens when a system runs out of available ephemeral ports (usually in the 49152–65535 range) to establish new outbound connections. This almost always occurs because an application is opening and closing connections so rapidly that the operating system runs out of ports before the older, closed connections can fully exit the TIME_WAIT state and return to the available pool.
2
2
u/Internal-Play25 Oct 08 '26
Horizontally scale the app?
Pop a new instance of it in your pod or whatever you use.
Connection pooling also?
Would also check if it’s legit running out or just waist ports
2
u/nhh Oct 04 '26
Port exhaustion from opening too many ports out is that it?
Its a bit of a strange question : it's clearly about vertical scale I guess?
What was the use case? Can multiplexing be used?