Morgan Stanley Interview Question
Country: India
struct tickets{
int gold;
int solver;
int normal;
};
struct movie{
char starcast[100];
int duration;
struct tickets *barfiT;
};
struct theater{
struct movie *barfi;
struct movie *humtum;
};
struct city{
struct theater *theater1;
struct theater *theater2;
};
struct state{
struct city *rohini;
struct city *dwarka;
};
struct country{
struct state *delhi;
struct state *mp;
};
struct countries {
struct country *india;
struct country *china;
};
1. DataStructure similar to ConcurrentHashMap with n number of blocks, can be used to represent available seats, so that N users can concurrently book the ticket.
- Anonymous September 01, 20152. Given X is the number of seats an user want to book, and YZ is the range of rows preferred, the system should try to book the seats in continuous order in same row, if not possible in any of the rows in the given range, it should try to maximize the number of seats in the row and minimize the span across the rows.