Loading...

The Priority Queue

A medium Python interview practice problem on DataDriven. Write and execute real python code with instant grading.

Domain
Python
Difficulty
medium
Seniority
mid, senior

Problem

A reporting pipeline needs to sort structured records by multiple criteria in a specific priority order. Given a list of dictionaries and an ordered list of key names, return the records sorted in ascending order by the first key, then by the second key on ties, and so on.

Practice This Problem

Solve this Python problem with real code execution. DataDriven runs your Python code in a sandboxed Docker environment and grades it instantly.