Skip to main contentSkip to solution

Given a scenario:

Suppose there is a web-server hosting a website to declare results. This server can handle a maximum of 100 concurrent requests to view results. So, as to serve thousands of user requests, a ________ would be the most appropriate data structure to use.

Solution

✅ Correct Option: 2

A queue works on FIFO (First In, First Out). Requests beyond the 100 the server can handle wait in the queue and are served in the order they arrived, so every user is served fairly.


Stack: it is LIFO, so the latest request would be served first and early requests could wait indefinitely.

Dictionary: it stores key-value pairs for lookup and has no notion of arrival order.

Keyboard Shortcuts

  • Left arrow: Previous question
  • Right arrow: Next question
  • S key: Jump to solution
  • Q key: Jump to question