Microsoft interview experience Real time questions & tips from candidates to crack your interview

SDE - 1

Microsoft
upvote
share-icon
3 rounds | 4 Coding problems

Interview preparation journey

expand-icon
Journey
I started with a strong focus on mastering the basics of programming, problem-solving, and data structures. Through consistent practice on coding platforms and building side projects, I improved my skills and gained industry experience at Amazon. I refined my knowledge of algorithms, system design, and soft skills while preparing for interviews. My journey taught me that persistence, continuous learning, and a growth mindset are key to success in software development.
Application story
I applied for the role through a referral at my current organization. The application process was straightforward, and after submitting my resume, I was shortlisted for an interview. The process included an initial technical screening, followed by multiple rounds of interviews focusing on problem-solving, system design, and behavioral aspects. I found the entire process to be well-structured, with clear communication throughout.
Why selected/rejected for the role?
I was selected for this role because my profile aligned well with the job requirements, and I performed well during the interview. My technical skills, problem-solving abilities, and experience with relevant technologies made me a strong fit for the position.
Preparation
Duration: 6 Months
Topics: Data Structures, Algorithms, System Design, Object-Oriented Programming, Multithreading, Databases.
Tip
Tip

Tip 1: Focus on mastering the fundamentals, especially data structures and algorithms, as they are the backbone of technical interviews.
Tip 2: Practice solving problems regularly on coding platforms to build problem-solving speed and confidence.

Application process
Where: Referral
Eligibility: Above 7 CGPA, (Salary Package: 42 LPA)
Resume Tip
Resume tip

Tip 1: Include relevant and well-documented projects on your resume, demonstrating both technical skills and problem-solving abilities.
Tip 2: Ensure that all information is truthful and avoid exaggerating your experience or skills.

Interview rounds

01
Round
Medium
Video Call
Duration50 minutes
Interview date14 Jun 2024
Coding problem2

Timing: The round was scheduled during regular working hours, and there were no delays.
Environment: The interview was conducted remotely, so I was in a quiet environment at home. The interviewer was from Microsoft, and the call quality was clear with no technical disruptions.
Significant Activity: The interview involved solving coding problems in real time. I was asked to share my screen, and I worked through the problems on a coding platform. The interviewer was supportive and provided hints when necessary, making the session interactive.
How the Interviewer Was: The interviewer was calm, patient, and professional. They encouraged me to explain my thought process, which helped me articulate my approach. They also guided me whenever I got stuck on a particular problem.

1. Detect and Remove Loop

Moderate
10m average time
90% success
0/80
Asked in companies
Paytm (One97 Communications Limited)OracleDelhivery

Given a singly linked list, you have to detect the loop and remove the loop from the linked list, if present. You have to make changes in the given linked list itself and return the updated linked list.

Expected Complexity: Try doing it in O(n) time complexity and O(1) space complexity. Here, n is the number of nodes in the linked list.

Problem approach

Step 1: I first considered a simple approach where I would iterate through the list and track visited nodes using a hash set.

This would allow me to check if any node has been visited more than once, indicating a cycle.
I explained this approach to the interviewer and implemented it.
Step 2: The interviewer mentioned that while this solution works, it has a space complexity of O(n), which could be inefficient for large lists. They asked me to optimize the space complexity.

Step 3: I then proposed and implemented Floyd’s Cycle-Finding Algorithm (also known as the Tortoise and Hare approach).

In this approach, I used two pointers: one moves two steps at a time (the "hare") and the other moves one step at a time (the "tortoise").
If there is a loop, the hare and tortoise will eventually meet at the same node, indicating a cycle.
This solution only requires O(1) space and O(n) time complexity, which satisfies the interviewer’s optimization request.

Try solving now

2. First non repeating character

Easy
15m average time
80% success
0/40
Asked in companies
InfosysWalmartHCL Technologies

Ninja is now bored with numbers and is now playing with characters but hates when he gets repeated characters. Ninja is provided a string, and he wants to return the first unique character in the string.The string will contain characters only from the English alphabet set, i.e., ('A' - 'Z') and ('a' - 'z'). If there is no non-repeating character, print the first character of the string. If there is no non-repeating character, return the first character of the string.

Problem approach

Step 1: I initially considered a brute-force solution where I would loop through each character in the string and check if it is repeated.

This would involve two nested loops: one to check each character and another to count its occurrences.
I explained the approach to the interviewer and implemented it.
Step 2: The interviewer asked me if I could improve the time complexity, as the brute-force solution had a time complexity of O(n²), which is inefficient.

Step 3: I then suggested using a hash map (or unordered_map in C++) to store the frequency of each character in a single pass over the string.

In the first loop, I updated the frequency count for each character.
In the second loop, I checked the frequency of each character and returned the first character with a count of 1.
This solution had a time complexity of O(n) and space complexity of O(n), which is optimal for this problem.
Result: The interviewer was satisfied with this solution as it was both efficient and easy to understand. We then moved to the next round.

Try solving now
02
Round
Medium
Video Call
Duration60 Minutes
Interview date21 Jun 2024
Coding problem1

