Get Most Active Users Within Time Range
Asked at Microsoft · Coding Questions · Difficulty: Medium
Implement a function `GetMostActiveUsers` that takes a list of events and three integers `startTime`, `endTime`, `k`. Each event consists of a user ID, a timestamp, and a boolean `isOnline`. The events are unordered. Return the top `k` most active users between `startTime` and `endTime`, sorted by active time in descending order.
Loading the problem…
More Microsoft interview questions
- LLM conceptual questions
- Roofline Analysis and Mixed-Precision Gradients for Matmul
- Tiny Next-Token Prediction Model (PyTorch Fill-In)
- DNA Shotgun Sequencing: Chain and Eulerian Path Reconstruction
- Design Search Autocomplete / Typeahead
- Design a Chatbot Personalization / Memory System