Heap / Priority Queue Interview Questions
303+ 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
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:...
Part 1: https://leetcode.com/problems/meeting-rooms-ii * Part 2: Return a list of pair of (meeting, room) showing which meeting will be held in which room. E.g. given meetings [[0,30],[5,10],[15,20]], answer should be...
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
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 Nvidia 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 Infosys in the last 6 months.
LeetCode #1962: Remove Stones to Minimize the Total. Difficulty: Medium. Topics: Array, Greedy, Heap (Priority Queue). Asked at Expedia in the last 6 months.
#767 Reorganize String
LeetCode #767: Reorganize String. Difficulty: Medium. Topics: Hash Table, String, Greedy, Sorting, Heap (Priority Queue), Counting. Asked at Expedia in the last 6 months.
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.
#264 Ugly Number II
LeetCode #264: Ugly Number II. Difficulty: Medium. Topics: Hash Table, Math, Dynamic Programming, Heap (Priority Queue). Asked at Paytm in the last 6 months.
#355 Design Twitter
LeetCode #355: Design Twitter. Difficulty: Medium. Topics: Hash Table, Linked List, Design, Heap (Priority Queue). Asked at Swiggy 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.
First Round: Online assessment There was a coding question as well as some technical MCQ questions, all to be completed within 90 minutes Second Round: Technical Interview After receiving the shortlisted mail,...
The first interview asked about merging k lists, but binary search can't be used because the space complexity needs to be O(k) instead of O(n). I just received my Superday offer after a month. Anyone
See All 303 Heap / Priority Queue Questions
Full question text, interview context, and company-specific frequency data for subscribers.
Get Access