API Fundamentals
/Beginner
Polling
Definition
A technique where a client repeatedly makes standard HTTP requests to a server at fixed intervals to check for new data.
Explain Like I'm New
A kid in the backseat on a road trip repeatedly asking 'Are we there yet? Are we there yet? Are we there yet?' every 5 seconds. The server answers 'No, No, No' until finally answering 'Yes'.
Real World Example
An order tracking page. The frontend runs a `setInterval` that does a `fetch('/api/order/status')` every 10 seconds to see if the pizza has been delivered yet.
Common Use Cases
- •Simple status checks
- •Legacy systems without WebSockets
Interactive Example
Loading Code Playground...
Interview Questions
basic
- Why is Short Polling considered highly inefficient?
intermediate
- If you need real-time data but cannot use WebSockets, what is the best alternative to standard Polling?