Binghamton University

  www.binghamton.edu
Work in HR? Unlock Free Profile

Binghamton University Software Engineer Interview Question

I interviewed in Vestal, NY and was asked:
"Given two classes: class B { public: B(args_1); B(args_2); // and many constructors with different arg lists }; class D : public B { public: D(args_1) : B(args_1) {} D(args_2) : B(args_2) {} // and many constructors with different signatures similarly implemented // some additional stuff specific to D }; Assume that the arg list for B's constructors are quite long and may be revised pretty often in the future, in which case D's constructors have to be recoded correspondingly. Duplicating the update by copy-and-paste will certainly work here. Can you propose a better way so that the update can be done in one place without copy-and-paste duplication?"
Add Tags [?]
Answer

Part of a Software Engineer Interview Review - one of 15 Binghamton University Interview Reviews

To comment on this question, Sign In with Facebook or Sign Up

Tags are like keywords that help categorize interview questions that have something in common.