Product
Pricing
Blog
Forum
NEW
Referral
Description
Solution
Discussion
Submissions
Ask AI
AI Insights
Quick Summary
Design a system to track files across multiple collections with optional hierarchical relationships.
Calculate global file totals and aggregate collection sizes that include descendant collection data.
Efficiently retrieve the top-k largest collections based on aggregated sizes and lexicographical tie-breaking.
What This Tests
Object-oriented design and state management
Hash maps for fast lookups and aggregation
Tree traversal for hierarchical data processing
Heap usage for efficient top-k selection
Common Patterns
Hashing
Graph Traversal
Heap / Priority Queue
Sorting
Collapse
Hint 1
Hint 2
What Interviewers May Ask Next
Report
Report seen similar question in interview
Ask AI Assistant
Ask AI Assistant
Ask me anything about this coding question!
python
Auto
Debug
Run
Submit
Test Cases
Input
Output
Expected