Data Structures & AlgorithmsHardTCS NQT · Accenture

For the same four customers (arrivals 0, 1, 2, 5; service times 3, 2, 1, 2) on a single first-come-first-served server, what is the average waiting time in whole minutes (waiting = start minus arrival, average rounded down)?

  1. A. 2
  2. B. 3
  3. C. 1
  4. D. 5

Correct answer: C. 1

The waits are 0, 2, 3 and 1, summing to 6; 6 divided by 4 gives 1.5, which rounds down to 1. Waiting is measured from arrival, not from the previous finish.

More Arrays, Strings, Linked Lists, Stacks, Queues and Hashing questions

Exams that ask this topic