Microsoft Interview Question
InternsTeam: Microsoft Ireland intern recruitment team
Country: Ireland
Interview Type: Written Test
building class with properties like Street address, # of total properties in the building, parking space, No. of parking places available to rent, etc..Child classes derived from building classes like Apartment, Store, Office, etc.. Each one having Suite no, monthly maintenance cost and a constructor which checks with total # of properties available in apartment before creating instance of property. Apartment class has properties like # of bedrooms. When each time constructor is called to reserve a new property in the building,
1. I would use an abstract class for SPACE and then specialize it to concrete classes APARTMENT, STORE, OFFICE and what not.
- Epic_coder June 19, 20132. FLOOR will be another class that will be composed of collection of SPACE objects.
3. BUILDING will also be a class and will be composed of collection of FLOOR objects.
In order to properly identify properties and methods I need to know what is the purpose of this design? What functionality are we intending to provide?