Microsoft Interview Question


Country: United States




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

he default assignment operator
is not generated by the compiler when one of 1-4 is true.
1) const field
2) field which is a ref
3) field is an object which has a private "="
4) basic classe has private "="

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

to be clear
the class contains 1) const field
or 2) field which is a ref
or 3) field which is an object which has a private "=".

Or 4) basic class has private "="

- marcind November 14, 2011 | Flag
Comment hidden because of low score. Click to expand.
0
of 0 votes

nice

- siva.sai.2020 May 13, 2012 | Flag
Comment hidden because of low score. Click to expand.
2
of 2 vote

A member class has const members.
A member class has reference members.
A member class or its base class has a private assignment operator (operator=).
A base class or member class has no assignment operator (operator=).

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

good consolidation....

- Jaya June 16, 2012 | Flag
Comment hidden because of low score. Click to expand.
0
of 0 votes

good

- Sirius April 28, 2014 | Flag
Comment hidden because of low score. Click to expand.
-1
of 1 vote

when the class has copy consructor and destructor.

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

so you mean we are not allowed to assign objects if the class has a copy constructor and destructor ??

- Anonymous November 14, 2011 | Flag
Comment hidden because of low score. Click to expand.
0
of 0 votes

If you have any data member as const or reference, in that default assignment operator will not be generated as const or references can't be rewritten.

- K2 November 14, 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