Microsoft Interview Report
- 0of 0 votes
AnswersA mail server exposes an interface as mentioned below. When given a day in the calendar a user, it gets the meetings mentioned as slots in calendar with start and end time for each meeting.
- skagrawal10 November 27, 2010
CalendarSlot *GetMeetings(char[] username, unsigned int day);
typedef struct
{
unsigned int StartTime;
unsigned int endTime;
}CalendarSlot
The developer has implemented a mail client function as mentioned below. This function takes in a list of users, internally uses the GetMeetings mail server interface to get the list of meetings for those users. Eventually, it gives out the first 10 free slots, within the next 3 days from the day specified, which is of the mentioned slotDuration. Everyone in the userList have to be free from meetings during these slots returned, without exception.
Assumptions:
1. Meeting start time and end times will align at the beginning of an hour (8:00,9:00etc....)
2. SlotDuration will be in multiple of full hours (1hrs, 2hrs,etc....)
CalendarSlot * GetFreeSlots (char [][] userList, unsigned int day, unsigned int slotDuration)
Write the test cases for testing GetFreeSlots function. NOTE: Assume that GetMeetings function is already well tested.| Report Duplicate | Flag | PURGE
Microsoft Software Engineer / Developer - 0of 0 votes
AnswerYou are developing a component that requries parsing a lot of XML tags. You have abstracted the responsibility of finding the handler to a class named XMLElement Dictionary. Your will be invoking GetHandlerTag method of this class to find the corresponding handler method for a given element name (code snippet is shown below).
- skagrawal10 November 27, 2010
Typedef HRESULT(*PFNElementHandler)(IXMLAttribute* pAttributes, unsigned_int32nAttributes);
PFNElementHandler pfnElementHandler =( PFNElementHandler)
xmlElementDictionary.GetHandlerTag(elementName);
if(NULL!=pfnElementHandler)
{
(*pfnElementHandler)(pAttributes, nAttributes);
}
1. Define a datastructure that you will use inside this class to store the XML tags that you can use in your lookup logic for the fastest possible lookup on a given hardware. Call out your assumptions.
2. Implement the GetHandlerTag method.| Report Duplicate | Flag | PURGE
Microsoft Software Engineer / Developer - 0of 0 votes
AnswersIf you were asked to design an efficient elevator system for a 100-storey building, enumerate the list of questions you would ask that you feel would be important to get answered before you start your design.
- skagrawal10 November 27, 2010| Report Duplicate | Flag | PURGE
Microsoft Software Engineer / Developer