Question d’entretien chez Amazon

Design a Parking Garage

Réponses aux questions d'entretien

Utilisateur anonyme

15 mai 2014

Wasn't honestly expecting an OO Design question this early in the interview process, but it is what it is.

Utilisateur anonyme

15 juin 2014

Just a small part of an example: @interface Garage : NSObject @property (strong, nonatomic, readonly) NSArray *employees; @property (strong, nonatomic, readonly) NSArray *clients; - (void)addEmployee:(Employee *)employee; - (void)removeEmployee:(Employee *)employee; - (void)insertClient:(Client *)client; - (void)removeClient:(Client *)client; @end --- @interface Employee : Person @property (atomic, readonly, getter = isFree) free; - (void)extractVehicle:(Vehicle *)vehicle fromGarage:(Garage *)garage; - (void)parkVehicle:(Vehicle *)vehicle inGarage:(Garage *)garage; @end — @interface Client : Person @proprty (strong, nonatomic, readonly) Vehicle *vehicle; - (instancetype)initWithName:(NSString *)name surname:(NSString *)surname vehicle:(Vehicle *)vehicle; @end --- @interface Person : NSObject @property (copy, nonatomic, readonly) NSString *name; @property (copy, nonatomic, readonly) NSString *surname; ... @end — @interface Vehicle : NSObject etc. @end