My background: I am a recent graduate looking for job in software industry. Question: I was in recent interview with one of the software companies and was asked to draw UML diagram for a bank system which shows 2 accounts e.g. saving and checking and they have different way of calculating interest.
My Solution: I made an Account class an abstract class.
Like this: public abstract class Account{ ...... }
This class have 2 methods defined in it deposit() and withdraw() which is common to any account type.
another method CalculateInterest() which is abstract method.
2 classes saving and checking which extends account class and implement Account class. e.g: public class Saving extends Account { ... }
I added other class to top off UML like Bank and bank location but this did not satisfied interviewer and he wanted me to implement whole process as INTERFACES which i quite did not understood very well. I tried extracting same information but it did not pleased interviewer.
Any information that people out here can share will help me a lot in understanding design and further how to approach interviews.
I know their are lot of design patterns which are out there but when he mentioned about specific interfaces I was not sure how to approach that.