Upload Button Icon Add office photos

Microsoft Corporation

Compare button icon Compare button icon Compare

Proud winner of ABECA 2024 - AmbitionBox Employee Choice Awards

zig zag pattern zig zag pattern

Filter interviews by

Microsoft Corporation Interview Questions, Process, and Tips

Updated 8 Mar 2025

Top Microsoft Corporation Interview Questions and Answers

View all 735 questions

Microsoft Corporation Interview Experiences

Popular Designations

557 interviews found

Software Developer Interview Questions & Answers

user image Akshay Utture

posted on 24 Aug 2015

I applied via Campus Placement

Interview Preparation Tips

Round: Test
Experience: Easy
Tips: Read data strucuctures and Alogorithms
Duration: 30 minutes
Total Questions: 15

Round: Group Discussion
Experience: Good.
Tips: Think of design
Duration: 60 minutes

Round: Technical Interview
Experience: Good
Tips: Read data structures and algorithms

General Tips: Learn Data structures and Algorithms welll.
Skill Tips: Know Data structures and Algorithms
Skills: Data structures and Algorithms, General coding and problem solving
Duration: 2
College Name: IIT Madras

Top Microsoft Corporation Software Developer Interview Questions and Answers

Q1. Buses Origin Problem Statement You have been provided with an array where each element specifies the number of buses that can be boarded at each respective bus stop. Buses will only stop at locations that are multiples of the bus stop they ... read more
View answer (3)

Software Developer Interview Questions asked at other Companies

Q1. Maximum Subarray Sum Problem Statement Given an array of integers, determine the maximum possible sum of any contiguous subarray within the array. Example: Input: array = [34, -50, 42, 14, -5, 86] Output: 137 Explanation: The maximum sum is... read more
View answer (42)

Interview Questions & Answers

user image Shiva Krishna M

posted on 24 Aug 2015

I applied via Campus Placement

Interview Questionnaire 

6 Questions

  • Q1. What is linear regression ? How do you find the estimates of the coefficient vector.
  • Ans. 

    Linear regression is a statistical method to model the relationship between a dependent variable and one or more independent variables.

    • It assumes a linear relationship between the variables.

    • The goal is to find the best-fit line that minimizes the sum of squared errors.

    • The estimates of the coefficient vector are found using the method of least squares.

    • The coefficient vector represents the slope and intercept of the line...

  • Answered by AI
  • Q2. He drew a distribution of data points into two classes. Construct a decision tree for the distribution. Write pseudo code for the same.
  • Q3. Discussed about my past internship which was also in ML
  • Q4. Consider the Uber cabs company. There are many factors that determine the availability of the drivers and the demand of the users. Model this scenario from an ML perspective and optimize the demand and ava...
  • Q5. A simple probability question involving likelihood estimate.
  • Q6. What are the problems of over-fitting ? How do we remove it ?

Interview Preparation Tips

Round: Test
Experience: The first round was in multiple choice format. Most of the questions were from I/O in C , C++ and Java. There were few questions on operating systems and other topics in CS. Most of them were easy and the only factor is time. You have exactly 30 mins to solve 15 MCQs.
Tips: Be prepared in C , C++ and Java. If you are new to any of these languages , at least have a look at the basic input output functions.
In my class they basically selected everybody to the coding round. However it is always good to write as best as you can since they look at cumulative score at the end.
Duration: 30 minutes
Total Questions: 15

Round: Test
Experience: There was a coding round for the selected students. In my class everyone was selected to this round.There were 2 questions :

1 ) Given a Binary tree find sum of data at all the boundary nodes. A boundary node was defined , which basically evaluates to any node on the left most path , right most path and the leaves.

2) Given 2 numbers in a linked list form i.e each digit of a number in a node of the linked list , return the linked list that is the difference of the two input linked lists.
Tips: Coding is only perfected by practice. Have a good understanding of Data structures and common algorithmic paradigms including DP , Divide and Conquer, greedy etc.
Duration: 60 minutes
Total Questions: 2

Round: Group Discussion
Experience: Here's the deal : The group of students selected are seated in a big room. A problem statement is put up as a power point slide ,and you are expected to come up with appropriate data structures and algorithms to solve the problem. There are mentors who assist you ( if needed ). You have to explain your approach and write a (psuedo) code for your idea.

