Adobe Interview Question for Software Engineer / Developers


Team: c++
Country: India
Interview Type: In-Person




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

One the structure definition is there. But no component is there. So it behaves as an empty class. So size of an empty class is always 1.

- Psycho August 29, 2012 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 2 vote

in class there in just one data definition and there is no data value.
so it will give default size is 1.

- jnumca.abhishek August 27, 2012 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

1,basically the class is behaving like empty class,as structure inside class is just declared not defined.if we do bit modification like Struct node { }Node; then object size will become 8 as now it will consider the structure.

- samrat August 28, 2012 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

According to the lexical scope rule outer class will not have access to inner class methods, but the inner class will have static links to the most nearest enclosed scope. Class node is just a definition in the outer class namespace.

Empty classes are always of size 1.

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

0

- Avenger August 26, 2012 | Flag Reply
Comment hidden because of low score. Click to expand.
Comment hidden because of low score. Click to expand.
0
of 0 votes

@Avenger default size for class with no body shold be always 1 .

plz try to compile & execute it ?

- pramod August 26, 2012 | Flag
Comment hidden because of low score. Click to expand.
0
of 0 votes

answer is one - 1

- pramod August 26, 2012 | Flag
Comment hidden because of low score. Click to expand.
-2
of 2 vote

Hi,,,,

This program will give output 1;

Why?? Because the class object c has no access to the structure and thus no memory is allocated for the structures entity and the default size of class is 1.
If we declare the object of structure then it will show output as 4, even if we again leave the constructor blank. Compile and run to check it out.

- Anonymous August 27, 2012 | Flag Reply
Comment hidden because of low score. Click to expand.


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