InterviewDigestInterviewDigest

OA Practice Workspace

Technical2026-08-13

Hard question 4

AI-Expanded — inferred from the question title, not from the original candidate report

Given an array of $n$ integers, find the length of the longest subarray such that the absolute difference between the maximum and minimum elements in that subarray is at most $k$. Your solution must operate in $O(n)$ time complexity using a sliding window approach with monotonic deques to track the current range of values.

Context & Summary

Online coding round with 4 questions of varying difficulty

💻 Coding practice works best on desktop.
Code editors are too cramped on mobile screens.