NVIDIA Interview Question for Software Engineer / Developers


Country: United States
Interview Type: Written Test




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

His memory usage pattern is probably skewed towards allocating a lot of small object (Hint Hint: heavy STL/BOOST usage). Tweak your memory manager to keep a lot of smaller size buffers available upfront.

- Anonymous October 09, 2013 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 votes

I concur, this is likely a case of overallocating memory for the expection of growth while the actual behavior is lots of small and compact memory chunks. Idealy a way to set the type of expected allocation would best. This way as you suggested, smaller, more compact blocks of memory could be handed out.

- david October 18, 2013 | Flag
Comment hidden because of low score. Click to expand.
2
of 2 vote

The issue, as mentioned, seems to be a lot of small allocation which lead to memory fragmentation. Solution might be upgrading memory manager to use pools for specific block sizes.

- martin October 18, 2013 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

We can fix it by adding some kind of compaction. When average size of free block reaches some threshold - invoke compaction.

- glebstepanov1992 October 04, 2013 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 votes

This suggestion is problematic; If I request memory via his memory manage with an interface like malloc(), you cannot possibly change where my pointers point to unless I free()ed or realloc()ed it as you'll be turning all my perfectly legal pointers into dangling pointer thus invoking undefined behavior.

- david October 18, 2013 | Flag
Comment hidden because of low score. Click to expand.
0
of 0 vote

Two considerations:
1. the coworker's memory usage pattern may be screwed by allocating too many noncontinuous memory blocks and leaving a large percentage of unallocated memory but cannot be utilized because of the external fragmentation.
2. the design of the memory manager you developed. This may be raised by the improper design of the memory manager by taking too much space for small allocated blocks. This design causes the internal fragmentation. For example, your design doesn't optimize the structure for small blocks allocated. If only 1 byte is allocated, but in order to maintain the alignment or meta information, you need to use another 15 bytes to satisfy the goal.

- yunpeng August 31, 2017 | 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