← supio Interview Insights

supio·Frontend Engineer·Technical Phone Screen·Intermediate

Intermediate
Jul 2026

Summary

Interviewed for a frontend role at Supio and got hit with a greedy/scheduling problem that felt more like backend prep than anything frontend-related. One question, algorithm-heavy, and I was not expecting that.

Questions Asked (1)

Q1

You have two arrays: one with the current altitudes of planes, and one with how fast each plane descends per second. You can shoot down at most one plane per second. What's the maximum number of planes you can take down before any of them hit the ground?

Algorithms & Data Structures
Author's notes

Took me a minute to realize this is basically a scheduling problem.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Model each plane as a deadline: the time it hits the ground is ceil(altitude / descent_rate). The problem reduces to scheduling unit-time jobs with deadlines to maximize on-time jobs, solved greedily by always shooting the plane with the earliest deadline. Sort planes by deadline and simulate, keeping track of the current time.

Pro tip: Clarify edge cases upfront: if a plane's altitude is 0, it's already down; if descent rate is 0, it never hits the ground and can be ignored or shot anytime. Also, mention that the greedy choice is optimal because it's a classic exchange argument.

1. Understand the problem

Restate the problem: each plane has a deadline (time it hits the ground) and you can shoot at most one plane per second. You want to maximize the number of planes shot before their deadlines.

2. Compute deadlines

For each plane, calculate the time it hits the ground as ceil(altitude / descent_rate). If descent_rate is 0, the plane never hits the ground; treat its deadline as infinity.

3. Sort by deadline

Sort the planes in ascending order of their deadlines. This ensures you consider the most urgent planes first.

4. Greedy simulation

Iterate through the sorted planes, maintaining the current time (starting at 0). For each plane, if current time < deadline, shoot it (increment count) and increment current time by 1. Otherwise, skip it.

5. Return the count

The total number of planes shot is the maximum possible. Explain why this greedy approach is optimal (exchange argument).

Key Points to Mention

  • Deadline calculation: ceil(altitude / descent_rate)
  • Greedy algorithm: always shoot the plane with the earliest deadline
  • Sorting planes by deadline
  • Time simulation: current time starts at 0, increments by 1 per shot
  • Optimality proof via exchange argument
  • Edge cases: altitude 0, descent rate 0, multiple planes with same deadline

AI-generated suggestions, not part of the candidate's original notes. May be inaccurate — verify before relying on them.