Queue – Interview Questions and Practice Problems

A Queue is a linear First-In-First-Out (FIFO) data structure which means that the first element added to the queue will be the first one to be removed. Therefore, once a new element is added to the queue, all elements that were added before have to be removed before the new element can be removed.

 
In this post, we have listed out commonly asked interview questions that use queue data structure:

  1. Queue implementation using an array – C, C++, Java, PythonBeginner
  2. Queue Implementation using a Linked ListBeginner
  3. Implement a stack using the queue data structureMedium
  4. Implement a queue using the stack data structureMedium
  5. Efficiently print all nodes between two given levels in a binary treeEasy
  6. Chess Knight Problem | Find the shortest path from source to destinationHard
  7. Shortest path in a maze – Lee AlgorithmMedium
  8. Find the shortest safe route in a field with sensors presentHard
  9. Flood Fill AlgorithmMedium
  10. Count number of islandsMedium
  11. Find the shortest path from source to destination in a matrix that satisfies given constraintsHard
  12. Generate binary numbers between 1 to n using a queueEasy
  13. Calculate the height of a binary treeEasy
  14. Delete a binary treeEasy
  15. Level order traversal of a binary treeEasy
  16. Spiral order traversal of a binary treeMedium
  17. Reverse level order traversal of a binary treeEasy
  18. Print all nodes of a perfect binary tree in a specific orderHard
  19. Print left view of a binary treeEasy
  20. Find the next node at the same level as the given node in a binary treeMedium
  21. Check if a binary tree is a complete binary tree or notMedium
  22. Print diagonal traversal of a binary treeMedium
  23. Print corner nodes of every level in a binary treeEasy
  24. Invert Binary TreeEasy
  25. Find minimum passes required to convert all negative values in a matrixHard
  26. Convert a binary tree into a doubly-linked list in spiral orderHard
  27. Check if a binary tree is a min-heap or notMedium
  28. Invert alternate levels of a perfect binary treeHard
  29. Convert a Binary Search Tree into a Min HeapHard
  30. Snake and Ladder ProblemHard
  31. Find the shortest distance of every cell from a landmine inside a mazeHard
  32. Convert a multilevel linked list to a singly linked listMedium
  33. Check if an undirected graph contains a cycle or notMedium
  34. Find maximum cost path in a graph from a given source to a given destinationMedium
  35. Total paths in a digraph from a given source to a destination having exactly m edgesMedium
  36. Least cost path in a digraph from a given source to a destination having exactly m edgesMedium
  37. Breadth-First Search (BFS)Medium
  38. Traverse a given directory using BFS and DFS in JavaEasy
  39. Perform vertical traversal of a binary treeMedium
  40. Compute the maximum number of nodes at any level in a binary treeEasy
  41. Print right view of a binary treeMedium
  42. Find the minimum depth of a binary treeEasy
  43. Depth-First Search (DFS) vs Breadth-First Search (BFS)Beginner
  44. Bipartite GraphMedium
  45. Compute the least cost path in a weighted digraph using BFSMedium
  46. Find the path between given vertices in a directed graphEasy
  47. Construct a directed graph from an undirected graph that satisfies given constraintsMedium
  48. Print nodes of a binary tree in vertical orderMedium

Rate this post

Average rating 4.78/5. Vote count: 60

No votes so far! Be the first to rate this post.

We are sorry that this post was not useful for you!

Tell us how we can improve this post?

Thanks for reading.

To share your code in the comments, please use our online compiler that supports C, C++, Java, Python, JavaScript, C#, PHP, and many more popular programming languages.

Like us? Refer us to your friends and support our growth. Happy coding :)


guest
0 Comments
Inline Feedbacks
View all comments
Do NOT follow this link or you will be banned from the site!