microsoft logo
Microsoft· senior software engineer

Microsoft Online Assessment | Senior Software Engineer

Result
rejected
Posted
22 Aug 2025
310 reads

Summary

I recently attempted the Microsoft coding assessment for a senior software engineer role. The process was extremely challenging, with two complex problems that tested my problem-solving abilities. Despite the difficulty, I was unable to complete the problems within the time limit, leading to a negative outcome.

How it went

Hi All,

Recently I gave coding assessment of microsoft

problem1:

Find a subsequence of skills , call it x of length m such that there are at most k indices where x[i]!=x[i+1] for all 0<=i

example:

skills [1,1,2,3,2,1]

k=2

ans=5

Explanation: the longest possible subsequence: 1 1 2 2 1

Note: I dont remember the complete problem statement.

problem 2:

Count distinct arrays of length n[i] with values in [1... m[i]] such that cost of finding the maximum element equals totalCost[i]

input:

[2,3,4][3,3,3] [1,2,2]

ans: [3 1 6]

explanation:

i=0

n=2 ,m=3 cost=1

possible arrays:

1,2

2,3

1,3

i=1

n=3, m=3 cost=2

possible arrays: [1,2,3]

i=2

n=4, m=3 cost=2

possible arrays:

[1,1,2,3] [1,1,2,4] [1,1,3,4]

[2,2,3,4] [1,2,2,4] [1,3,3,4]

**Microsoft could have directly rejected me ...instead of cooking my brain for 105 mins**

Questions asked (2)

  1. 01

    Longest Subsequence with Limited Transitions

    Data Structures & Algorithms

    Find a subsequence of skills, call it x of length m such that there are at most k indices where x[i] != x[i+1] for all 0 <= i < m.

  2. 02

    Count Distinct Arrays with Specific Cost Conditions

    Data Structures & Algorithms

    Count distinct arrays of length n[i] with values in [1... m[i]] such that the cost of finding the maximum element equals totalCost[i].

Know someone preparing? Send it to them:WhatsAppLinkedInX

Interviewed at Microsoft recently?

Write up your rounds while you still remember the questions. It helps the next person more than you would think.

Share your experience
Discussion 0

Questions for the author, or how your own interview compared.

Join the discussion

Sign in with Google to comment or ask the author a question.

No comments yet

Be the first to share your thoughts and start the discussion!