Category: Interval-based system design problem# Top 5 Recently Asked System Design Questions - Microsoft These are the commonly asked system design questions from Microsoft interviews and some...Input: List Output: Computed result
codingMediumVerified Question#2
2. Design Rate Limiter
Category: Sliding window coding problem# Design Rate Limiter Design a rate limiter system that controls the number of requests allowed within a specified time window. The rate limiter is...Input: String Output: Computed result
Category: Trie-based coding problemInput: String Output: Computed result
codingMediumVerified Question#4
4. Object Oriented Design - Notification Service
Category: Trie-based coding problem# Problem Statement Design a notification service that supports sending notifications through multiple channels (SMS, Email) and is architected to...Input: Number(s) Output: Computed result
codingMediumVerified Question#5
5. Shortest Substring with N Unique Characters
Category: String coding problem# Shortest Substring with N Unique Characters *This is a variation of the leetcode problem* Given a string s and an integer n, find the length of...Input: String Output: Computed result
codingHardVerified Question#6
6. Rate Limiter
Category: Sliding window coding problemDesign a rate limiter that tracks API requests per client and enforces limits using a sliding time window. Your system must support: - hit(key,...Input: Given input Output:** Computed result
codingHardVerified Question#7
7. Non-Adjacent Team Selection
Category: Tree coding problem# Question You are given n people labeled from 0 to n - 1. Some pairs of people know each other directly. These relationships are given as a...Input: List Output: Computed result
codingMediumVerified Question#8
8. Bounded Repeat Substring
Category: String coding problemA sensor data stream is represented as a string of characters. A contiguous segment of the stream is considered valid if it contains no three...Input: String Output: Computed result
codingMediumVerified Question#9
9. OA [CodeSignal] Prime Jumps
Category: Algorithm coding problem# OA [CodeSignal] Prime Jumps A game is played with the following rules: - A player starts at cell 0 with a score of 0. - There is a row of n cells...Input: Number(s) Output: Computed result
codingHardVerified Question#10
10. Combine N-ary Trees
Category: Tree coding problemYou are given the roots of two N-ary organization charts, each representing a hierarchical department structure. Every node has an integer...Input: List Output: Computed result
codingMediumVerified Question#11
11. Digit Replacement Maximizer
Category: String coding problemA numeric optimization system performs exactly k substitution operations on a number string s. In each operation, choose any digit in s that is...Input: String Output: Computed result
codingMediumVerified Question#12
12. Best Window For Target Count
Category: Trie-based coding problemA log analysis tool searches for the most frequent occurrence of a specific error code within a fixed-size window of log entries. Given an integer...Input: Array Output: Integer
codingMediumVerified Question#13
13. Evens Before Odds
Category: Array coding problemYou are given an integer array nums. Rearrange nums so that all even numbers appear before all odd numbers. The relative order of even or odd...Input: Array Output: Integer
system designSeniorapi design#1
1. [OA] Service Health Monitor – Design a class to monitor service health in Azure
Microsoft needs a robust system to track and manage the health of various services across its cloud environments. You will design a Service Health Monitor to detect and report service disruptions. Your task is to: - Create a class that monitors services and returns health status. - Include methods to log status and send alerts based on predefined thresholds.Example 1: Input: monitor = ServiceHealthMonitor(); monitor.check_service('AzureStorage') Output: Service 'AzureStorage' is healthy. Explanation: Successfully checks the health status of the specified service and logs it.Constraints: - Must check service status every 5 minutes. - Must handle at least 10 different services concurrently.
system designSeniorci cd#2
2. [OA] CI/CD Pipeline – Design a scalable Continuous Integration pipeline for Azure DevOps
Continuous Integration (CI) is vital for teams at Microsoft to ensure code quality and rapid delivery. Design a scalable CI pipeline that can handle multiple repositories and parallel builds for high demand. Your task is to: - Create a system that can manage build jobs for several repositories at once. - Include a function to trigger builds based on pull requests.Example 1: Input: trigger_build(pr=True, repo='repo1') Output: Build initiated for repo1 for pull request. Explanation: Triggers build when a new pull request is made and verifies the main branch.Constraints: - Must support at least 50 parallel builds. - Should allow build configurations for multiple types of applications.
codingHardinfra#3
3. [OA] Terraform State Management – Implement a locking mechanism for Terraform state files
In Microsoft Azure, managing Terraform state is essential for team collaboration and preventing conflicts during deployments. You will design a mechanism for locking state files during updates. Your task is to: - Implement a locking mechanism to ensure that only one update can occur on the Terraform state at any time. - The lock should be released after the deployment completes.Example 1: Input: apply(config) when state is locked Output: State is locked. Please try again later. Explanation: Ensures no concurrent modifications take place during updates.Constraints: - Lock should not last longer than 30 minutes. - Must handle failures gracefully and ensure lock release.
codingMediumci cd#4
4. [OA] Docker Optimization – Optimize the build process of a Docker image for Azure services
Microsoft needs to ensure that its cloud services operate with efficiency and speed across its infrastructure. One critical aspect is how quickly Docker images can be built and deployed. In this problem, you will optimize the Dockerfile for a microservice that needs to be deployed on Azure Kubernetes Service (AKS). Your task is to: - Optimize the Dockerfile to reduce the image size and build time. - Identify and eliminate unnecessary runtime dependencies. - Implement multi-stage builds if applicable.Example 1: Input: FROM node:14 Output: FROM node:14 AS build COPY . /app RUN npm install && npm run build FROM node:14 COPY --from=build /app/dist /app CMD ["node", "/app/index.js"] Explanation: Using multi-stage builds reduces the final image size by excluding build artifacts.Constraints: - Dockerfile must be optimized to under 100 MB. - Must not increase build time by more than 20%.