is a comprehensive book on getting a job at a top tech company, while focuses on dev interviews and does this for PMs.
CareerCup's interview videos give you a real-life look at technical interviews. In these unscripted videos, watch how other candidates handle tough questions and how the interviewer thinks about their performance.
Most engineers make critical mistakes on their resumes -- we can fix your resume with our custom resume review service. And, we use fellow engineers as our resume reviewers, so you can be sure that we "get" what you're saying.
Our Mock Interviews will be conducted "in character" just like a real interview, and can focus on whatever topics you want. All our interviewers have worked for Microsoft, Google or Amazon, you know you'll get a true-to-life experience.
The simplified solution is to do circular right shit 3 times multipled by number of iterations
- skondoji March 12, 2014>>>2*3 and extract the middle element.
Programmatically you would need extra Stack and a Queue
Algorithm would be like the following
S2.push(S1.pop());
S2.push(S1.pop());
Q2.Enqueue(S1.pop());
Q2.Enqueue(S1.pop());
Q2.Enqueue(S1.pop());
S1.Push(S2.pop());
S1.Push(S2.pop());
S2.push(Q2.dequeue());
S2.push(Q2.dequeue());
S2.push(Q2.dequeue());
S1.Push(S2.pop());
S1.push(S2.pop());
S1.push(S2.pop());
Repeat the above procedure n times for n iterations. Implement the stack with an array has backing store and get the middle element.