Interview questions
Find a company or topic. Read the sources, then practice.
Loading the question library…
Find a company or topic. Read the sources, then practice.
Loading the question library…
Showing 1–4
Given an integer array and a window size k, return the maximum value for each contiguous subarray (sliding window) as it moves one step to…
Companies: Amazon, Bloomberg, D. E. Shaw, Expedia +7
Array · Heap (Priority Queue) · Monotonic Queue · Queue
Last reported Jun 2026
Find the length of the longest contiguous subarray whose maximum minus minimum is ≤ limit; the key challenge is maintaining the window's current min and…
Companies: MongoDB, Uber
Array · Heap (Priority Queue) · Monotonic Queue · Ordered Set
Last reported Apr 2026
Count the number of contiguous subarrays whose minimum equals minK and maximum equals maxK. The main challenge is to efficiently (O(n)) scan the array, partitioning…
Companies: Adobe, Uber
Array · Monotonic Queue · Queue · Sliding Window
Last reported Apr 2026
Find the length of the shortest contiguous subarray whose sum is at least k, or return -1 if none exists. Because nums can contain negative…
Companies: Meta
Array · Binary Search · Heap (Priority Queue) · Monotonic Queue
Last reported Jan 2025