skagrawal10
BAN USER- 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| 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
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
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
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
you can simply find out by putting the arbitrary small values of n & k. Suppose you take 2 & 2. You will find only 2 option gives the cirrect answer
- skagrawal10 November 21, 2010// open file descriptors
for(i=0; i<nl i++)
fd[i] = open(file[i]);
print(fd);
void print(int fd[100])
{
1.print all file pointers and restrore in previous position except last
2.if any of them becomes null just increment previous one
3. call finction again
if(fd[0] == EOF) exit(0);
This problem can be easily solved with the help of recursion.
- skagrawal10 November 21, 2010node* nReverse
node* reverse(node* root)
{
if(root->next == NULL)
{
nReverse = root;
return nreverse;
}
temp = reverse(root->next);
temp->next = root;
return root;
}