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
- L4
Problem
You're putting an HR export into a stable reporting order: a list of `records`, each a dict carrying the same fields, plus an ordered list of field names `keys`. Return a new list sorted ascending by the first key, breaking ties with the next key, and so on down the list.
Summary
When two things tie, something has to break the deadlock.
Practice This Problem
Solve this Python problem with real code execution. DataDriven runs your Python code in a real environment and grades it automatically.