VehiclesFashionRecipesBlogsHuntTravelsSportFunHandmadeITEducation
Mini-Games
x

x
zakruti.com » IT - Software » freeCodeCamp.org
Google Interview Question: How to Code a Queue Using a Stack. Whiteboard Wednesday by Irfan Baqui

Google Interview Question: How to Code a Queue Using a Stack. Whiteboard Wednesday by Irfan Baqui

FBTwitterReddit

video description

Rating: 4.0; Vote: 1
Irfan Baqui shows you how to approach whiteboard coding interviews in this weekly series of Whiteboard Wednesday! Check out more Whiteboard Wednesday videos here: https://www.youtube.com/watch?v=71kEvXsEKYQ&list=PLs2vRLhtciEt46Fg-uz1LQxb4xSW-KMGa Today's question is from Google: How to implement a queue using stacks? About Irfan: Irfan Baqui is a software engineer based in San Francisco. He loves to help other engineers grow and writes about how you can get your dream job: irfanbaqui.com/blog You can learn more about Irfan here: http://irfanbaqui.com/about Irfan publishes weekly tech and non-tech videos on his youtube channel, including Whiteboard Wednesdays. Check it out and subscribe! https://youtube.com/c/irfanbaqui Ask Irfan a question or just say Hi: https://twitter.com/irfanbaqui
Date: 2022-03-14

Comments and reviews: 2


Hello Irfan,
So we are using recursive approach here, and under the hood recursion uses Stack. If we go through iteratively, then we have to have an array.
So ultimately I'm using one another data structure here.
So can I ask it to interviewer like what is the point to do this whole stuff when I can easily do it??

reply

I really like the recursion that Irfan used while implementing the solution, I'd come up with a cycle that pops and pushes the elements until it reaches the first element.
reply
Add a review, comment






Other channel videos