Bloomberg LP Interview Question for Software Engineer / Developers






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

While defining copy constr & assigment constr, we need to take care
- Argument must be passed by reference
- properly copy pointers (deep copy)

- Gorav Singal November 03, 2009 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

a. deep copy or shallow copy?
b. check for self assignment or not

- Anonymous October 25, 2009 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 votes

deep copy or shallow copy?
...can u explain it a bit more..

- kanap008 October 26, 2009 | Flag
Comment hidden because of low score. Click to expand.
0
of 0 vote

While defining copy constr & assigment constr, we need to take care
- Argument must be passed by reference
- properly copy pointers (deep copy)

- Gorav Singal November 03, 2009 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

For copy constructor, it has no need to check if it is itself;no return of reference to itself;no need to clean up itself
For copy assignment, it needs to check whether it is itself; return; clean up
Common: deep or shallow? const Reference argument

- sampsun December 03, 2009 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

What about getting an exception in assignment operator

- yogi December 29, 2009 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 votes

you are right

copy assignment fails, you might get a partial assignment object

- Anonymous March 20, 2010 | Flag
Comment hidden because of low score. Click to expand.
0
of 0 vote

int test() {
return 7;
}

int test() {
return 7;
}

- test February 16, 2010 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

I addition:
1. assure the source objects are not modified - take const references
2. make copy/assignment of the base objects properly

- Anonymous June 06, 2010 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

1. Deep copy/shallow copy issues in both.
2. Guard against self assignment in the assignment operator.
3. strong exception safety in the assignment operator. (acquire new resources before deleting old)
4. Call base class's assignment operator if needed.

- sam July 04, 2010 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

Also in Assignment operator we need to delete target memory before assigning any new memory

- Ajay October 14, 2010 | 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