Bloomberg LP Interview Question for Financial Software Developers






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

No.It needs continous strip of memory..

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

should work...

probably calloc can't allocate as it needs a continuous chunk

- Anonymous October 10, 2009 | Flag
Comment hidden because of low score. Click to expand.
0
of 0 votes

http://onlamp.com/pub/a/onlamp/2005/10/27/memory-management.html

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

Thanks Dude !! nice link

- sachin323 December 21, 2009 | Flag
Comment hidden because of low score. Click to expand.
1
of 1 vote

Malloc() always allocates bytes from the heap which is present in the virtual memory. The programmer does not have any rights to access RAM directly thru his program (except in rare occasions when working at kernel level).

So, malloc() will always work irrespective of the usage of RAM. The usage of RAM affects paging & execution speed.

- Helper December 17, 2009 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 votes

Well spotted! malloc requests a contiguous block in virtual memory. This block can be mapped into physical memory in many ways (even if the physical storage is fragmented which is often true).

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

Ladka Heera hai !!!

- Anonymous January 23, 2011 | Flag
Comment hidden because of low score. Click to expand.
0
of 0 vote

As far I have read about malloc and calloc, malloc() allocates a single block of contiguous storage, whereas calloc() allocates multiple blocks of storage, each block of the same size.

Hence, in this case, memory cannot be allocated and malloc() should return NULL.

- Rajika Tandon November 12, 2009 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 votes

Yes.malloc() request OS to allocate , say k, contigous virtual memory pages, and maps them to k arbitrary physical pages located anywhere in physical memory. Because of the way pages table work, there is no need for the OS to locate k contiguous pages of physical memory

- sophia November 13, 2009 | 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