Adobe Interview Question for SDE-2s


Country: India




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

A possible reason for the issue - Your code crashes at the return statement, it might be the case that your function is overriding the return address in its call stack that happens if you try to provide the local variable with data larger than its buffer size.

- fReaK November 26, 2013 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 votes

Or go out of bounds accessing a locally declared array

- abhi_284 January 26, 2014 | Flag
Comment hidden because of low score. Click to expand.
0
of 0 vote

The first time you see h() is returning some value, note it's value, comment out the calling of h() and then use that hardcoded value in g(). This will let you work past the calling of h().

Separately, you can write a test case to debug h() alone to find out the cause of the crash.

- Murali Mohan November 26, 2013 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 votes

h has no return type. It's void.

- Adobe December 19, 2013 | Flag
Comment hidden because of low score. Click to expand.
0
of 0 vote

If the type of crash is detailed, it could shed a little more light on this problem. But the way i look at it, something within h() messed with the call-stack of g() because essentially the return from a void method is a pop from the call-stack. So i would look at what is the dependency between h() and g(), for instance, are there any pointers being passed, etc.

- pugachevsoul November 26, 2013 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

The return statement in h() call crash in the way g() calls h(). If it uses a pointer to call h and by mistaken return points to deleted address then program will crash. So it does not matter if h() is void then also error is resulted.

- Sandeep Mittal January 21, 2014 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

Maybe g is storing the variable into a variable ... making it give an error cuz you cant store the void returned by h into an int or char or other types.

This would not give a syntax error.

- AJK November 02, 2014 | Flag Reply
Comment hidden because of low score. Click to expand.
Comment hidden because of low score. Click to expand.
-2
of 2 votes

So true. What is going on R.V.reddy?

- Anonymous November 25, 2013 | Flag
Comment hidden because of low score. Click to expand.
-2
of 2 votes

More like 5 days.

- Clifford November 26, 2013 | Flag
Comment hidden because of low score. Click to expand.
0
of 0 votes

The questions are genuine .So i dont think that there should be any problem to you .

- Rahul Sharma November 26, 2013 | Flag
Comment hidden because of low score. Click to expand.
0
of 0 votes

you had interviewers with all these companies all back to back days ?

- Anonymous November 27, 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