NVIDIA Interview Question for Software Engineer / Developers






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

malloc is a memory allocator which manages the memory use requested by user.
It reduces requesting new memory from OS by recycling the freed memory space. It uses Free List to keep track of the freed memory. When free(ptr) is called, the allocator looks at the header/footer of the memory block. The header of the memory block contains enough information (such as total bytes, status(freed/allocated), etc..) to remove it.

Coalescing the freed memory with its neighbor freed memory can optimize the memory use. It also reduces the external fragmentation.

- Kevin.K December 25, 2009 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

Generally with the traditional memory managers some leading bytes (2 bytes) are allocated .Now when user call free(addr) it tries to do the addr-2 and get the size of the block .Then it just add this block to the available free list .Where in the free list it is added depends upon the memory manager(first fit , best fit and worst fit) also this free list needs not to be a single linked list generally a balanced tree .

- Kenzo December 28, 2009 | 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