In my case the problem statement was as follows :
"Consider a game as follows : There is a 4X4 size game board. On each slot in the board a dice is placed. The dice has a character ( a ,b ,c .. ) printed on it. There is a character on every side of the dice. Now find all the words that can be made (in the wordament game style ) by the characters on the top face of the 16 dices. Now also write a shuffle function that shuffles the board.
Tips: It was an easy backtracking question. If you can improve your data structure , it would fetch you extra points.
Duration: 60 minutes

Round: Technical Interview
Experience: Basically I applied for a machine learning profile. So all the technical questions were from basics of ML. If you have good basics in ML , the interview is very easy. I was doing ML this semester only. So he might have limited with basics :P
Tips: Tell your mentor if you are not aware of a particular approach to ML classification( or regression) . He ll teach you the basics(literally :P ) and then ask questions.

Round: Technical Interview
Experience: It is okay if you don't come up with great model. I only knew about Linear Regression and modeled it accordingly.
I took --- > Y = ( Demand/Availability) as my output variable and identified a few input parameters. He was satisfied with that :P

In the third question he elaborated a little more on Bias and variance.
Tips: Basic ML is more than enough.

General Tips: Be confident. Dress properly for interviews. If you get the internship more than happy. If not : remember this " Success is going from failure to failure WITHOUT losing enthusiasm"
Skills: Algorithms , Data Structures, Machine Learning, C, C++, Java
Duration: 2
College Name: IIT Madras
Motivation: My long term goal is to be a data scientist. So an ML profile at Microsoft was the best thing I could get now :P

Skills evaluated in this interview

Interview Questions & Answers

user image

posted on 15 Nov 2015

Interview Preparation Tips

Round: Test
Experience: (1)  Give the output of the following program
         int main
     {
              char ch[]={‘1’,’2’,’3’,’4’,’5’};
              char *p = (char *)(&ch+1);
             char *q = &ch+1;
            printf(“%d     %c    %c”,sizeof(ch),*(p­1),*q);
        }
(2)
 int main
{
double i=2.0,j=1.0,sum=0.0;
   while(i/j>0.001)
   {
       j=j+j;
       sum=sum+(i/j);
       printf("%f\n",sum);
   }
}
The question here is : For how many steps this while loop will run and what would be the best 
approximate value of the sum after the loop ends .
(3)    TOC question 
Given a grammar 
s­>AB
A­> a | BaB
B­>bbA
Which of the following statement is false ?
a. Every string  will be of even length .
b. Every string  will not have three consecutive a’s .
c. Every string will not have four consecutive b’s . 
d.   Every string will have at least as many a’s as there are b’s 
(4)   You are given a disk  where ‘1’ represents a occupancy of a sector and ‘0’ represents 
vacancy of a sector  ....given a hexadecimal string DFE00454AB which represents the various 
sectors ... find the nearest percentage of occupied sectors ?
(5)  Find the output 
int arr[2][3]={{1,2,3},{4,5,6}};
int (*ptr)[3]=&a[0];
printf("(%d,%d)",(*ptr)[1],(*ptr)[2]);
ptr+=1;
printf("(%d,%d)",(*ptr)[1],(*ptr)[2]);
Will this program compile properly or will end in segmentation fault ??
(6) 
double full(double a)
{
    return (int)(a+0.5);
}
does this always work??
(7) int x=123,y=231;
    int t=0;
    int l;
    l=x^y;
    while(l)
    {
        t++;
        l&=l­1;
    }
    printf("%d",t);
(8) char str[80];
      strcpy(str,"junk");
      scanf("%[^india]",str);
      printf("%s",str);
          What will be the output of this code snippet if the given input is “Gujarat”?
  (9) Given a inorder traversal eg 1 2 3 4 5 6 7 8 9 , Check which of the following pre order 
traversal will it return .
a. 1 6 3 2 7 8 4 9
b. 6 7 3 8 1 9 2 7
c, 2 4 6 8 1 3 5 7 
d. 1 3 5 7 2 4 6 8 
(10)     main()
{
int j=12,i=15;
i*=j­2 ;
j&=j­1;
printf(“%d %d”,i,j);

          Write the output.

Round: ALGORITHM AND DATA STRUCTURE DESIGN
Experience: 1- Find gcd of 2 numbers U & V in O(log UV)^2 .
2.   Test cases for finger print reader say in a laptop to login . Here you can swipe your finger to 
have a secured login . 
     eg . I will swipe my finger and the system will allow me to login  .
3. Design question......for billing , u have barcode, barcode number,item price, taxes, discounts 
for items (some criteria were given and u have to  design an also for calculating discount) and 
then finally compute Net price .
State advantages and disadvantages of any alternative solutions..... 
Calculating discount :
a.) If you buy X quantity of the item P , then you can buy other item Q for free (X,P,Q are 
specified).
b.)If you buy any item P for price X , then you can buy other item Q for free (X,P,Q are 
specified).
c) If there are multiple discounts available then apply all those.

