Heap / Priority Queue Interview Questions [2026-2027]
310+ real questions from verified interview reports across 12 companies.
Sourced from 1Point3Acres, Blind, Glassdoor, Reddit, and more. Translated and cleaned.
Top Companies Asking Heap / Priority Queue Questions
Sample Heap / Priority Queue Questions
I gave Amazon OA today on Hackerrank platform. There were two questions to be done in 105 min followed by a work-performance evaluation I believe. Could be related to Amazon...
Meta Phone Screen
Intro, 2 LC Question, 2 Behavioral Question https://leetcode.com/problems/k-closest-points-to-origin/ https://leetcode.com/problems/nested-list-weight-sum/ Some optimization question - Time complexity, Space Complexity Tips : It is a game of luck and lot of practice. 1) you need to...
Box | Phone interview | 2024
You are given 100 log files each of size 1GB. in a few minutes how would you search through the log file for error code 500. > Expected unix...
Easy interview, but the interviewers are inexperienced. Q1: How do you find a specific log in a server file without downloading logs? A: Use grep command Q2: Flip a bit in an integer A:...
Coupang Phone Screening Round for Staff role
Had my phone screening round at Coupang. Question: Merge K sorted list of integers. I gave the initial answer of storing current index for each list and picking the least value and...
1st Question: Find the maximum number of overlapping windows in a set of windows. I.e. 1 --- 10 2 --- 8 3 --- 4 Answer would be 2 ( 3 --- 4 window is overlapped...
Meta Phone Screen
Just had a phone screen with META for SWE (not sure what level) in the US First question was https://leetcode.com/problems/buildings-with-an-ocean-view/description/ Second question was https://leetcode.com/problems/top-k-frequent-elements/ I solved the first question pretty easily. But...
YOE: 5+ Directly got a call to schedule interview (without any prior contact from HR about the role). I got to know about the role from their careers page. **Round - 1 (DSA)** 1. Similar question to t
It's the exact same problem as the one on the forum, asking for the max, median, and mode of a data stream. The follow-up question is to only keep the k most recent numbers. I wrote out all the code,
This post was last edited by Anonymous on 2025-10-02 15:11. I'm working on a cybersecurity startup. The question was straightforward: find the median of an array. The following content requires a scor
**Online Assessment** 1. **Shortest Path:** Algorithm to find the shortest path between a specific source and target. 2. **Anagrams:** Solve a problem involving anagram detection or manipulation. **Ro
Coupang | Staff SW | Feb 2024 [Reject]
Coupang interview questions 1. Coding round 1: Given a list of products, you can either like or dislike them. At a given point of time get the most liked product and...
LeetCode #2512: Reward Top K Students. Difficulty: Medium. Topics: Array, Hash Table, String, Sorting, Heap (Priority Queue). Asked at Booking.com in the last 6 months.
LeetCode #347: Top K Frequent Elements. Difficulty: Medium. Topics: Array, Hash Table, Divide and Conquer, Sorting, Heap (Priority Queue), Bucket Sort, Counting, Quickselect. Asked at Disney in the last 6 months.
#692 Top K Frequent Words
LeetCode #692: Top K Frequent Words. Difficulty: Medium. Topics: Array, Hash Table, String, Trie, Sorting, Heap (Priority Queue), Bucket Sort, Counting. Asked at Box in the last 6 months.
LeetCode #295: Find Median from Data Stream. Difficulty: Hard. Topics: Two Pointers, Design, Sorting, Heap (Priority Queue), Data Stream. Asked at IXL in the last 6 months.
LeetCode #973: K Closest Points to Origin. Difficulty: Medium. Topics: Array, Math, Divide and Conquer, Geometry, Sorting, Heap (Priority Queue), Quickselect. Asked at Asana in the last 6 months.
#253 Meeting Rooms II
LeetCode #253: Meeting Rooms II. Difficulty: Medium. Topics: Array, Two Pointers, Greedy, Sorting, Heap (Priority Queue), Prefix Sum. Asked at FreshWorks in the last 6 months.
LeetCode #295: Find Median from Data Stream. Difficulty: Hard. Topics: Two Pointers, Design, Sorting, Heap (Priority Queue), Data Stream. Asked at Tinder in the last 6 months.
#253 Meeting Rooms II
LeetCode #253: Meeting Rooms II. Difficulty: Medium. Topics: Array, Two Pointers, Greedy, Sorting, Heap (Priority Queue), Prefix Sum. Asked at Compass in the last 6 months.
LeetCode #1481: Least Number of Unique Integers after K Removals. Difficulty: Medium. Topics: Array, Hash Table, Greedy, Sorting, Counting. Asked at fivetran in the last 6 months.
LeetCode #215: Kth Largest Element in an Array. Difficulty: Medium. Topics: Array, Divide and Conquer, Sorting, Heap (Priority Queue), Quickselect. Asked at Cerner in the last 6 months.
## Problem Simulate an auction or order book exchange: match buy/sell orders by price-time priority. Likely involves heaps or sorted structures for order matching. ## Likely LeetCode equivalent No direct match. ## Tags coding, heap, simulation, trading
Live Stream: Design a Real-Time Live Streaming Platform with Chat and Viewer Counts
## Round 1 - System Design ## Problem Design a live streaming platform (think Twitch/YouTube Live) supporting: - Streamers push video to an ingest server via RTMP - Viewers watch the stream with <5 second latency at any scale - Real-time chat: millions of viewers sending messages to the same stream - Live viewer count updated every second ## Key Design Areas - **Ingest and transcoding**: RTMP ingest -> transcode to HLS/DASH at multiple bitrates -> push to CDN edge - **Delivery**: adaptive bitrate over HLS; CDN handles viewer scale - **Chat**: fan-out problem — one message to N viewers. Use a pub-sub bus (Kafka/Redis pub-sub) per stream; clients subscribe via WebSocket to a chat gateway. - **Viewer count**: approximate real-time count using HyperLogLog or counter per server aggregated every second. ## Follow-ups 1. The stream suddenly gets 5M concurrent viewers — what breaks first and how do you recover? 2. How do you enforce chat moderation rules (rate limits, banned words) without adding latency? 3. How do you store the VOD (video on demand) after the stream ends? 4. How do you handle a streamer going live from a very low-bandwidth connection?
Real-time Order Book Stream Comparison: Detect Discrepancies Between Two Feed Sources
## Problem You receive order book updates from two market data feeds (Feed A and Feed B) for the same instrument. Each update is `(timestamp, side, price, quantity)`. Implement a comparator that detects discrepancies: same-timestamp updates where the two feeds disagree on price levels or quantities. ```python class OrderBookComparator: def ingest_a(self, update: dict) -> None: # {"ts": int, "side": str, "price": float, "qty": float} def ingest_b(self, update: dict) -> None: def get_discrepancies( self, tolerance_ms: int = 50, qty_tolerance: float = 0.01 ) -> list[dict]: ``` ## Example ``` comp.ingest_a({"ts": 1000, "side": "bid", "price": 100.0, "qty": 10.0}) comp.ingest_b({"ts": 1000, "side": "bid", "price": 100.0, "qty": 9.5}) comp.get_discrepancies(qty_tolerance=0.1) # -> [{"ts": 1000, "side": "bid", "price": 100.0, "feed_a_qty": 10.0, "feed_b_qty": 9.5}] # qty diff = 0.5 > 0.1 tolerance ``` ## Follow-ups 1. Feed B often lags by 20-100ms — how do you match updates across feeds with timing skew? 2. What ring-buffer or sliding-window data structure best supports this real-time comparison? 3. How do you alert on systematic bias (Feed B is always lower) vs. random noise?
See All 310 Heap / Priority Queue Questions
Full question text, interview context, and company-specific frequency data for subscribers.
Get Access