Amazon Interview Question
Software Engineer / Developersit looks good other than TrainTicket class should be like
public class TrainTicket {
private int ID;
private TicketDetails ticketDetails;
private Double fare;
private Passenger passenger;
private SeatDetail seatDetail;
}
and there should be one more class
public class Passenger {
private String Name;
private int id;
private int age;
private static final enum { Male, Female } gender;
}
Other classes/methods can be added to further enhance the design. Please share your thoughts, comments and suggestions. Thank you.
- Anonymous April 07, 2011