Queue LeetCode Problems: All 43, With Python Solutions
Every problem in this library that LeetCode tags Queue — 43 in total, 34 of them with a complete Python solution, a worked example and the time and space complexity of the approach.
- 43 problems
- 7 Easy
- 19 Medium
- 17 Hard
How Queue problems are solved
A tag names the subject, not the method. These pattern hubs cover the techniques that actually solve Queue problems — each one explains the approach, gives a Python template and states its complexity.
- Stack — When the most recent unresolved thing is the one that matters, use a stack.
Queue problems by difficulty
Problems with a complete Python solution are listed first, then by ascending problem number.
Easy (7)
| # | Problem | Difficulty | Topics |
|---|---|---|---|
| 225 | Implement Stack using Queues | Easy | Stack, Design, Queue |
| 232 | Implement Queue using Stacks | Easy | Stack, Design, Queue |
| 387 | First Unique Character in a String | Easy | Queue, Hash Table, String +1 |
| 933 | Number of Recent Calls | Easy | Design, Queue, Data Stream |
| 1700 | Number of Students Unable to Eat Lunch | Easy | Stack, Queue, Array +1 |
| 2073 | Time Needed to Buy Tickets | Easy | Queue, Array, Simulation |
| 346 | Moving Average from Data StreamPremium | Easy | Design, Queue, Array +1 |
Medium (19)
| # | Problem | Difficulty | Topics |
|---|---|---|---|
| 341 | Flatten Nested List Iterator | Medium | Stack, Tree, Depth-First Search +3 |
| 622 | Design Circular Queue | Medium | Design, Queue, Array +1 |
| 641 | Design Circular Deque | Medium | Design, Queue, Array +1 |
| 649 | Dota2 Senate | Medium | Greedy, Queue, String |
| 918 | Maximum Sum Circular Subarray | Medium | Queue, Array, Divide and Conquer +2 |
| 950 | Reveal Cards In Increasing Order | Medium | Queue, Array, Sorting +1 |
| 1438 | Longest Continuous Subarray With Absolute Diff Less Than or Equal to Limit | Medium | Queue, Array, Ordered Set +3 |
| 1670 | Design Front Middle Back Queue | Medium | Design, Queue, Array +2 |
| 1696 | Jump Game VI | Medium | Queue, Array, Dynamic Programming +2 |
| 1823 | Find the Winner of the Circular Game | Medium | Recursion, Queue, Array +2 |
| 2327 | Number of People Aware of a Secret | Medium | Queue, Dynamic Programming, Simulation |
| 2526 | Find Consecutive Integers from a Data Stream | Medium | Design, Queue, Hash Table +2 |
| 2762 | Continuous Subarrays | Medium | Queue, Array, Ordered Set +3 |
| 2944 | Minimum Number of Coins for Fruits | Medium | Queue, Array, Dynamic Programming +2 |
| 281 | Zigzag IteratorPremium | Medium | Design, Queue, Array +1 |
| 353 | Design Snake GamePremium | Medium | Design, Queue, Array +2 |
| 362 | Design Hit CounterPremium | Medium | Design, Queue, Array +2 |
| 379 | Design Phone DirectoryPremium | Medium | Design, Queue, Array +2 |
| 1429 | First Unique NumberPremium | Medium | Design, Queue, Array +2 |
Hard (17)
| # | Problem | Difficulty | Topics |
|---|---|---|---|
| 239 | Sliding Window Maximum | Hard | Queue, Array, Sliding Window +2 |
| 862 | Shortest Subarray with Sum at Least K | Hard | Queue, Array, Binary Search +4 |
| 936 | Stamping The Sequence | Hard | Stack, Greedy, Queue +1 |
| 995 | Minimum Number of K Consecutive Bit Flips | Hard | Bit Manipulation, Queue, Array +2 |
| 1425 | Constrained Subsequence Sum | Hard | Queue, Array, Dynamic Programming +3 |
| 1499 | Max Value of Equation | Hard | Queue, Array, Sliding Window +2 |
| 1687 | Delivering Boxes from Storage to Ports | Hard | Segment Tree, Queue, Array +4 |
| 1825 | Finding MK Average | Hard | Design, Queue, Data Stream +2 |
| 2071 | Maximum Number of Tasks You Can Assign | Hard | Greedy, Queue, Array +4 |
| 2398 | Maximum Number of Robots Within Budget | Hard | Queue, Array, Binary Search +4 |
| 2407 | Longest Increasing Subsequence II | Hard | Binary Indexed Tree, Segment Tree, Queue +4 |
| 2444 | Count Subarrays With Fixed Bounds | Hard | Queue, Array, Sliding Window +1 |
| 2528 | Maximize the Minimum Powered City | Hard | Greedy, Queue, Array +3 |
| 2945 | Find Maximum Non-decreasing Array Length | Hard | Stack, Queue, Array +4 |
| 683 | K Empty SlotsPremium | Hard | Binary Indexed Tree, Segment Tree, Queue +5 |
| 2534 | Time Taken to Cross the DoorPremium | Hard | Queue, Array, Simulation |
| 2969 | Minimum Number of Coins for Fruits IIPremium | Hard | Queue, Array, Dynamic Programming +2 |
Keep exploring
- Array1,569
- String672
- Hash Table588
- Math485
- Dynamic Programming481
- Sorting392
- Greedy346
- Depth-First Search289
- Binary Search253
- Database249
- Tree225
- Breadth-First Search223
- Matrix216
- Two Pointers201
- Bit Manipulation194
- Binary Tree174
- Heap (Priority Queue)163
- Prefix Sum157
- Stack157
- Simulation144
- Graph138
- Counting126
- Design122
- Sliding Window116
When the Queue problem arrives live
Stealth Interview is a desktop app for macOS and Windows. It reads the coding problem off your screen, returns a working solution with a step-by-step explanation and its time and space complexity, and transcribes what the interviewer is saying — while staying invisible to screen sharing.