Microsoft Interview Questions (20+ Questions)
Last Updated: July 7, 2026 β’ 20 Questions β’ Real Company Interviews
Prepare for your Microsoft interview with our comprehensive collection of 20+ real interview questions and detailed answers. These questions have been curated from actual Microsoft technical interviews across various roles including DevOps Engineer, Data Engineer, QA Engineer, and more.
Table of Contents
- Troubleshoot systemd Startup Failure (medium) π
- Uptime and Load Average Audit (easy)
- Automated Archive and Retention (hard)
- Zombie Process Reaping with Init System (medium) π
- Commit-Based CI/CD Image Tagging (easy) π
- Docker Image Tagging with Commit SHA (medium)
- Kth Largest Element in an Array (medium)
- Word Ladder (hard)
- Fix Missing SAN in TLS Certificate (easy) π
- Trend Detection with LAG Window Function (easy) π
- Track Product Purchases (hard)
- Species Climate Aggregation (easy)
- Daily Category Sales Aggregation (easy)
- Log Aggregator (medium)
- E-commerce Cart Abandonment Rate (medium) π
- Top Three Salaries (medium)
- Plus One (easy)
- Subsets II (medium)
- Order Status Revenue Analysis (medium) π
- Basic Element Interaction Testing (easy) π
Our Microsoft interview questions cover a wide range of technical topics and difficulty levels, from entry-level positions to senior roles. Each question includes detailed explanations and answers to help you understand the concepts and prepare effectively for your interview.
π‘ Pro Tips for Microsoft Interviews
- Practice each question and understand the underlying concepts
- Review Microsoft's specific technologies and methodologies
- Prepare follow-up questions and edge cases
- Practice explaining your solutions clearly and concisely
Interview Questions & Answers
1. Troubleshoot systemd Startup Failure
2. Uptime and Load Average Audit
We have a Linux server and we need to evaluate its performance. We need to use uptime and determine how long the server has been running and extract the 15 minute load average and save uptime to uptime txt, and then load average to the load average txt files. Those load averages stands for five, 10, and 15 minute load average. Since we've been asked to provide 15 minute load average, we'll use the last line.
3. Automated Archive and Retention
We have files in ETC folder that are at risk of being lost due to accidental changes or deletion. We need to write a script that accepts target backup path as a command line argument, creates a compressed archive of ETC directory with the naming format ETC backup year, month, day Tar gc, and automatically removes backups older than seven days. Then we need to create a CR job that will run file every time at 2:00 AM in the morning. Once file is created, give it an execution permission. We create a conditional statement where we say that if the argument number one, meaning the expected target location is not provided, it'll throw an error saying backup directory path is required. Then the main command to archive the file. We implement this option that we need to delete files that older than seven days. We'll use find command for this, and this M time plus seven delete command to delete files that are older than seven days. Chron TAP E will edit the chron tab. We'll type zero, two star, star, star, which will run it every day at 2:00 AM.
4. Zombie Process Reaping with Init System
We'll have a container where child processes are turning into zombies after they finish. The main process runs as PID 1, but doesn't know how to clean up, which is reap its dead children. When a process finishes executing, it doesn't fully disappear immediately. Rather, it stays in the process table...
π Premium Content
Detailed explanation and solution available for premium members.
5. Commit-Based CI/CD Image Tagging
We already have a working CI/CD pipeline that builds and deploys a Docker image. The problem is that it tags everything as myapp:latest. So there's no way to tell which commit a running container came from. Our task here is that we need to replace latest with a short commit SHA. Every commit in Git ...
π Premium Content
Detailed explanation and solution available for premium members.
6. Docker Image Tagging with Commit SHA
We have a repo with a Dockerfile, but no CI/CD pipeline setup. We are given a starter workflow file with just the basic structure, and we need to complete it. The goal is that every time someone pushes to main, a Docker image named app gets built and tagged with a short commit SHA. Every commit in Git has a unique hash. The short version is just the first seven characters. We get it by running git rev-parse --short head. Each step runs in its own shell, so a regular variable in one step doesn't exist in the next. GitHub Actions provides a mechanism called github_env that lets us share values across steps. Actions/checkout pulls the code from the repo into this runner so that the steps after it can actually access the Dockerfile and build the image. It grabs the first seven characters of the current commit hash and puts it in a variable called TAG. This builds a Docker image and tags it as app:env.TAG.
7. Kth Largest Element in an Array
def find_kth_largest(nums: list[int], k: int) -> int:
min_heap = []
for num in nums:
heapq.heappush(min_heap, num)
if len(min_heap) > k:
heapq.heappop(min_heap)
return min_heap[0]
8. Word Ladder
def ladder_length(begin_word: str, end_word: str, word_list: list[str]) -> int:
if end_word not in word_list:
return 0
word_list.append(begin_word)
adj = defaultdict(list)
for word in word_list:
for j in range(len(word)):
pattern = word[:j] + "*" + word[j+1:]
adj[pattern].append(word)
q = deque([begin_word])
visited = set([begin_word])
res = 1
while q:
for _ in range(len(q)):
curr_word = q.popleft()
if curr_word == end_word:
return res
for j in range(len(curr_word)):
pattern = curr_word[:j] + "*" + curr_word[j+1:]
for neighbor in adj[pattern]:
if neighbor not in visited:
visited.add(neighbor)
q.append(neighbor)
res += 1
return 0
9. Fix Missing SAN in TLS Certificate
Inspect a server certificate to identify missing Subject Alternative Name (SAN) entries and reissue it with the correct DNS names.
10. Trend Detection with LAG Window Function
How to Determine Monthly and Quarterly Sales Trends from the monthly_metrics Table
In an SQL-based data analytics interview, you might be asked to analyze sales data trends. One such challenge could be to determine both monthly and quarterly sales trends from a given table. Let's break down t...
π Premium Content
Detailed explanation and solution available for premium members.
11. Track Product Purchases
This is a Snowflake question, which is a cloud-based data warehouse that uses SQL and all its main concepts. We are given only one table that is called Transactions. Each row represents one purchase made by a customer. First, for each transaction, we need to find what product the customer bought most recently before the current one. Second, we need to create a new column, combine the date and that previous product into one string, and use the word none when there is no previous product. A CTE, or Common Table Expression, is a temporary result set that we define at the top of our query. Lag specifically within product ID row looks backwards, reaches to the previous row, and grabs its value. Partition by creates sort of a group for each customer. We wrap previous product in COALESCE function. COALESCE takes a list of values and returns the first one that is not null.
12. Species Climate Aggregation
WITH joined AS (
SELECT a., r.climate
FROM {{ ref("animals") }} AS a
INNER JOIN {{ ref("regions") }} AS r
ON a.region = r.region
)
SELECT
species,
climate,
ROUND(AVG(age), 2) AS avg_age,
FLOOR(AVG(weight)) AS avg_weight,
COUNT() AS total_animals
FROM joined
GROUP BY species, climate
13. Daily Category Sales Aggregation
Master daily sales aggregation in PySpark. Learn how to join transaction tables with product catalogs and use multi-column GroupBy operations to calculate total quantities sold per category per day.
14. Log Aggregator
from collections import defaultdict
import bisect
class LogAggregator:
def init(self):
self.logs = defaultdict(list)
def record(self, timestamp, key):
self.logs[key].append(timestamp)
def count(self, key, start, end):
if key not in self.logs:
return 0
timestamps = self.logs[key]
left = bisect.bisect_left(timestamps, start)
right = bisect.bisect_right(timestamps, end)
return right - left
15. E-commerce Cart Abandonment Rate
Understanding and Calculating the Cart Abandonment Rate in SQL
When managing an e-commerce platform, monitoring user behavior is crucial to optimize sales and customer satisfaction. One significant metric to track is the cart abandonment rate. This metric highlights the percentage of shopping c...
π Premium Content
Detailed explanation and solution available for premium members.
16. Top Three Salaries
SELECT
employee_name,
department_name,
salary
FROM
(
SELECT
e.employee_name,
d.department_name,
e.salary,
ROW_NUMBER() OVER (
PARTITION BY
d.department_name
ORDER BY
e.salary DESC,
e.employee_name ASC
) AS salary_rank
FROM
employee e
INNER JOIN department d ON e.department_id = d.department_id
) AS ranked_employees
WHERE
salary_rank <= 3
ORDER BY
department_name ASC,
salary DESC,
employee_name ASC;
17. Plus One
def plus_one(digits: list[int]) -> list[int]:
n = len(digits)
for i in range(n - 1, -1, -1):
if digits[i] < 9:
digits[i] += 1
return digits
digits[i] = 0
return [1] + digits
18. Subsets II
def subsets_with_dup(nums: list[int]) -> list[list[int]]:
nums.sort()
res = []
def dfs(i, current_subset):
if i == len(nums):
res.append(current_subset.copy())
return
current_subset.append(nums[i])
dfs(i + 1, current_subset)
current_subset.pop()
while i + 1 < len(nums) and nums[i] == nums[i + 1]:
i += 1
dfs(i + 1, current_subset)
dfs(0, [])
return res
19. Order Status Revenue Analysis
Analyzing Order Statistics in SQL: A Step-by-Step Guide to Writing the Perfect Query
Objective
In this task, you need to write an SQL query to effectively analyze the order statistics from a given table of orders. The table contains crucial information about each order, including its stat...
π Premium Content
Detailed explanation and solution available for premium members.
20. Basic Element Interaction Testing
Master basic element interaction testing with Selenium. Learn button clicks, element verification, and dynamic content validation....
π Premium Content
Detailed explanation and solution available for premium members.
Ready to Practice More?
Explore interview questions from other companies or try our hands-on labs to build practical experience.