PracHub
QuestionsCoachesLearningGuidesInterview Prep
|Home/Coding & Algorithms/Fireworks Ai

Find global GPU idle intervals

Last updated: Jun 21, 2026

Quick Overview

This question evaluates competency in interval reasoning, managing overlapping time ranges across distributed resources, designing online data structures for streaming task arrivals, and performing algorithmic time/space complexity analysis.

  • medium
  • Fireworks Ai
  • Coding & Algorithms
  • Software Engineer

Find global GPU idle intervals

Company: Fireworks Ai

Role: Software Engineer

Category: Coding & Algorithms

Difficulty: medium

Interview Round: Technical Screen

You are given a set of GPU tasks. Each task is a tuple `(start, end, node_id)` where: - `start` and `end` are timestamps (e.g., integers, with `start < end`). - The task runs on a single GPU identified by `node_id`. - Multiple tasks may overlap in time (possibly on different nodes). Define the **GPU fleet idle time** as any time interval during which **no tasks are running on any node** (i.e., across the entire fleet, the number of active tasks is 0). ### Part 1 (batch) Given an unsorted list of tasks, return all maximal **idle time intervals** as a list of disjoint intervals `(idle_start, idle_end)`. Clarifications/assumptions to make explicit in your solution: - You should infer the overall time range from the tasks themselves (i.e., consider idle gaps only **between** the earliest task start and the latest task end). - If tasks touch (e.g., one ends at `t` and another starts at `t`), there is **no** idle time at `t`. ### Part 2 (streaming) Now tasks arrive one at a time in a stream. Design an efficient approach/data structure that supports: - `addTask(start, end, node_id)` - `getIdleIntervals()` → returns the current set of maximal idle intervals based on all tasks seen so far Discuss expected time/space complexity per operation. (You may assume timestamps are integers and tasks may arrive out of order.)

Quick Answer: This question evaluates competency in interval reasoning, managing overlapping time ranges across distributed resources, designing online data structures for streaming task arrivals, and performing algorithmic time/space complexity analysis.

|Home/Coding & Algorithms/Fireworks Ai

Find global GPU idle intervals

Fireworks Ai logo
Fireworks Ai
Jan 6, 2026, 12:00 AM
mediumSoftware EngineerTechnical ScreenCoding & Algorithms
15
0
Practice Read
Loading...

You are given a set of GPU tasks. Each task is a tuple (start, end, node_id) where:

  • start and end are timestamps (e.g., integers, with start < end ).
  • The task runs on a single GPU identified by node_id .
  • Multiple tasks may overlap in time (possibly on different nodes).

Define the GPU fleet idle time as any time interval during which no tasks are running on any node (i.e., across the entire fleet, the number of active tasks is 0).

Part 1 (batch)

Given an unsorted list of tasks, return all maximal idle time intervals as a list of disjoint intervals (idle_start, idle_end).

Clarifications/assumptions to make explicit in your solution:

  • You should infer the overall time range from the tasks themselves (i.e., consider idle gaps only between the earliest task start and the latest task end).
  • If tasks touch (e.g., one ends at t and another starts at t ), there is no idle time at t .

Part 2 (streaming)

Now tasks arrive one at a time in a stream. Design an efficient approach/data structure that supports:

  • addTask(start, end, node_id)
  • getIdleIntervals() → returns the current set of maximal idle intervals based on all tasks seen so far

Discuss expected time/space complexity per operation. (You may assume timestamps are integers and tasks may arrive out of order.)

Submit Your Answer to Earn 20XP

Sign in to leave a comment

Loading comments...

Browse More Questions

More Coding & Algorithms•More Fireworks Ai•More Software Engineer•Fireworks Ai Software Engineer•Fireworks Ai Coding & Algorithms•Software Engineer Coding & Algorithms
PracHub

Master your tech interviews with 8,000+ 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
  • AI Coding 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.