Skip to content
LakeBench
ProblemsCommunityPricing
Sign inStart practicing

Process print jobs in arrival order

Python data engineering interview problem. Difficulty: beginner. Pattern: Streaming. About 10 minutes. Part of the Pro drill bank.

A print shop queues jobs in arrival order. The first job that arrived should print first; later jobs wait.

Process print jobs in arrival order and return the processing sequence the tests expect.

Requirements

  • Arrival order is FIFO.
  • Do not sort by name unless the tests say so.

Constraints

  • jobs: a sequence of job ids or records.

Examples

Input: print_order([('job-a', 3), ('job-b', 1)]) Output: ['job-a', 'job-b'] This input follows the stated rules and produces this output.

Topics: lakebench, python, queue.

More Python interview questions · All interview problems · Learn data engineering

beginner

Process print jobs in arrival order

Interview-style drill: Simulate a first-in-first-out print queue and return the order jobs are printed.

Process print jobs in arrival order and return the processing sequence the tests expect.