PracHub
QuestionsPremiumCoachesLearningGuidesInterview Prep
|Home/Coding & Algorithms/Supio

Compute max planes shot and session count

Last updated: Mar 29, 2026

Quick 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.

  • easy
  • Supio
  • Coding & Algorithms
  • Software Engineer

Compute max planes shot and session count

Company: Supio

Role: Software Engineer

Category: Coding & Algorithms

Difficulty: easy

Interview Round: Technical Screen

## Problem 1: Max planes you can shoot before any lands You are given two equal-length arrays: - `altitude[i]`: the initial altitude of plane `i` (positive integer) - `descent[i]`: the amount plane `i` descends per second (positive integer) Time proceeds in whole seconds. At each second `t = 0, 1, 2, ...` you may **shoot down at most one plane instantly** (before it descends for that second). After your shot (or if you skip), **all remaining planes descend by their `descent` value** for that second. A plane **lands successfully** if its altitude becomes `<= 0` after descending at the end of some second. If **any** plane lands, the process stops immediately. **Task:** Assuming you choose the best possible plane to shoot each second, return the **maximum number of planes** you can shoot down **before the first successful landing occurs**. **Input:** `altitude[]`, `descent[]` (same length `n`) **Output:** integer (max planes shot) --- ## Problem 2: Count user sessions from events You are given: - `events`: a list of pairs `[userId, time]` (times are integers; events may be in arbitrary order) - `timeout`: a non-negative integer For each user, sort that user’s events by `time`. Two consecutive events for the **same user** belong to the **same session** if their time difference is `<= timeout`. Otherwise, the later event starts a **new session**. **Task:** Return the **total number of sessions across all users**. **Input:** `events = [[userId, time], ...]`, `timeout` **Output:** integer (number of sessions)

Quick Answer: 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.

Supio logo
Supio
Feb 12, 2026, 12:00 AM
Software Engineer
Technical Screen
Coding & Algorithms
1
0

Problem 1: Max planes you can shoot before any lands

You are given two equal-length arrays:

  • altitude[i] : the initial altitude of plane i (positive integer)
  • descent[i] : the amount plane i descends per second (positive integer)

Time proceeds in whole seconds. At each second t = 0, 1, 2, ... you may shoot down at most one plane instantly (before it descends for that second). After your shot (or if you skip), all remaining planes descend by their descent value for that second.

A plane lands successfully if its altitude becomes <= 0 after descending at the end of some second.

If any plane lands, the process stops immediately.

Task: Assuming you choose the best possible plane to shoot each second, return the maximum number of planes you can shoot down before the first successful landing occurs.

Input: altitude[], descent[] (same length n)

Output: integer (max planes shot)

Problem 2: Count user sessions from events

You are given:

  • events : a list of pairs [userId, time] (times are integers; events may be in arbitrary order)
  • timeout : a non-negative integer

For each user, sort that user’s events by time. Two consecutive events for the same user belong to the same session if their time difference is <= timeout. Otherwise, the later event starts a new session.

Task: Return the total number of sessions across all users.

Input: events = [[userId, time], ...], timeout

Output: integer (number of sessions)

Submit Your Answer

Sign in to leave a comment

Loading comments...

Browse More Questions

More Coding & Algorithms•More Supio•More Software Engineer•Supio Software Engineer•Supio Coding & Algorithms•Software Engineer Coding & Algorithms
PracHub

Master your tech interviews with 8,500+ real questions from top companies.

Product

  • Questions
  • Learning Tracks
  • Interview Guides
  • Resources
  • Premium
  • For Universities
  • Student Access

Browse

  • By Company
  • By Role
  • By Category
  • Topic Hubs
  • SQL Questions
  • Compare Platforms
  • Discord Community

Support

  • support@prachub.com
  • (916) 541-4762

Legal

  • Privacy Policy
  • Terms of Service
  • About Us

© 2026 PracHub. All rights reserved.