Adobe Interview Question for Testing / Quality Assurances


Country: United States
Interview Type: Phone Interview




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

Segmentation fault

*chptr=*intptr
no memory allocated to "chptr"

- Chaitanya February 01, 2012 | Flag Reply
Comment hidden because of low score. Click to expand.
1
of 1 vote

Undefined, really. chptr is not initialized, but we assign a value to it, so the program may or may not crash. If it doesn't crash, it'll print "4 4" on a 32 bit machine.

- A January 29, 2012 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 votes

I tried on 64bit linux, if you only print the sizeof() 2pointer, the program runs with no error and print 8,8. But if you try to print the *chptr, since its not initialized, program crash down with segmentation fault.

- amor89813 March 27, 2014 | Flag
Comment hidden because of low score. Click to expand.
0
of 0 vote

In dev compiler, this program is crashing.
However on commenting the *chptr = *inptr line, I get 4 4 as the answer as the pointer variables are storing addresses, which are stored as int type.

- ghantacoder January 29, 2012 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 votes

As they are pointer, 4 4 will be the output if we comment out hat part!

- Psycho September 26, 2012 | Flag
Comment hidden because of low score. Click to expand.
0
of 2 vote

pointers have size equivalent to integer size on the machine, no matter what they point at, because they store an address and that is an integral value. So answer is sizeof(int) sizeof(int). 4 4 or 2 2.

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

The size of pointers is machine/architecture dependent.
x86 has 4byte pointers, amd64 has 8 byte pointers

- Srikant Aggarwal February 07, 2012 | Flag Reply
Comment hidden because of low score. Click to expand.
-2
of 2 vote

sizeof(int *) 4 or 8
sizeof(char *) 1

- anonymous January 29, 2012 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 votes

No. Pointers record address. They have the same size, no matter what type of pointers they are. So, sizeof(char *) is also 4 byte.

- Anonymous January 29, 2012 | Flag
Comment hidden because of low score. Click to expand.
0
of 0 votes

Pointer stores the address of the data type, address is an integer so answer is 4 4 ( there was no option with 2 2).

- Hmmm January 29, 2012 | Flag
Comment hidden because of low score. Click to expand.
0
of 0 votes

The size of pointers is machine/architecture dependent.
x86 has 4byte pointers, amd64 has 8 byte pointers

- Srikant Aggarwal January 29, 2012 | 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