Message on Whatsapp 8879355057 for DSA(OA + Interview) + Fullstack Dev Training + 1-1 Personalized Mentoring to get 10+LPA Job
0 like 0 dislike
523 views
in Interview-Experiences by Expert (30,360 points) | 523 views

1 Answer

0 like 0 dislike

Microsoft | SDE2 | Seattle 

 

Interview Process.

Phone Screen:

Implement a Queue without using STL, in the most Object Oriented way.

 

Onsite Interviews

 

Round 1:

Given a function, what this function is trying to do, can you find some problem with this function, and how can you improve the performance of this function with whatever it is doing?
void copy(int n, unit8_t *input, unit8_t *output)

{

while(n--)

{

*output++ = *input++;

}

}

 

 

Round 2:

  • What keeps you motivated, Why you want to join Microsoft, How you like working in your current company, Explain an interesting problem that you solved recently.
  • Most beautiful Interview Question I have ever come across
    You are given an abstract machine that has a timer, which can be visualized as a 1 dimensional timeline gradually increasing. This machine has an abstract OS running on it, which can perform only 3 operations:
    1. CreateTask(time, task()) - Schedules a task() by setting a timer for a given time from current time (i.e relative to current time), and when the expected time is reached it triggers the task(). The OS is constrained in a way that it can schedule only 1 task() by using CreateTask. Until the scheduled task() is executed or explicitly canceled using EndTask, no other CreateTask will execute.
  • More explanation:
    Analogy of CreateTask function can be explained with an Alarm clock. Suppose you have a hypothetical Victorian Alarm Clock that can schedule only one alarm (by spinning a spring). You set the alarm time based on the input relative to current time, which means if now time is 10:00pm and you are asked to set an alarm 8 hrs from now, then your alarm should ring at 6:00am.
    1. ElapseTask() - this function returns the time elapsed since the last CreateTask was called. If the task which was scheduled by the CreateTask has already been executed, then ElapseTask will only return 0.
  • More Explanation:
    Taking the alarm clock analogy here, if an alarm clock was set at 10:00pm for 8hrs from that time, then calling ElapseTask at 12:00am will return 2, calling ElapseTask at 5:00am will return 7, but calling ElapseTask anytime after 6:00am will return 0.
    1. EndTask() - Cancels any scheduled task previously set by a CreateTask.
  • Problem statement: You have to use these 3 OS calls and design an API or a set of APIs that can schedule multiple tasks.

 

Round 3:

  • Given a NxM 2D grid. In some cells there are blockers (which no one can access), there are some cells which contain guard(G), and the rest of the cells are just empty. Now you need to find out what is the minimum Manhattan distance of each empty cell from the guard cells. In case of conflict, choose the distance which is minimum. https://leetcode.com/problems/01-matrix.

 

 

Round 4: [Non-technical]

  • Just a casual interview with the manager. I felt like I was driving the conversation for the most part, I was asking a lot of questions and very few questions were asked to me. As I retrospect now, I guess this was the part that I should have really convinced my interviewer that I'm the right person for this role. Overall, the interview went cold. Nothing was coming out of him.

**SELECTED.

by Expert (30,360 points)