Adobe Interview Question for Software Engineer / Developers






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

In another way,print an automatic variable's address and then call another function and then print address of another newly declared local variable in that function.If the address is increasing,the stack is growin upwards otherwise downwards

- Topcoder March 23, 2011 | Flag Reply
Comment hidden because of low score. Click to expand.
1
of 1 vote

#include<stdio.h>

void f(){
int k =1;
printf("%x ",&k)
}


void fun(){
f();
}

int main(){
int i=1;
printf("%x ",&i);
fun();
}

//*** result

fff4 ffea

that means stack is decreasing.

- kaustubh deshmukh September 16, 2012 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 2 vote

write a simple code having more than 1 automatic variables and print their addresses. If assigned addresses are decreasing, then stack is growing downward, otherwise upward.

#include <stdio.h>

int main()
{
int a=1;
int b=2;
int c=3;
printf("%x %x %x\n", &a, &b, &c);
return 0;
}

- mishrar February 14, 2011 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 votes

To be clear, it doesn't indicate anything as all the three varables are in the same stack frame.
For e.g, if you have "int arr[10]", then &arr[1] will always be greater than &arr[0].

You do have to make a function call for new stack frame to be created, as suggested by 'Topcoder'.

- -- January 31, 2012 | Flag
Comment hidden because of low score. Click to expand.
0
of 0 vote

void func(int *p)
{
int i;
if (!p)
func(&i);
else if (p < &i)
printf("Stack grows upward\n");
else
printf("Stack grows downward\n");
}

func(NULL);

- Anonymous July 10, 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