Skills:
College Name: Anna University Chennai

Interview Preparation Tips

Skill Tips: prepare HR questions
Skills:
College Name: IIIT-Delhi

Top Microsoft Corporation Intern Interview Questions and Answers

Q1. Reverse the order of words in a given sentence(an array of characters)
View answer (1)

Intern Interview Questions asked at other Companies

Q1. Case. There is a housing society “The wasteful society”, you collect all the household garbage and sell it to 5 different businesses. Determine what price you will pay to the society members in Rs/kg, given you want to make a profit of 20% ... read more
View answer (8)

Microsoft Corporation interview questions for popular designations

 Software Engineer

 (65)

 Software Developer

 (62)

 Senior Software Engineer

 (28)

 Software Developer Intern

 (24)

 Intern

 (20)

 Technical Support Engineer

 (14)

 Software Development Engineer

 (11)

 Data Scientist

 (10)

Intern Interview Questions & Answers

user image Himanshi Kohli

posted on 1 Nov 2015

Interview Preparation Tips

Skills:
College Name: NIT Kurukshetra

Top Microsoft Corporation Intern Interview Questions and Answers

Q1. Reverse the order of words in a given sentence(an array of characters)
View answer (1)

Intern Interview Questions asked at other Companies

Q1. Case. There is a housing society “The wasteful society”, you collect all the household garbage and sell it to 5 different businesses. Determine what price you will pay to the society members in Rs/kg, given you want to make a profit of 20% ... read more
View answer (8)

Get interview-ready with Top Microsoft Corporation Interview Questions

Interview Questions & Answers

user image

posted on 15 Nov 2015

Interview Questionnaire 

