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–12
Design a hit counter that records timestamps of hits and returns the number of hits in the past 5 minutes (300 seconds). The challenge is…
Companies: Adyen, Apple, Cisco, Databricks +5
Array · Binary Search · Data Stream · Design
Last reported Nov 2026
Return the index of the first character in s that occurs exactly once (or -1 if none). This is typically solved by counting character frequencies…
Companies: Apple, Goldman Sachs
Counting · Hash Table · Queue · String
Last reported Sep 2026
Given a nested list where elements may be integers or sublists, implement a NestedIterator with next() and hasNext() that returns all integers in depth‑first, left‑to‑right…
Companies: Adobe, LinkedIn
Depth-First Search · Design · Iterator · Queue
Last reported Aug 2026
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
Design a data structure that, given an initial list and a stream of added numbers, returns the first integer that appears exactly once at any…
Companies: Uber
Array · Data Stream · Design · Hash Table
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
Design a data structure that, given a continuous stream of numbers and a fixed window size k, returns the moving average of the last k…
Companies: Box, Google, Meta, Spotify
Array · Data Stream · Design · Queue
Last reported Mar 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
Implement a fixed-size circular queue (ring buffer) supporting enqueue, dequeue, Front/Rear, isEmpty and isFull operations without using built-in queue types. The core…
Companies: NVIDIA
Array · Design · Linked List · Queue
Companies: Rippling
Data Stream · Design · Hash Table · Queue
Given n people seated in a circle, repeatedly remove every k-th person clockwise until one remains and return their label — the classic Josephus problem…
Companies: Goldman Sachs
Array · Math · Queue · Recursion