Eastbay Interview Question

How would you choose between implementing a web socket interface or doing HTTP only communication?

Interview Answer

Anonymous

Sep 10, 2016

I listed some of the things that I would take into consideration when making that kind of decision. Mostly, What's our target demographic? This would tell me compatibility constraints (firewalls/etc) What's more important, bandwidth or simplicity? HTTP is stateless, moving to a stateful communication protocol requires additional collaboration between services. What content am I serving? Is it nice-to-have data like non essential notifications or does the user need an explicit request/response for a particular action. Does my hardware and software stack support websockets from end to end?