Microsoft Software Engineer Interview Questions
Master your tech interview with our curated database of real questions from top companies.
Design local sports team recommendation system
Design a recommendation system that suggests local sports teams to users. High-level requirements: - Recommend sports teams that are relevant to a use...
Discuss proudest project and conflict handling
Answer the following behavioral questions in depth, demonstrating ownership and leadership: 1. Proudest project and ownership - Describe the projec...
Merge overlapping intervals
You are given an array of intervals, where each interval is represented as a pair of integers [start, end] with start <= end. The intervals may be uns...
Find lowest common ancestor in tree
You are given the root of a binary search tree (BST) and two distinct nodes p and q that are guaranteed to exist in the tree. Task (BST case): - Find ...
Count integer pairs satisfying 1/x + 1/y = 1/N
You are given a positive integer N (\(1 \le N \le 10^6\)). Consider the Diophantine equation: \[ \frac{1}{x} + \frac{1}{y} = \frac{1}{N}, \] where x a...
Find max consecutive elements with sum below target
You are given: - An integer array nums of length n, sorted in non-decreasing order. - An integer index such that 0 ≤ index < n. - An integer target. S...
Design top-K frequency store for varying workloads
Scenario You need to design an in-memory component that tracks how often each key appears in a stream of events. The component must support these oper...
Find shortest substring with n unique letters
Problem You are given a string s consisting of lowercase English letters and an integer n (1 ≤ n ≤ 26). Find the length of the shortest contiguous sub...
Design cache with least-recently-used eviction
You are asked to design an in-memory key–value cache that supports a least-recently-used (LRU) eviction policy. The cache must support the following o...
Count non-decreasing arrays by digit sums
You are given an array required_sums of length n. Count how many non-decreasing arrays result[1..n] of integers satisfy all of the following: ( 1) for...
Propose research to improve business
Prompt: Propose Research Directions and Solution Approaches to Improve Business Performance Context Assume a large-scale, web/mobile, cloud-backed pro...
Introduce yourself and explain 'Why us?'
Behavioral & Leadership Technical Screen Prompt (Software Engineer) Context You are interviewing for a Software Engineer role in a technical screen fo...
Identify research to improve business
Analytics & Experimentation Strategy to Improve Business Outcomes Context Assume you are a software engineer interviewing for a role focused on analyt...
Cluster city name variants into canonical entities
Normalize City Names for Vote Aggregation Context You have voting records containing a free-text city field. The same city may appear in many forms (e...
Solve load balancing and perfect pairs
1) Contiguous load balancing: You have n identical resources (servers) and m ordered tasks with processing times burstTime[0..m-1]. Each server must b...
Design an image upload/download service
System Design: Image Upload and Download Service Context Design a production-grade image service used by web and mobile clients. The service must supp...
Respond to behavioral prompts and availability
Behavioral and Leadership Prompt — Technical Screen (Software Engineer) Context You are in a technical screen for a Software Engineer role. Provide co...
Navigate bias, sponsorship, and domain misalignment
Behavioral & Leadership Onsite: Expertise Gaps, Fairness, Sponsorship, and AI Pivot Context You are interviewing for a Software Engineer role. Provide...
Compute most popular location with weights
You are given a dataset of voting records for concert locations. Each record includes voter_id, location_text, and an optional numeric weight (default...
Count k for consecutive-sum generator
An array generator service produces a consecutive-integers array starting at a positive integer k: [k, k+1, ..., k+m−1] for some m ≥ 1. The service re...