Selected - Microsoft SDE2 Interview Experience
Summary
I recently completed my SDE2 interview loop at Microsoft, which included three technical rounds (DSA, LLD, CS Fundamentals), an Architectural Design round, and a Behavioral (AA) round. I received positive feedback and a verbal offer for the WSD team, and I am currently awaiting the official offer letter.
Full Experience
I recent completed SDE2 loop and wanted to share my experience.
Current Experience - 4.5 year
Three rounds happened on Friday as part of the hiring event drive, and the AA happened the following week after I received positive feedback from all three rounds.
(DSA + LLD) with Principle Engineer -
- DSA - Top K Frequent Error Codes You are given a list of log lines. Each line contains an errorCode (string). Return the Top K most frequent error codes. Sort by higher frequency first; if tie, sort by ascending List of errors codes - e1,e2,e3,e1,e2,e3 and k=2
- LLD - I have data retrieval and update operations. The challenge is that the data source can change at runtime (for example, database, API, or file). I want to design the data access layer in a way that it remains loosely coupled from the underlying data source. Please design the classes using Dependency Injection, Factory, or Strategy design patterns. They were not focused on running the code, as we were discussing the solution on the whiteboard. Instead, I explained the design very well and structured it in the best way.
Verdict: Passed. The round lasted 1 hour.
DSA + LLD with Principle Engineer -
DSA Question -
Problem Statement
There are employee_nodes employees in a company. Among them, k special employees have a data network and can share their mobile hotspots with other employees.There are already employee_edges connections between employees. Each connection links two employees: employee_from[i] and employee_to[i], meaning either of these employees can share a mobile hotspot.Two employees x and y are considered connected if there exists a path between them.
All employees connected to a special employee x will use the mobile hotspot of that special employee.Previously, to restrict data usage, any employee could be connected to at most one special employee. However, due to increased data consumption, any employee can now be connected to at most max_connections special employees. Your task is to determine the maximum number of edges that can be added to the graph such that no employee is connected to more than max_connections special employees.
Note: The given graph does not contain self-loops or multiple edges between nodes. The graph formed after adding edges should not contain self-loops or multiple edges. It is guaranteed that in the given graph, no two special employees are connected to each other.
Example employee_nodes = 4 employee_edges = 1 k = 2 max_connections = 1 special_employees = [1, 3]
employee_from = [1] employee_to = [2]
Employees 1 and 3 are special employees. Since max_connections = 1, they cannot be connected to each other. Employee 4 can be connected to employees 1 and 2, resulting in two additional edges. Answer = 2
Function Description
Complete the function getMaximumEdges with the following parameters:
getMaximumEdges( int employee_nodes, int employee_from[employee_edges], int employee_to[employee_edges], int special_employees[k], int max_connections ) Parameters
employee_nodes: Total number of employees (nodes) employee_from[employee_edges]: One endpoint of each connection employee_to[employee_edges]: The other endpoint of each connection special_employees[k]: List of special employees max_connections: Maximum number of special employees any employee can be connected to
Return the maximum number of edges that can be added to the graph such that any employee is connected to at most max_connections special employees.
LLD Question asked in this round
-
Design Multi-Module Logging Framework There are controllers which has module 1, module2, module 3, need to design logging capability framework for the complete system. When module1/2/3 has done some activity it will send log data to your framework. and framework should log to a file/any tool as a stream. Three threads one writing to the buffer,your framework thread is reading it. and ack when it is written to the file/tool.
-
Need to write a code write a three-thread and data should be exchanged b/w all these 3 threads and basically a R/W operation, how i can approach it
Verdict: Passed. The round lasted 1.5 hour.
DSA + CS Fundamentals with Principle Engineer
- What is the difference between a process and a thread?
- If multiple threads access the same variable and they don’t write to it, do we face any problem?
- What issues arise when multiple threads access a shared variable?
- What is the difference between a variable created on the heap and a variable created inside a function? If multiple threads execute the same function, and each thread has its own function-local variables, then how do conflicts arise at all?
- What exactly causes race conditions in multithreaded programs? What is Microservices Architecture? How is Microservices Architecture different from a monolithic architecture? If services are running on different virtual machines, how do they communicate with each other?
- How does gRPC help in communication between services running on different VMs? Why would we choose gRPC over REST for service-to-service communication?
- What other communication mechanisms can be used between services apart from gRPC? What is Event-Driven Architecture?
- What do we mean by an “event” in Event-Driven Architecture? How does Event-Driven Architecture work in a microservices system?
- How is Event-Driven Architecture different from synchronous communication like REST or gRPC? What are the benefits of using Event-Driven Architecture?
- What challenges or trade-offs come with Event-Driven Architecture?
Coding Question First question - https://leetcode.com/problems/reverse-nodes-in-k-group/description/ Second Question – Longest Substring Without Duplicates. I explained the approach and wrote the code using the sliding window technique.
They expect the code to be running and optimized.
Verdict: Passed. The round lasted 1 hour.
AA round with Microsoft Leader
Behavioral Question
- Complex project like end to end ownership
- What is one non-technical skill you want to become better at?
- Disagreement with manager and teammates
- Why are you looking for a change?
- Why microsoftHow are AI tools helping you in your projects?
HLD - Design a notification System - HLD + LLD Both
Verdict: Passed. The round lasted 1 hour 20 minutes.
Currently, the recruiter has asked me to submit documents related to my current salary slip and has verbally informed me about my selection. They also mentioned that the offer will be rolled out by the end of next week. I’m hoping there won’t be any hurdles in between.
Team – WSD Team. Let me know if anyone knows how this team is in terms of growth, opportunities, and culture. So far, I have heard that the culture in this team is good and the opportunities are immense.
Let me know if you have any questions. I’d love to answer them and help you guys.
Interview Questions (23)
Top K Frequent Error Codes
You are given a list of log lines. Each line contains an errorCode (string). Return the Top K most frequent error codes. Sort by higher frequency first; if tie, sort by ascending List of errors codes - e1,e2,e3,e1,e2,e3 and k=2
Design Data Access Layer with Runtime Source Change
I have data retrieval and update operations. The challenge is that the data source can change at runtime (for example, database, API, or file). I want to design the data access layer in a way that it remains loosely coupled from the underlying data source. Please design the classes using Dependency Injection, Factory, or Strategy design patterns.
Maximize Edges in a Special Employee Network
There are employee_nodes employees in a company. Among them, k special employees have a data network and can share their mobile hotspots with other employees.There are already employee_edges connections between employees. Each connection links two employees: employee_from[i] and employee_to[i], meaning either of these employees can share a mobile hotspot.Two employees x and y are considered connected if there exists a path between them. All employees connected to a special employee x will use the mobile hotspot of that special employee.Previously, to restrict data usage, any employee could be connected to at most one special employee. However, due to increased data consumption, any employee can now be connected to at most max_connections special employees. Your task is to determine the maximum number of edges that can be added to the graph such that no employee is connected to more than max_connections special employees. Note: The given graph does not contain self-loops or multiple edges between nodes. The graph formed after adding edges should not contain self-loops or multiple edges. It is guaranteed that in the given graph, no two special employees are connected to each other. Example: employee_nodes = 4, employee_edges = 1, k = 2, max_connections = 1, special_employees = [1, 3], employee_from = [1], employee_to = [2]. Employees 1 and 3 are special employees. Since max_connections = 1, they cannot be connected to each other. Employee 4 can be connected to employees 1 and 2, resulting in two additional edges. Answer = 2. Function Description: Complete the function getMaximumEdges with the following parameters: getMaximumEdges(int employee_nodes, int employee_from[employee_edges], int employee_to[employee_edges], int special_employees[k], int max_connections). Parameters: employee_nodes: Total number of employees (nodes), employee_from[employee_edges]: One endpoint of each connection, employee_to[employee_edges]: The other endpoint of each connection, special_employees[k]: List of special employees, max_connections: Maximum number of special employees any employee can be connected to. Return the maximum number of edges that can be added to the graph such that any employee is connected to at most max_connections special employees.
Design Multi-Module Logging Framework
There are controllers which has module 1, module2, module 3, need to design logging capability framework for the complete system. When module1/2/3 has done some activity it will send log data to your framework. and framework should log to a file/any tool as a stream. Three threads one writing to the buffer,your framework thread is reading it. and ack when it is written to the file/tool.
Design Three-Thread Data Exchange (R/W)
Need to write a code write a three-thread and data should be exchanged b/w all these 3 threads and basically a R/W operation, how i can approach it
Process vs Thread
What is the difference between a process and a thread?
Multiple Threads Reading Same Variable
If multiple threads access the same variable and they don’t write to it, do we face any problem?
Issues with Multiple Threads Accessing Shared Variable
What issues arise when multiple threads access a shared variable?
Heap vs Stack Variables & Thread Conflicts
What is the difference between a variable created on the heap and a variable created inside a function? If multiple threads execute the same function, and each thread has its own function-local variables, then how do conflicts arise at all?
Causes of Race Conditions
What exactly causes race conditions in multithreaded programs?
Microservices vs Monolithic Architecture
What is Microservices Architecture? How is Microservices Architecture different from a monolithic architecture? If services are running on different virtual machines, how do they communicate with each other?
gRPC for Service Communication
How does gRPC help in communication between services running on different VMs? Why would we choose gRPC over REST for service-to-service communication?
Alternative Service Communication Mechanisms
What other communication mechanisms can be used between services apart from gRPC?
Event-Driven Architecture in Microservices
What is Event-Driven Architecture? What do we mean by an “event” in Event-Driven Architecture? How does Event-Driven Architecture work in a microservices system? How is Event-Driven Architecture different from synchronous communication like REST or gRPC? What are the benefits of using Event-Driven Architecture? What challenges or trade-offs come with Event-Driven Architecture?
Reverse Nodes in k-Group
Longest Substring Without Duplicates
Longest Substring Without Duplicates. I explained the approach and wrote the code using the sliding window technique.
Complex Project End-to-End Ownership
Complex project like end to end ownership
Non-Technical Skill for Improvement
What is one non-technical skill you want to become better at?
Disagreement with Manager and Teammates
Disagreement with manager and teammates
Reason for Job Change
Why are you looking for a change?
Why Microsoft?
Why microsoft
AI Tools in Projects
How are AI tools helping you in your projects?
Design Notification System (HLD + LLD)
Design a notification System - HLD + LLD Both