CrimsonLogic Interview Question for Dev Leads Dev Leads
- 0of 0 votes
Given an abstract class A having a function sumBill(int a, int b). Now assume that you have 3 or 4 class extending class A and implementing their version of sumBill. And in various locations in the code you are making calls to sumBill with integer parameters.- blaks November 19, 2014 in India
Later on it is identified that the parameters need to be of type double rather than int. So now one has to go refactor all the places which make a call to sumBill to pass parameters of double data type.
So the question is what could the developer had done better to avoid such a problem in the first place.
Its a design pattern question.
| Report Duplicate | Flag | PURGE
CrimsonLogic Dev Lead Dev Lead Object Oriented Design
Interview Type: In-Person
Open Chat in New Window