Compute max planes shot and session count
Company: Supio
Role: Software Engineer
Category: Coding & Algorithms
Difficulty: easy
Interview Round: Technical Screen
Overview: These questions evaluate algorithmic problem-solving skills: the first focuses on greedy scheduling and time-step simulation to maximize actions before deadlines while the second tests event aggregation, sorting and grouping logic for sessionization.
Maximum Planes Shot Before Landing
Constraints
- altitude and descent have the same length
- All altitudes and descents are positive
Examples
Input: ([1, 3, 4], [1, 1, 1])
Expected Output: 3
Input: ([1, 1, 2], [1, 1, 1])
Expected Output: 1
Hints
- Sort planes by their landing deadline ceil(altitude/descent).
Count User Sessions from Events
Constraints
- Events may arrive in arbitrary order
- timeout is non-negative
Examples
Input: ([['u1', 1], ['u1', 3], ['u2', 2], ['u1', 10]], 3)
Expected Output: 3
Input: ([], 5)
Expected Output: 0
Hints
- Session rules apply only within the same user.