Interactive Brokers Interview Question






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

a) It is safe, because nothing will be changed in the object structure. The libraries will not be aware that new constructor is available.
b) This will change the structure of the object. So, it will be problem if the size of this class used anywhere in the library. Or if the member added before any other member.
c) If the previous version of the class was not polymorphic, this will change the structure (vptr), so it is not safe, otherwise you will decrease the number of possible bugs in libraries :)
d) It is safe if this argument appended at the end of the argument list.

- fiddler.g July 31, 2010 | Flag Reply
Comment hidden because of low score. Click to expand.
1
of 1 vote

b,c

- Anonymous September 23, 2010 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 votes

I believe this is right.
Cases b) and c) change the size of the class, other cases do not.

- sergey.a.kabanov January 13, 2012 | Flag
Comment hidden because of low score. Click to expand.
1
of 1 vote

there can be a case where it may be necessary to recompile the libraries even in the case of adding a constructor i.e option a. That will happen when initially there was no constructor in the class but later a constructor with an argument is added. Then any code that was creating an object using the default constructor will no longer be able to do so. Therefore, we would need to recompile the libraries.

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

This is right answer

- siva.sai.2020 May 12, 2012 | Flag
Comment hidden because of low score. Click to expand.
0
of 0 votes

No, because you can simply add the default (no argument) constructor back to the class and it'll be fine.

- Shubham May 11, 2019 | Flag
Comment hidden because of low score. Click to expand.
0
of 0 vote

only b

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

d, c

- raja August 08, 2011 | 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