Google Interview Question for Software Engineer / Developers






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

Hashtable is for dictionary operations like INSERT, DELETE, SEARCH. whereas Search trees can be used for dynamic-set operations including SEARCH, MINIMUM, MAXIMUM, PREDECESSOR, SUCCESSOR, INSERT and DELETE. Thus, a search tree can be used both as a dictionary and as a priority queue.

- topgun.in January 16, 2010 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 votes

I am not sure what you mean by PREDECESSOR AND SUCCESSOR. In BST, Is relationship among data like parent and child important in the aspect of data itself?
However, I agree with the opinion the BST have two functions, Index + storage. I think BST is better when there is not efficient hashtable because hash table and the function complex is + alpha on the process.

- bottomgun.in January 26, 2010 | Flag
Comment hidden because of low score. Click to expand.
2
of 2 vote

BST is sorted.
Linked list is ordered( elements r adde d in a specific order of arrival.
hash table is unordered and unsorted.

Use a llist if u need to store data of stops a bus or a train visits.
A hashT if you want to store contents of a dictionary,where u need a quick access to a value.
Use a BST if you Need sort+ a good search time.
I cannot think of a practical use where to use BST.but I guess it's variations ve sum practical applications.

- hash May 26, 2011 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

In BST look up is O(logn) in worst case where as it is not true in case of BST.

- Anonymous January 16, 2010 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

@above: Fantastic.

- Thiyanesh January 22, 2010 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

BSTs are better than Hashtable when the order(sorted) of data is important.

- neo April 01, 2010 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 votes

+1

- Anonymous April 16, 2010 | Flag
Comment hidden because of low score. Click to expand.
0
of 0 vote

en.wikipedia.org/wiki/Associative_array#Efficient_representations

- Anonymous April 14, 2010 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 votes

nice catch!

- Anonymous April 16, 2010 | Flag
Comment hidden because of low score. Click to expand.
0
of 2 vote

In my opinion, the edges BST have over Hash is its sorted attribute .
1, you could easily get Max, Min from BST,
2, Traversal data in order
3, lookup data in a certain range
etc.
Any way, if the operations you need have some thing to do with order , BST is better. Hash have NO order info saved , you could only lookup one by one ( of course for a single lookup , Hash could kick BST's ass with its super speed ) ....

- iatbst January 30, 2012 | Flag Reply
Comment hidden because of low score. Click to expand.
-1
of 1 vote

slafdjklak lfklsdkf;lsd lksd lfs;ldf ;lsdf;l ksdlfsd;lf s;ldafl;dlksadlkgfsdgmdlk mgskdfmgkfdm gkdmfkg mdfkgmfdkmg kdfmg kd

- Anonymous July 26, 2010 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 votes

what the hell is this ????

- Anonymous July 26, 2010 | Flag
Comment hidden because of low score. Click to expand.
-1
of 1 vote

Teri maa ki choot

- Anonymous November 12, 2010 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 votes

no updates on this site

- unknwn February 29, 2012 | 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