Longest Stable Window of Modem Signal Strength Samples

Last updated: November 29, 2026

Quick Overview

Given a stream of received signal strength samples (dBm) and a tolerance T, find the longest contiguous window where the maximum minus minimum sample is at most T. Return the start and end indices of that window.

Qualcomm
Coding & Algorithms
Software Engineer
Qualcomm
November 29, 2026
Software Engineer
Technical Screen
Coding & Algorithms
Medium

0

0

0 solved


Given a stream of received signal strength samples (dBm) and a tolerance T, find the longest contiguous window where the maximum minus minimum sample is at most T. Return the start and end indices of that window.

This mirrors work on Qualcomm's Snapdragon modem stack, where a baseband algorithm decides whether a channel is stable enough to keep a beam or trigger a handover. The interviewer wants a linear-time sliding window and expects you to see that a single running max is not enough once the left edge moves.

What the Interviewer Expects
  • Recognizes the sliding window with a shrinking left edge
  • Uses two monotonic deques to track the window max and min in amortized O(1)
  • Explains why indices, not values, are stored in the deques
  • Achieves O(n) time and justifies the amortized bound
  • Handles empty input and ties deterministically (first longest window)
Key Topics to Cover
sliding window
monotonic deque
amortized analysis
streaming signals
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 to an unbounded stream where you must report the stable window ending at each new sample?
  • If memory on the DSP is capped at W samples, how does the answer change?
  • What if the tolerance is relative (percent of mean) instead of absolute?
  • Could you use a sorted container instead of deques, and what does it cost?
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
  • Input: list of integer or float samples, tolerance T >= 0.
  • Output: (start, end) inclusive for the longest window with max - min <= T; earliest one on ties; None for empty input.
  • Should r...
High-Level Design

Grow the window one sample at a time on the right. Maintain a decreasing deque of indices for the max and an increasing deque for the min. When max - min exceeds T, advance left and drop deque h...


Submit Your Answer
Markdown supported

Related Questions