Loading...
The Host Ranker
A medium Python interview practice problem on DataDriven. Write and execute real python code with instant grading.
- Domain
- Python
- Difficulty
- medium
- Seniority
- junior, mid, senior
Problem
The marketing team needs to rank hosts by their total bed inventory for a 'Super Host' badge program. Given listing records (dicts with 'host_id', 'host_name', 'beds'), rank hosts by total beds across all listings using dense ranking. Return a list of dicts, each with 'host_name', 'total_beds', and 'rank', sorted by rank ascending.
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.