Question bank › Two Pointers
Dsa Two Pointers Hard

Minimum Bandwidth for Upload

You are tasked with calculating the minimum required bandwidth needed for uploads in a streaming service. Given an array of upload sizes and a threshold, find the minimum contiguous subarray where the sum exceeds the threshold. If no such subarray exists, return -1. Input is a single line of space-separated integers followed by a threshold integer. Example input: '1 2 3 4 5 6 7 8 9 15'. Example output: '2'.

Key concepts

two_pointerstrafficbandwidth

Practise this out loud — free

Start a mock interview on THIS exact question — a voice AI interviewer opens with it, pushes back like a real onsite, then hands you an instant scorecard.

🎙 Practise this question now
Part of InterviewLab's verified interview question bank. We show the prompt and concepts to practise with — never a copy-paste solution.