EFI Interview Question for Software Engineer / Developers






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

It should give you NULL reference....

- Anonymous May 23, 2011 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 votes

I don't think that it's normally gonna return the null reference....rather its gonna return the address of the memory location containing the string which is now free for the compiler to take up again as it came of out the function.

- Pankaj Nayak May 23, 2011 | Flag
Comment hidden because of low score. Click to expand.
0
of 0 vote

Its called dangling Pointer

- Anonymous May 23, 2011 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 votes

You are correct.
Here is the explanation of dangling pointer on wiki.

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

there is nothing wrong with the function....dynamic memory will not be deleted until the programmer explicitly deletes it...hence even if the function scope is over the pointer will point to the same memory

- Anonymous May 23, 2011 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 votes

I can't post the link to wiki....
But anyway,
I did some experiments.
You are right.
The programs can return the address correctly.
But dangling pointer could cause some security problems...
You should also say that in interviews... I think

- wfchiang May 23, 2011 | Flag
Comment hidden because of low score. Click to expand.
0
of 0 votes

There is no where memory allocated dynamically in above code snippet.

- Anonymous November 03, 2011 | 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