10 Questions

  • Q1. Remove duplicates in an array
  • Ans. 

    Remove duplicates in an array of strings

    • Create a new empty array

    • Loop through the original array and check if the current element exists in the new array

    • If it doesn't exist, add it to the new array

    • Return the new array

  • Answered by AI
  • Q2. Removing the characters in Fibonacci position in a string and compacting it
  • Ans. 

    Removing characters in Fibonacci position in a string and compacting it

    • Iterate through the string and remove characters at Fibonacci positions

    • Compact the string by removing the spaces or special characters

    • Return the final compacted string as the result

  • Answered by AI
  • Q3. Finding closest parent in a binary tree
  • Ans. 

    Finding the closest parent in a binary tree

    • Traverse the tree from root to the given node and store the path in an array

    • Traverse the tree again from root to the other given node and check if any node in the path array is common

    • The last common node in the path array is the closest parent

    • If one of the given nodes is the parent of the other, return the parent node

  • Answered by AI
  • Q4. Given a list of methods in java, some are unsafe. U r provided wit a method ‘is Unverifiable’ tat  takes a method and returns true or false based on whether the method passed is safe or  unsafe. Write a co...
  • Q5. Placing Rooks in a chess board
  • Ans. 

    Placing Rooks on a chessboard without attacking each other.

    • A rook can move horizontally or vertically any number of squares.

    • Place one rook in each row and column to avoid attacking each other.

    • The maximum number of rooks that can be placed on an n x n chessboard is n.

    • The problem can be solved using backtracking algorithm.

  • Answered by AI
  • Q6. How malloc and free are implemented , how os deals wit them, etc
  • Ans. 

    malloc and free are functions used for dynamic memory allocation in C. The operating system manages memory allocation and deallocation.

    • malloc is used to allocate memory dynamically, while free is used to deallocate memory.

    • malloc allocates a block of memory of the specified size and returns a pointer to the beginning of the block.

    • free releases the previously allocated memory block, making it available for reuse.

    • The oper...

  • Answered by AI
  • Q7. Some basic ques in OS
  • Q8. When u compile and run a high level lang prog, what happens in the computer.( Explain  everything from lexical analysis, syntactic, ICG,code optimization, code gen, then paging,  caching, pipelining , inte...
  • Ans. 

    When a high-level language program is compiled and run, it goes through lexical analysis, syntactic analysis, intermediate code generation, code optimization, code generation, paging, caching, pipelining, interrupts, polling, instruction sets, and ALU operations.

    • Lexical analysis: Converts source code into tokens.

    • Syntactic analysis: Checks the grammar and structure of the program.

    • Intermediate code generation: Translates...

  • Answered by AI
  • Q9. What will happen to d level of water when u drop a suitcase from a boat
  • Q10. Check for duplicates in an unsorted array in O(n) without using any extra space

Interview Preparation Tips

Skills:
College Name: Anna University Chennai

Skills evaluated in this interview

Software Engineer Interview Questions & Answers

user image Mohd Azharuddin

posted on 15 Nov 2015

I applied via Campus Placement

Interview Questionnaire 

2 Questions

  • Q1. You have a Binary tree having numbers>=0 and a numeber N. Print all downwards paths from any node having the sum of elements equal to N
  • Ans. 

    Print all downward paths from any node in a binary tree with sum of elements equal to N.

    • Traverse the binary tree and keep track of the sum of elements in the path from root to current node.

    • If the sum equals N, print the path from root to current node.

    • Recursively traverse the left and right subtrees with updated sum.

    • Use a stack to keep track of the current path being traversed.

    • Example: Binary tree with root 1, left chil...

  • Answered by AI
  • Q2. You have a cuboid (m*n*p) each block of the cuboid is having a metallic ball. Now we are passing X-ray from front face and getting a bool matrix1 of m*p the elements are set if there is a black spot.(as...
  • Ans. 

    Yes, it is possible to get the accurate result from the given data.

    • The coordinates (i,j,k) where metallic balls are present can be determined by finding the set elements in both matrix1 and matrix2.

    • Additional data is not required as the given data is sufficient to determine the coordinates.

    • The coordinates can be obtained by iterating through the elements of matrix1 and matrix2 and checking for set elements.

  • Answered by AI

Interview Preparation Tips

Round: Test
Experience: Output questions
Tips: focus on basics
Duration: 30 minutes
Total Questions: 15

Round: Test
Experience: Two coding problems in one hour,on Cocobues.com

1. Given two arrays of numbers. The numbers are from 0-9 you have two maximize the first array by using the elements from the second array.
the elements can be used only once.
e.g. arr1[]={5,2,3,6,7};
arr2[]={9,2,8,4,5};
You should output the modified arr1 as {9,8,5,6,7}

2.Given a matrix of characters and a word.
you have to count the number of occurences of that word in that matrix. you can move to any of the eight valid directions from current position.
e.g. word="HELLO";
matrix[][5]={ {'H','E','L','L','O'},
{'E','H','E','A','B'},
{'L','L','O','C','D'}};
output should be : 5

Tips: DO AS MUCH AS PRACTICE
Duration: 60 minutes
Total Questions: 2

Round: Test
Experience: One Coding question was given to all the students ,You have to code and explain it.
You are given an string as input which represents a path. You have to normalize that path inplace(NO EXTRA SPACE).
e.g.
input : "\a\b\c\..\..\file.txt"
output: "\a\file.txt"
Hint: Double dot(..) means you have to skip the previous parent.
It was on paper.
Duration: 40 minutes
Total Questions: 1

Round: Technical Interview
Experience: The interviewer was very nice that was an amazing experience.
Tips: Be confident and relaxed.

Round: HR Interview
Experience: Again the interviewer was very nice. Firstly he asked me what i have done in technical till that time.
After the interview was over he looks impressed.
Tips: Don't see what others are doing . Take your time and try to short out the correct solution.

General Tips: Do coding as much as you can
Skills: Algorithm, Coding Skills And Knowledge On Data Structures
Duration: 2
College Name: NIT Bhopal
Motivation: It comes to our institute, and the name Microsoft is sufficient for motivation.
Funny Moments: The journey to Microsoft IDC Hydrabad was very beautiful.

Skills evaluated in this interview

Top Microsoft Corporation Software Engineer Interview Questions and Answers

Q1. You have a cuboid (m*n*p) each block of the cuboid is having a metallic ball. Now we are passing X-ray from front face and getting a bool matrix1 of m*p the elements are set if there is a black spot.(as we are passing X-ray) and another mat... read more
View answer (1)

Software Engineer Interview Questions asked at other Companies

Q1. Bridge and torch problem : Four people come to a river in the night. There is a narrow bridge, but it can only hold two people at a time. They have one torch and, because it's night, the torch has to be used when crossing the bridge. Person... read more
View answer (205)

Interview Questions & Answers

user image

posted on 15 Nov 2015

Interview Questionnaire 

7 Questions

  • Q1. Write a function that returns the result of merging two sorted linked lists . And find the time  complexity of your proposed solution 
  • Ans. 

    A function to merge two sorted linked lists and determine its time complexity.

    • Create a new linked list to store the merged result

    • Compare the values of the nodes from both lists and add the smaller value to the new list

    • Move the pointer of the list with the smaller value to the next node

    • Repeat the comparison and addition until one of the lists is fully traversed

    • If any list still has remaining nodes, append them to the ne...

  • Answered by AI
  • Q2.  Given a preorder traversal build a valid binary search tree. Write code covering all possible  cases
  • Ans. 

    To build a valid binary search tree from a preorder traversal

    • Iterate through the preorder traversal array

    • Use a stack to keep track of nodes

    • Compare each element with the top of the stack to determine its position in the BST

  • Answered by AI
  • Q3.  Let “E:dir1dir2....dir3page.html” be the file required. Here “.. “ tells us that we should move  one directory to the back.So the final output should be “E:dir3page.html”. So write code for this  covering...
  • Q4.  Find the closest ancestor any two nodes in a binary search tree. Write code for this.( Don't  forget to check the end conditions or base cases )
  • Q5. Give a string with spaces how will u compact it. Give various possible inputs for this. Optimise the code
  • Q6. Given two arrays with one array containing m elements sorted and another array of size m+n  containing n elements sorted at beginning where the last m positions are empty, write code to  merge these two so...
  • Ans. 

    Merge two sorted arrays efficiently into a bigger array.

    • Use a two-pointer approach to compare and merge elements from both arrays.

    • Start from the end of the bigger array and move backwards to avoid overwriting elements.

    • Continue merging until all elements from both arrays are placed in the bigger array.

  • Answered by AI
  • Q7.  Why java is platform independent? (They expected something other than byte code and  portability)

Interview Preparation Tips

Skills:
College Name: Anna University Chennai

Skills evaluated in this interview

Interview Questionnaire 

14 Questions

  • Q1. Merge two sorted linked list and write testcases
  • Ans. 

    Merging two sorted linked lists and writing test cases.

    • Create a new linked list to store the merged list

    • Compare the first nodes of both lists and add the smaller one to the new list

    • Repeat until one of the lists is empty, then add the remaining nodes to the new list

    • Write test cases to cover all possible scenarios, including empty lists and lists of different lengths

  • Answered by AI
  • Q2. WAP to check if the binary tree is height-balanced and write testcases
  • Ans. 

    WAP to check if binary tree is height-balanced and write testcases

    • A binary tree is height-balanced if the difference between the heights of its left and right subtrees is not more than 1

    • Use recursion to check if each subtree is height-balanced

    • Write testcases to cover all possible scenarios, including empty tree, single node tree, and unbalanced trees

  • Answered by AI
  • Q3. Then he asked me about my internship and to explain my projects
  • Q4. Find the intersection point of two linked list
  • Ans. 

    Find the intersection point of two linked lists.

    • Traverse both lists and find their lengths.

    • Move the head of the longer list to make both lists equal in length.

    • Traverse both lists in parallel until the intersection point is found.

  • Answered by AI
  • Q5. You are given file pointer and integer n, write c code for printing last “n” lines in that file
  • Ans. 

    C code to print last n lines of a file given file pointer and integer n.

    • Use fseek() to move the file pointer to the end of the file

    • Count the number of newline characters encountered from the end of the file until n lines are found

    • Use fgets() to read and print the last n lines

  • Answered by AI
  • Q6. What is deadlock?Conditions for that?What are the methods to prevent it?Write code to prevent the deadlock for OS, considering that there are two processes P0 and P1 in OS and they are requesting resource...
  • Ans. 

    Deadlock is a situation where two or more processes are unable to proceed due to a circular dependency on resources.

    • Deadlock occurs when two or more processes are waiting for resources held by each other.

    • Conditions for deadlock are mutual exclusion, hold and wait, no preemption, and circular wait.

    • Methods to prevent deadlock include resource allocation graph, banker's algorithm, and deadlock avoidance.

    • To prevent deadloc...

  • Answered by AI
  • Q7. How will you avoid race condition on shared memory?
  • Ans. 

    Use synchronization techniques like locks, semaphores, or mutexes to prevent multiple processes from accessing shared memory simultaneously.

    • Implementing a locking mechanism to ensure only one process can access the shared memory at a time.

    • Using semaphores to control access to the shared memory.

    • Using mutexes to ensure mutual exclusion and prevent race conditions.

    • Using atomic operations to ensure that memory operations a...

  • Answered by AI
  • Q8. Suppose there are two processes P0 and P1 and they want write to shared memory and while writing they should have exclusive lock on memory and P0 should be first to write the memory.Write C code using sema...
  • Q9. What is IPC? What are its types? compare them
  • Ans. 

    IPC stands for Inter-Process Communication. It is a mechanism that allows processes to communicate with each other.

    • Types of IPC include shared memory, message passing, and pipes.

    • Shared memory allows processes to share a portion of memory.

    • Message passing involves sending messages between processes.

    • Pipes are a unidirectional form of communication.

    • Shared memory is faster than message passing, but message passing is more r...

  • Answered by AI
  • Q10. If you have design offline browser and what will be challenges that you will face
  • Ans. 

    Designing an offline browser poses challenges such as data storage, synchronization, and user experience.

    • Ensuring efficient data storage and retrieval

    • Implementing synchronization with online content

    • Providing a seamless user experience with limited connectivity

    • Handling updates and changes to online content

    • Managing cache and memory usage

    • Dealing with security concerns

    • Handling different file types and formats

  • Answered by AI
  • Q11. Give the data structure to represent N-ary tree and write to code for its BFS
  • Ans. 

    Data structure and code for BFS of N-ary tree

    • N-ary tree can be represented using a node class with a list of child nodes

    • BFS can be implemented using a queue data structure

    • Iterate through the queue and add child nodes to the queue

    • Pop the node from the queue and process it

    • Repeat until the queue is empty

  • Answered by AI
  • Q12. You are given binary tree. Weight of node in binary tree=data present in it*level of that node(root’s level was given to be 1).Find the node in tree with maximum weight
  • Ans. 

    Find node with maximum weight in a binary tree based on data and level of node

    • Calculate weight of each node based on data and level

    • Traverse the binary tree and keep track of node with maximum weight

    • Return the node with maximum weight

  • Answered by AI
  • Q13. You are given infinite sequence of continuos natural numbers-1,2,3,4,5,6.......... Initially you delete every 2nd element so sequence will be 1,3,,5,7,9,11,13..... now in the resultant sequence you dele...
  • Ans. 

    Program to check if a given number is a lucky number or not.

    • Create a function that takes an integer n as input

    • Initialize a variable count to 2

    • Loop through the sequence and delete every count-th element

    • Repeat the above step until the end of the sequence

    • If n is present in the final sequence, return true, else return false

  • Answered by AI
  • Q14. Write the code to find inorder successor of given node in binary tree
  • Ans. 

    Code to find inorder successor of given node in binary tree

    • Check if the given node has a right subtree, if yes then find the leftmost node in the right subtree

    • If the given node does not have a right subtree, then traverse up the tree until we reach a node which is the left child of its parent

    • If we reach the root and the given node is the rightmost node, then there is no inorder successor

  • Answered by AI

Interview Preparation Tips

College Name: Veermata Jijabai Technological Institute, Mumbai [ VJTI ]

Skills evaluated in this interview

Top Microsoft Corporation Software Developer Interview Questions and Answers

Q1. Buses Origin Problem Statement You have been provided with an array where each element specifies the number of buses that can be boarded at each respective bus stop. Buses will only stop at locations that are multiples of the bus stop they ... read more
View answer (3)

Software Developer Interview Questions asked at other Companies

Q1. Maximum Subarray Sum Problem Statement Given an array of integers, determine the maximum possible sum of any contiguous subarray within the array. Example: Input: array = [34, -50, 42, 14, -5, 86] Output: 137 Explanation: The maximum sum is... read more
View answer (42)

Interview Questionnaire 

8 Questions

  • Q1. Given an integer array, find all (a,b,c) such that a^2 + b^2 = c^2 Solution is O(n^2) Write code and testcases
  • Ans. 

    Given an integer array, find all (a,b,c) such that a^2 + b^2 = c^2. Solution is O(n^2). Write code and testcases.

    • Use nested loops to iterate through all possible pairs of integers in the array

    • Check if the sum of squares of the two integers is a perfect square

    • If yes, add the triplet to the result list

    • Return the result list

  • Answered by AI
  • Q2. Find the height og a binary tree without recursion. Write code and testcases
  • Ans. 

    Find height of binary tree without recursion

    • Use a stack to keep track of nodes

    • Iteratively traverse the tree and update height

    • Testcases: empty tree, single node tree, balanced tree, unbalanced tree

  • Answered by AI
  • Q3. Given a bit pattern (in an integer INPUT), and another pattern (in an integer PATTERN, with a number n signifying the number of trailing bits to be considered as pattern - remaining bits are zero. Example:...
  • Ans. 

    Count the number of occurrences of a given bit pattern in an integer.

    • Extract the n trailing bits from the pattern and create a mask with all other bits set to zero.

    • Use a sliding window approach to compare the extracted pattern with all possible n-bit sequences in the input integer.

    • Increment a counter every time the extracted pattern matches with a sequence in the input integer.

  • Answered by AI
  • Q4. Given a pointer to the root of a binary tree, find whether the left and right subtrees are mirror images of each other
  • Ans. 

    Given a binary tree, check if left and right subtrees are mirror images of each other.

    • Traverse the tree and compare left and right subtrees recursively.

    • Use a stack or queue to traverse the tree iteratively.

    • Check if the left subtree is a mirror image of the right subtree by comparing their values and structures.

    • Consider an empty tree as a mirror image of itself.

  • Answered by AI
  • Q5. Given a string INPUT, find the longest repeating substring
  • Ans. 

    Find the longest repeating substring in a given string.

    • Create an array of all possible substrings of the given string.

    • Sort the array in lexicographic order.

    • Find the longest common prefix between adjacent strings.

    • Return the longest common prefix found.

    • If no repeating substring is found, return an empty string.

  • Answered by AI
  • Q6. 2 magnesium strips and a matchbox are given. Each burns in 60 minutes, with no relation between length burnt and time. Calculate 45 min
  • Q7. You have 3 baskets- one containing apples, one oranges and the last containing both. All baskets are incorrectly labelled.You can pick *one* fruit from *any one* basket and are supposed to correctly label ...
  • Ans. 

    Pick a fruit from the basket containing both fruits and label the baskets accordingly.

    • Pick a fruit from the basket labelled 'apples and oranges'

    • If you pick an apple, label the basket containing only apples

    • If you pick an orange, label the basket containing only oranges

    • Label the remaining basket as containing both fruits

  • Answered by AI
  • Q8. You're in the center of a circular pond, with an *intelligent* lion at the circumference - intelligent implies you can't trivially fool it. Given that, your swimming speed = x, lion's running speed on l...
  • Ans. 

    Escape from an intelligent lion at the circumference of a circular pond with given speeds.

    • Swim towards the circumference of the pond to make the lion run a longer distance.

    • Once the lion is at a considerable distance, get out of the pond and run in the opposite direction.

    • Use obstacles like trees or rocks to slow down the lion.

    • Try to confuse the lion by changing directions frequently.

  • Answered by AI

Interview Preparation Tips

Round: Technical Interview
Experience: Given a string INPUT, find the longest repeating substring.

Example: if INPUT = ababcbacabc, answer would be abc.

Write testcases.

The most important thing here is that you're supposed to ask questions to resolve ambiguities - the substrings cannot be overlappping.

Example: If INPUT = seattle, the expected answer is t, not e.

Example: If INPUT = ababa, answer = ab, not aba.

All such corner-cases must be considered.
Screening interview:

I had a single screening interview for conversion from Microsoft IDC to Redmond. It was more like a chat - in the initial 10-15 minutes atleast.

The first 10-15 minutes was about:

what i learnt at Microsoft
What was my project about
What did I learn from my project (my answer to this included both, learning in technical sense and personal development.
“Why test?” (IDC had selected me as an SDET, and that’s the profile they’d forwarded)

After that he asked what I liked to do (problem solving etc.) On saying “solving new and challenging problems”, he gave me the question:

Given 3 consecutinve numbers, and that the first and third are prime, is it always true that the middle number is divisible by 3 ? Prove your answer.
This question was majorly to check if I can think and zero in on the solution and the process.

Then, my second (and easy) question was to

Write a code for tokenizing a character stream. The stream starts and ends with a delimiter.
Example: Input: “
Here, the start of the string is denoted by ‘<’, and end by ‘>’.
The expected output is to return(or print) list of individual words. ie: “abc, def, msft, pr-st” (four words)

This is a ridiculously easy thing to code - but they weren’t interested in code. What he wanted to see was:
1. Approach
2. If the logic is sturdy enough and considers all test cases
2. Design choices and decision making (the whole Q revolved around this) - I made a list of test cases that the code should consider. In each case, there is a decision to be made - he wanted to see why I decided what I decided.
Example:
Input: “ a<efg>”
This obviously is something where a normal program would fail. My logic to this was: Discard everything before the first start delimiter, after the first end delimiter.
So my output: “abc, cd”

That was all.

Tips: Mine was a PrePlacement interview process - doesnt differ much from the normal campus, but competition is awesome.

College Name: Veermata Jijabai Technological Institute, Mumbai [ VJTI ]

Skills evaluated in this interview

Top Microsoft Corporation Software Developer Interview Questions and Answers

Q1. Buses Origin Problem Statement You have been provided with an array where each element specifies the number of buses that can be boarded at each respective bus stop. Buses will only stop at locations that are multiples of the bus stop they ... read more
View answer (3)

Software Developer Interview Questions asked at other Companies

Q1. Maximum Subarray Sum Problem Statement Given an array of integers, determine the maximum possible sum of any contiguous subarray within the array. Example: Input: array = [34, -50, 42, 14, -5, 86] Output: 137 Explanation: The maximum sum is... read more
View answer (42)

Microsoft Corporation Interview FAQs

How many rounds are there in Microsoft Corporation interview?
Microsoft Corporation interview process usually has 2-3 rounds. The most common rounds in the Microsoft Corporation interview process are Technical, Coding Test and One-on-one Round.
How to prepare for Microsoft Corporation interview?
Go through your CV in detail and study all the technologies mentioned in your CV. Prepare at least two technologies or languages in depth if you are appearing for a technical interview at Microsoft Corporation. The most common topics and skills that interviewers at Microsoft Corporation expect are microsoft, Computer science, C++, Coding and Python.
What are the top questions asked in Microsoft Corporation interview?

Some of the top questions asked at the Microsoft Corporation interview -

  1. You are given infinite sequence of continuos natural numbers-1,2,3,4,5,6.........read more
  2. You have a cuboid (m*n*p) each block of the cuboid is having a metallic ball. ...read more
  3. Given a string of containing lower case letters and upper case characters. Find...read more
How long is the Microsoft Corporation interview process?

The duration of Microsoft Corporation interview process can vary, but typically it takes about less than 2 weeks to complete.

Tell us how to improve this page.

Microsoft Corporation Interview Process

based on 375 interviews

Interview experience

4.2
  
Good
View more

Interview Questions from Similar Companies

Accenture Interview Questions
3.8
 • 8.1k Interviews
IBM Interview Questions
4.0
 • 2.3k Interviews
Oracle Interview Questions
3.7
 • 846 Interviews
Google Interview Questions
4.4
 • 823 Interviews
Amdocs Interview Questions
3.7
 • 514 Interviews
Dell Interview Questions
4.0
 • 386 Interviews
Cisco Interview Questions
4.1
 • 370 Interviews
SAP Interview Questions
4.2
 • 283 Interviews
Adobe Interview Questions
3.9
 • 233 Interviews
Intel Interview Questions
4.2
 • 214 Interviews
View all

Microsoft Corporation Reviews and Ratings

based on 1.7k reviews

4.0/5

Rating in categories

3.9

Skill development

4.0

Work-life balance

3.9

Salary

3.5

Job security

4.0

Company culture

3.4

Promotions

3.7

Work satisfaction

Explore 1.7k Reviews and Ratings
Software Engineer
1.6k salaries
unlock blur

₹16 L/yr - ₹50 L/yr

Senior Software Engineer
1.1k salaries
unlock blur

₹25 L/yr - ₹96 L/yr

Software Engineer2
1k salaries
unlock blur

₹20 L/yr - ₹72 L/yr

Software Developer
762 salaries
unlock blur

₹14 L/yr - ₹50.4 L/yr

Consultant
600 salaries
unlock blur

₹13 L/yr - ₹36.7 L/yr

Explore more salaries
Compare Microsoft Corporation with

Google

4.4
Compare

Amazon

4.1
Compare

Deloitte

3.8
Compare

TCS

3.7
Compare
Did you find this page helpful?
Yes No
write
Share an Interview