Timing: The round was conducted during regular office hours at the Microsoft office.
Environment: The setting was quiet and professional, with no interruptions. I was provided with a laptop equipped with a coding platform (likely an IDE or an online code editor) to solve the problems.
Significant Activity: The interviewer presented a set of coding challenges to work on. I was encouraged to think aloud and explain my thought process, making it a collaborative and engaging experience.
Interviewer: The interviewer was friendly, supportive, and patient. They offered feedback on my approach and provided guidance when I needed clarification, making the entire experience feel more like a discussion than a formal interview.

1. Maximum Subarray Sum

Moderate
25m average time
75% success
0/80
Asked in companies
Paytm (One97 Communications Limited)AmazonSnapdeal

Given an array of numbers, find the maximum sum of any contiguous subarray of the array.


For example, given the array [34, -50, 42, 14, -5, 86], the maximum sum would be 137, since we would take elements 42, 14, -5, and 86.


Given the array [-5, -1, -8, -9], the maximum sum would be -1.


Follow up: Do this in O(N) time.

Problem approach

Step 1: I first thought of a brute-force approach.

I considered checking all possible subarrays and calculating their sums to find the maximum.
I explained this approach to the interviewer and started implementing it, but the interviewer pointed out that this would have a time complexity of O(n²), which might be inefficient for larger arrays.
Step 2: The interviewer asked me to optimize the solution and think of a more efficient approach.

I realized that I could avoid checking every subarray by using a more intelligent approach to track the maximum sum as I traverse the array.
I thought of Kadane’s Algorithm as a better approach, which optimally tracks the maximum sum of the subarray as I go through the array.
Step 3: I then implemented Kadane's Algorithm.

I maintained two variables: one to store the maximum sum of the subarray that ends at the current index (current_sum), and another to track the global maximum sum (max_sum).
For each element in the array, I updated the current_sum to be the maximum of the current element or the sum of the current element and the previous current_sum.
I updated max_sum whenever current_sum exceeded it.
The solution ran in O(n) time complexity and had a space complexity of O(1), which satisfied the optimization request.
Result: The interviewer was happy with the optimized solution and appreciated the efficiency of the algorithm.

Try solving now
03
Round
Medium
Video Call
Duration70 Minutes
Interview date21 Jul 2024
Coding problem1

Timing: The round was scheduled during regular working hours.
Environment: The interviewer and I were both working from different locations. The call was clear, and there was no disturbance.
Other Significant Activity: The interview was collaborative, and the interviewer encouraged me to explain my reasoning for each design decision.
How the Interviewer Was: The interviewer was patient and guided me through the design process. They asked probing questions to understand my approach and suggested improvements for scalability and performance.

1. System Design

The interviewer asked me to design a scalable notification system for a social media platform that supports sending notifications to millions of users in real time. The system should handle various types of notifications (like messages, likes, comments) and be able to scale horizontally.

Problem approach

Step 1: I started by identifying the core components of the notification system, such as:

Producer: The user or event that triggers a notification (e.g., someone liking a post or sending a message).
Queue: The notification queue to buffer events.
Consumer: The service that processes and sends notifications to users.
Step 2: I suggested using a Message Queue (e.g., Kafka or RabbitMQ) to decouple the producer and consumer, ensuring that notifications are sent in a scalable and efficient manner.

Step 3: The interviewer then asked about database storage and how to handle millions of users:

I proposed using a NoSQL database (e.g., Cassandra or DynamoDB) to store user preferences and notification data because of their scalability and ability to handle large volumes of writes.
For the consumer service, I suggested using Worker Services which could pull data from the queue and send notifications in batches to reduce the load on the database.
Step 4: To handle real-time delivery of notifications, I suggested implementing a Pub/Sub model using technologies like Redis for real-time communication and Caching user data in memory to reduce the load on the database.

Step 5: The interviewer challenged my choice of caching and asked about failover scenarios:

I discussed adding Replication and Data Sharding for horizontal scalability.
I explained the use of Distributed Caches (e.g., Redis Cluster) for high availability, ensuring that even if one cache node fails, the system can continue to operate normally.
Step 6: The interviewer also asked about handling delivery retries and ensuring the system remains fault-tolerant:

I proposed implementing a Retry Logic for failed deliveries, with exponential backoff to avoid overwhelming the system.
Final Thoughts: The interviewer was satisfied with the overall design, but they suggested focusing more on ensuring efficient database access patterns and fine-tuning the consumer services for optimal performance.

Here's your problem of the day

Solving this problem will increase your chance to get selected in this company

Skill covered: Programming

Which SQL keyword removes duplicate records from a result set?

Choose another skill to practice
Similar interview experiences
company logo
SDE - 1
5 rounds | 15 problems
Interviewed by Microsoft
2346 views
0 comments
0 upvotes
company logo
SDE - 1
5 rounds | 7 problems
Interviewed by Microsoft
1595 views
0 comments
0 upvotes
company logo
SDE - 1
1 rounds | 2 problems
Interviewed by Microsoft
6474 views
0 comments
0 upvotes
company logo
SDE - 1
4 rounds | 7 problems
Interviewed by Microsoft
639 views
0 comments
0 upvotes
Companies with similar interview experiences
company logo
SDE - 1
5 rounds | 12 problems
Interviewed by Amazon
107832 views
24 comments
0 upvotes
company logo
SDE - 1
3 rounds | 7 problems
Interviewed by Amazon
32261 views
6 comments
0 upvotes
company logo
SDE - 1
3 rounds | 11 problems
Interviewed by Amazon
20849 views
3 comments
0 upvotes