Real Time Updates easy
Real-time multiplayer games (like Call of Duty) often prefer UDP over TCP. Why?
- A UDP guarantees packet delivery.
- B UDP is faster because it does not retransmit lost packets; old data (e.g., player position 100ms ago) is useless anyway.
- C UDP has better security.
- D TCP cannot handle binary data.
Answer: B. UDP is faster because it does not retransmit lost packets; old data (e.g., player position 100ms ago) is useless anyway.
In fast-paced games, 'timeliness' > 'completeness'. If a packet saying 'I moved left' is lost, it's better to just process the next packet 'I am now here' than to pause the game to re-fetch the old move.
One system design question a day, with spaced repetition so the ones you miss come back.
Get the appRelated questions
- When a mobile app is closed/backgrounded, it cannot keep a WebSocket open. How does it receive real-time alerts (like 'New Message')?
- For a human user, what is generally considered the maximum acceptable latency for an interaction to feel 'Real-Time' (e.g., typing in a Google Doc)?
- If you want to update a news feed on a website every time a new article is published, what is the simplest (but least efficient) 'Real-Time' technique?
- In a persistent real-time connection, what is the purpose of a 'Heartbeat' or 'Ping/Pong' message?
- Why is Short Polling considered 'Chatty'?
- Server-Sent Events (SSE) are ideal for which type of real-time application?