Intuit | Long Poll vs Web socket vs Server send Events

Difficulty: MEDIUMCategory: InterviewExperienceFrequency: 1Asked On 2020-09-02Added By Anonymous
Source: Link

Company: Intuit
Role: software engineer 2, senior software engineer
Interview Stage: Onsite
Location: unknown
Year: unknown

Original Post Content:

I was asked to design a collaborative file-sharing service as part of the interview discussions with them.

Based on a video that I had seen some time back related to scaling of Dropbox (https://www.youtube.com/watch?v=PE4gwstWhmc), I had an impression that this service as well can use long poll. However the interviewer was not convinced with it and countered that:

It is a collaborative file sharing service being used by millions. Imagine there is a file being edited by many users at the same time and if you use long-polling, then it would be very inefficient.

I was not sure about this part and did not have any convincing answer for this.

Can someone point to a link/video/reference paper that demystify :
1. When to use Web-socket
2. When to use Long-polling
3. When to use Server send events

Based on my understanding, I have listed down some usecases and what they will use. Please help critique this as well:
1. Google Docs - Long poll
2. Collaborative text editor - web socket
3. Dropbox - Long poll
4. Facebook messenger/whatsapp - Websocket
5. Uber (communication between server and passenger) - long poll
6. Uber (communication between server and driver) - long poll
7. Food delivery app (say Pizzahut for communication) - long poll
8. Bank app to deliver OTP - web socket
9. Collaborative code editor - web socket

In case someone can point how these are implemented then it would be good.

Comments