Interview Question


Country: India
Interview Type: Phone Interview




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

AVL Trees

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

B+ trees in specific

- sandip November 11, 2012 | Flag
Comment hidden because of low score. Click to expand.
0
of 0 votes

explain it.......

- bhudevfdd December 10, 2012 | Flag
Comment hidden because of low score. Click to expand.
0
of 0 vote

Can someone explain to me why can't we just use a hash table?

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

hash table relies on the hash function so that hash function should ensure the uniformity of all the keys into all the hash positions...

- Karthik Vvs November 10, 2012 | Flag
Comment hidden because of low score. Click to expand.
0
of 0 votes

and why does that mean you can't use a hash table?

- eugene.yarovoi November 11, 2012 | Flag
Comment hidden because of low score. Click to expand.
0
of 0 votes

hey eugene,
if the hash function is not good, then there will be a lot of collisions and would increase the complexity to O(n) if you use linked list as chaining. However, if you use something like B+/AVL/RB Tree instead of a linked list, then hashtable might work, however this is assuming that your hash function is uniform, otherwise, you wont get any improvement.

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

That doesn't mean we can't use a hash table -- just means we have to make a good hash function.

"However, if you use something like B+/AVL/RB Tree instead of a linked list, then hashtable might work, however this is assuming that your hash function is uniform, otherwise, you wont get any improvement."

Really not sure I'm following you there. Are you saying that we should use B+ trees as a *collision resolution mechanism*?

- eugene.yarovoi November 12, 2012 | Flag
Comment hidden because of low score. Click to expand.
0
of 0 vote

The question specified that the data is huge, something that most likely not to fit into memory.

- Ben December 18, 2012 | Flag Reply


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