Queue Problems for Coding Interviews
19 Queue problems from real coding interviews, each with test cases you can run online. By difficulty they split into 2 basic, 11 intermediate and 6 advanced. The companies that ask them most often are Amazon, Google, Meta, Bloomberg.
Solve a few problems of each level, name the pattern after each one and revisit the ones that needed a hint a week later. Practise stating the time and space complexity and the edge cases before you code.
Coding problems
- Queue With Maximum (Intermediate)
- Message Retry With Dead Letter (Advanced)
- Orderly Queue (Advanced)
- Number of Visible People in a Queue (Advanced)
- Design Circular Queue (Intermediate)
- Design Circular Deque (Intermediate)
- Process Tasks Using Servers (Advanced)
- Queue Reconstruction by Height (Intermediate)
- Sliding Window Maximum Values (Advanced)
- Front Middle Back Queue (Intermediate)
- Most Recently Used Queue (Intermediate)
- Round Robin Completion Times (Intermediate)
- Implement Queue Using Stacks (Basic)
- Constrained Subsequence Sum (Advanced)
- Round Robin Finish Times (Intermediate)
- Printer Queue Print Position (Intermediate)
- Deque Operation Results (Basic)
- Multi-Teller Last Finish Time (Intermediate)
- Priority Queue Job Finish Time (Intermediate)
Related
Frequently asked questions
How do I get good at queue problems?
Practise by level, name the pattern after you solve each problem and review the ones you needed hints for. The list is ordered so you can start with the basic ones.
Can I run queue problems online here?
Yes. Each problem opens in an editor that runs your code against test cases in Java, Python, C++, Go, JavaScript and more.