Samsung Interview Question


Country: India




Comment hidden because of low score. Click to expand.
4
of 6 vote

1) It depends on the resource limits of the user.
2) It also depends on the availability of address space.

- Shiva August 17, 2013 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

The maximum memory it can allocate is the size of heap memory available( the size varies with machines).

- Aman Mathur August 17, 2013 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 2 votes

i think it depends not only on the memory available but the available memory should be contiguous too

- dt August 17, 2013 | Flag
Comment hidden because of low score. Click to expand.
0
of 2 vote

calloc-64k
malloc-128k

- viva August 20, 2013 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

on unix/linux, "man ulimit" and search for the flag controlling heapsize (i think -d ? along with data segment )

i.e., the answer is that it is very much configurable (there are hard and soft limits, but that's just a detail)

- bigphatkdawg September 19, 2013 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

It depends on OS. For 64-bit systems it is technically possible, on some machines/OS, to have a very large heap memory until your program thrashes, i.e., start paging since you have exceeded the RAM limit.
So theoretically I would say as large as you wish, but no point going (much) above RAM since everything will get slow.

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

1) It depends on the resource limits of the user.
2) It also depends on the availability of address space.

- Anonymous November 30, 2013 | Flag Reply
Comment hidden because of low score. Click to expand.
-1
of 1 vote

getrlimit?

- Will August 18, 2013 | Flag Reply
Comment hidden because of low score. Click to expand.
-1
of 1 vote

Psst. Come closer.

How much do you want it to?

- Anonymous September 16, 2013 | Flag Reply
Comment hidden because of low score. Click to expand.
-1
of 1 vote

since malloc , calloc return pointers to the allocated memories, so logically it must be:
<2^16 for 16 bit and
<2^32 for 32 bit for both.

- rajedsmk September 22, 2013 | Flag Reply
Comment hidden because of low score. Click to expand.
-2
of 2 vote

they can allocate maximum memory is equal to range of unsigned integer...

- K August 17, 2013 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 votes

No. That's not true at all.
2^64 = ???????? for heap of every process??????

- bigphatkdawg September 19, 2013 | 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