Microsoft SDE Intern Interview Experience
💼 LTIMindtree Interview Experience (On-Campus) | Fresher | 2026
Salesforce SMTS | Interview Experience | Rejected
JPMC | SDE2 (Associate) - Java Backend - Interview Experience + Compensation
Microsoft - SDE2 - Coding Round
Microsoft Recent SDE2 DSA Queations
Summary
I've compiled a set of Data Structures and Algorithms questions that were recently posed in SDE2 interviews at Microsoft, shared by myself and my friends.
Full Experience
This post is a collection of Data Structures & Algorithms questions that I and a few of my friends encountered during our recent SDE2 interviews at Microsoft. Our aim is to provide valuable insights into the types of problems asked for this role, ranging from standard LeetCode problems to custom algorithmic challenges and even a system design question. These questions were gathered from various rounds we faced, including some with direct LeetCode links and others described in detail. Hopefully, this comprehensive list will aid others preparing for similar roles.
Interview Questions (16)
You are given a string s = "31415926535 8979323846264338327" and a list of words: ["314", "15926535 89", "79323846264", "338327", "7932", "3846264", "338327"]. Your task is to partition the string s into substrings such that:
- Each substring is present in the given list of words.
- The number of partitions (substrings) is minimized.
Design a time-based key-value store that supports set and get operations. The set operation stores a key with a value and a timestamp. The get operation retrieves the value associated with a key at a specific timestamp, returning the most recent value if multiple exist before or at the given timestamp.
Design a text editor that supports basic operations like typing, deleting, and cursor movement, along with undo and redo functionalities. Several follow-up questions were also part of this problem.
Given a string s containing just the characters '(', ')', '{', '}', '[' and ']', determine if the input string is valid. An input string is valid if: Open brackets must be closed by the same type of brackets. Open brackets must be closed in the correct order. Every close bracket has a corresponding open bracket of the same type.
Given an integer array, sort the integers in ascending order based on the count of their set bits (1s in binary representation). If two numbers have the same count of set bits, maintain their relative order as in the original array (or sort by value if not specified, but typically stability is preferred).
Given a mutable sequence of characters (e.g., std::vector<char> or a character array), remove all spaces from it in-place. The relative order of non-space characters must be preserved.
You are given a list of airline tickets where tickets[i] = [fromi, toi] represent the departure and arrival airports of one flight. Reconstruct the itinerary in order. All of the tickets belong to a man who departs from 'JFK'. Thus, the itinerary must begin with 'JFK'. If there are multiple valid itineraries, you should return the itinerary that has the smallest lexical order when read as a single string. For example, the itinerary ["JFK", "LGA"] has a smaller lexical order than ["JFK", "LGB"]. All airports are represented by three uppercase English letters. You may assume that there exists at least one valid itinerary.
You are given an integer array pnl of length n, where pnl[i] represents the profit or loss on day i. You are also given an integer k. Your task is to find the maximum possible profit of any contiguous subarray whose length is at most k.