Google Interview Question for Software Engineer / Developers






Comment hidden because of low score. Click to expand.
0
of 0 vote

I could not assume that the array was sorted...So I sorted the array and wrote the code as per the technique proposed by amit5624.. The interviewer completely ignored it and asked me to write code for a self balancing binary search tree instead..so i wrote the insert function for avl tree

- einstein010 April 18, 2011 | Flag Reply
Comment hidden because of low score. Click to expand.
-1
of 1 vote

start from the middle node...make that the root...call the same function for the left half array as well as the right half array

- camSun April 17, 2011 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 votes

To be honest I did not understand the question...

But anyway, if the problem is what you thought it is, there is an assumption that the array is already sorted in order to apply your method.

- airfang613 April 18, 2011 | Flag
Comment hidden because of low score. Click to expand.
0
of 0 votes

the question never said array was sorted , in this question he wants you to implement the insert function for a balanced binary search tree , say an avl tree

- Geek January 22, 2013 | Flag


Add a Comment
Name:

Writing Code? Surround your code with {{{ and }}} to preserve whitespace.

Books

is a comprehensive book on getting a job at a top tech company, while focuses on dev interviews and does this for PMs.

Learn More

Videos

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.

Learn More

Resume Review

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.

Learn More

Mock Interviews

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.

Learn More