NVIDIA Interview Question for Software Engineer / Developers






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

I am not sure but ans could be
1. maintain two pointers in case of tree whereas one in list.
2. keeping track of balance of each node in tree.
3. balancing the tree if it gets unbalanced.
All these overheads + O(log n) search may equal O(n).

- Aniket October 21, 2011 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 votes

lol...
i am sure no one find better explanation than this...

- Rohan November 03, 2011 | Flag
Comment hidden because of low score. Click to expand.
0
of 0 votes

yupp.. this is the most suitable reply to this question

- guptaanjali.30 December 04, 2012 | Flag
Comment hidden because of low score. Click to expand.
0
of 0 votes

"All these overheads + O(log n) search may equal O(n)."

What do you mean by that? Almost any balanced binary search tree has at least O(log n) amortized time for any operation it supports. Its superior in every way compared to a circular linked list.

The only reason I could imagine is that you could use two linked lists... one for short term memory and one for entries that have stayed there for more than a few seconds. Like generational garbage collection. The overhead of linked list may be lower on heavy updating as well as when not updating at all. Those are the two extreme cases represented by both linked list. But if you only use ONE linked list for all memory (short term + long term) then you are basically screwed.

- lunatic March 25, 2014 | Flag
Comment hidden because of low score. Click to expand.
0
of 0 votes

And of course the other argument is that you can use batching on linked lists. Like you could wait until a certain threshold of "free" calls has passed or until malloc() fails. Then you cleanup all dead entries which you have collected in a separate list, which can be sorted on invokation with std::sort(). this will provide superior performance over binary trees which do not support this kind of algorithm.

- lunatic March 25, 2014 | Flag
Comment hidden because of low score. Click to expand.
0
of 0 vote

I am not very much clear about your question but u can find a very good article here which talks about allocator, I didnt go through it fully but its interesting. Once u'll start reading it u'll definetely keep on reading it.
cs.northwestern.edu/~pdinda/icsclass/doc/dsa.pdf

- socrates July 12, 2011 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 votes

thanks buddy

- anon July 12, 2011 | Flag
Comment hidden because of low score. Click to expand.
0
of 0 votes

ohh.. sorry for skipping words in question.
The question was why do we use circular link list in place od any balanced tree in storage allocator app.? By using balanced search tree the address search time wud be reduced to O(log n) which is not the case with Link lists. To make it more clear : we are not restricted to free the memory allocated in the sequence in which it was allocated(hint)

- anon July 12, 2011 | Flag
Comment hidden because of low score. Click to expand.
0
of 0 vote

heap fragmentation

- teichopsia January 07, 2012 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 votes

I agree with you. And also i suppose the overhead of balancing the tree with outplay the overhead to remove items from List.

- Sandeep N L February 02, 2012 | Flag
Comment hidden because of low score. Click to expand.
0
of 0 votes

I agree with you. And also i suppose the overhead of balancing the tree with outplay the overhead to remove items from List.

- Sandeep N L February 02, 2012 | Flag
Comment hidden because of low score. Click to expand.
0
of 0 votes

I agree with you. And also i suppose the overhead of balancing the tree with outplay the overhead to remove items from List.

- Anonymous February 02, 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