Plan Cloud Streaming Bitrates Under a Data Budget

Last updated: November 29, 2026

Quick Overview

For a cloud-streamed session split into n segments, each segment has a deliverable data cap and you pick one bitrate level per segment (each with a size and quality score); choose levels so total data stays within a budget, maximizing total quality minus a penalty for each level switch.

PlayStation
Coding & Algorithms
Software Engineer
PlayStation
November 29, 2026
Software Engineer
Onsite
Coding & Algorithms
Hard

0

0

0 solved


For a cloud-streamed session split into n segments, each segment has a deliverable data cap and you pick one bitrate level per segment (each with a size and quality score); choose levels so total data stays within a budget, maximizing total quality minus a penalty for each level switch.

PS Plus Cloud Streaming and Remote Play constantly trade picture quality against bandwidth, and visible quality switches feel worse to players than a steady picture. This question checks whether a candidate can turn that trade-off into a dynamic program with the right state and reconstruct the chosen plan.

What the Interviewer Expects
  • Identify state as (segment, current level, data used)
  • Handle the switch penalty with a best-over-previous-levels pass to avoid an extra L factor
  • Respect both the per-segment cap and the global budget
  • Reconstruct the chosen levels, not just the score
  • Discuss pseudo-polynomial complexity and how to coarsen the budget
Key Topics to Cover
Dynamic programming
Knapsack
Path reconstruction
Adaptive bitrate
Cloud streaming
How to Approach This
  1. Clarify input constraints and edge cases before writing code.
  2. Walk through your approach verbally and confirm with the interviewer before coding.
  3. Start with a brute force solution, then optimize. Mention time and space complexity.
  4. Test your solution with examples, including edge cases like empty input or duplicates.
  5. Consider common patterns: sliding window, two pointers, hash map, BFS/DFS, dynamic programming.
Possible Follow-up Questions
  • How would you adapt this when throughput is only known one segment ahead (online version)?
  • The budget is large (megabits); how do you keep the DP tractable?
  • How would you model a client buffer that can absorb a temporary throughput dip?
  • Penalty should depend on switch size; what changes?
Sharpen Your Skills on Codemia

Practice similar problems with our interactive workspace, get AI feedback, and track your progress.

Practice DSA Problems
Sample Answer
Requirements

Inputs: caps[i] (max data for segment i), sizes[j] and quality[j] per level, an integer budget, and penalty per switch. Level j is allowed in segment i only if sizes[j] <= caps[i]. Maximiz...

High-Level Design

This is a knapsack with a sequence dependency. Let dp[j][u] be the best score for the prefix ending at level j having used exactly u units. Transition into level j at segment i from either the same ...


Submit Your Answer
Markdown supported

Related Questions