Just accompanied a trainee this morning to complete Microsoft corporation SDE OA. He was so relieved when he was done that he was able to pass both questions in one go, in less than 20 minutes.
He said, "Luckily you guys were around to help me keep an eye on the boundary conditions, otherwise I would have been stuck for half a day on the first problem dichotomy." This article to restore his actual process. I hope it will be helpful to the students who are preparing for the battle.
Microsoft Online Assessment Overall Process
Microsoft's OA is generally available through Codility / HackerRank / CodinGame The platform is completed and the overall process is as follows:
1️⃣ Approx. 1-3 weeks after successful delivery OA Invitation Received
2️⃣ Completion of the test (approximately 90 minutes)
3️⃣ Results come out in 1 to 2 weeksThe high scorers will be invited for VO interviews with HR.
🔹 The overall form is:
- 2~3 programming questions(Algorithm category)
- 1 video answer to behavioral questions(Behavioral)
Q1. Monotonic Array Purchase Queries
Problem (English version).
You are given a non-decreasing array prices[]. There are multiple queries, each query gives.
- a starting index
l - a budget
X
For each query, you can only buy a contiguous segment starting from l. Find the maximum number of items you can purchase without exceeding the budget.
Key Idea.
- Precompute prefix sums.
- For each query, binary search the farthest position
rSuch thatprefix[r] - prefix[l-1] <= x. - Answer is
r - l + 1(if valid).
prefix[0] = 0
for i in [1..n].
prefix[i] = prefix[i-1] + prices[i]
for each query(l, x): // binary search for max r
// binary search for max r
left = l, right = n, ans = l-1
while left <= right.
mid = (left + right) / 2
if prefix[mid] - prefix[l-1] <= x.
ans = mid
left = mid + 1
else: right = mid - 1
right = mid - 1
result = max(0, ans - l + 1)
Learning process:
He initially wanted to start over from l Started counting local prefix sums, and was reminded by our voice that the global prefix sum is sufficient, just do the difference.
In addition, the boundaries of the dichotomy ans - l + 1 It's easy to misspell, and we've hinted at key moments to avoid off-by-one errors.
✅ The final code runs once.
Q2. Token System Simulation
Problem (English version).
Implement a system that supports three operations.
generate(token, expiryTime)→ create a new token with expiration time.renew(token, newExpiry)→ update the token's expiration time.count(currentTime)→ return the number of tokens not expired atcurrentTime.
Key Idea.
- Use a hash map to store the latest expiry time of each token.
- Use a min-heap / priority queue to store
(expiry, token)for cleanup. - Lazy deletion: when querying, remove heap top if it's expired OR outdated compared to the hash map.
map expiryMap
priority_queue<pair, vector, greater> pq
generate(token, t).
expiryMap[token] = t
pq.push({t, token})
renew(token, t): if token exists: pq.push({t, token})
if token exists: expiryMap[token] = t
expiryMap[token] = t
pq.push({t, token})
count(currentTime): while !
while !pq.empty() and (pq.top().expiry <= currentTime)
or pq.top().expiry ! = expiryMap[pq.top().token]).
pq.pop()
return expiryMap.size()
Learning process:
He tried to use it at first. set to maintain all the tokens, but can't write on the update operation.
We remind:
- expense or outlay map to store the latest expiration time.
- expense or outlay priority queue To assist in doing cleanup, use "delayed deletion".
He got it instantly and wrote the sample and passed it in one run.
✅ The key point is the "lazy cleanup", which we give in the voice.
Microsoft OA Experience Sharing
This time, the OA platform has no camera, and the environment is very relaxed. The trainee wrote the code by himself, and we were on-line without any trace to help him grasp the ideas and details. The whole process is very smooth, 20 minutes to hand in the paper, two questions AC.
post-exam summary
The overall difficulty level of Microsoft's OA is not that high, but it likes to examine some "common template questions + details that are easy to get wrong":
- Prefix Sum + Binary Search: Simple logic, but easy to get stuck on bisection boundaries and hang if you write one bit less/more.
- Priority Queue + Hash Map Simulation: Typical 'delayed deletion' routine, if you haven't seen it before you'll mess it up.
The real challenge is not the question itself, but getting it right in one sitting under time pressure.
Many students focus only on problem solving ideas in preparation, but in the real world it is often because:
- The dichotomous condition is written incorrectly
- Heap and map synchronization bug
- Forget to consider the boundary/empty array case
And get stuck and waste a lot of time.
This trainee experience also proved:
With preparation for high-frequency questions and a reminder at key points, you can shorten a pitfall that could take up to half an hour to debug to one minute.
So to summarize:
Microsoft OA is not tricky, but it is definitely an exam where "details determine success or failure". Practicing common routines in advance and avoiding distractions on the spot are the keys to success.
Take you to get the big factory Offer
This time to help students to get Microsoft OA, the process also once again proved a fact: big factory written test is never "will do it", but "will be fast + will be stable + can avoid stepping on the pit".
Many students usually brush a lot of questions, but really on the field is easy to be pressed by the time of mind collapse, or by some small details stuck half a day.
we programhelp remote assists solve these pain points exactly:
- No Trace Interview Aid: Real-time text assistance during the interview to ensure that there is no "sudden confusion";
- voice reminder: Real-time voice assistance during interviews, such as boundary conditions for dichotomization and small pitfalls in data cleaning, we will prompt in time to avoid wasting time on subsequent debugging;
- Full Link SupportWe have a variety of programs from OA to VO and ultimately onsite to help you get up to speed in the real world.
If you are also preparing for OA/interviews at Microsoft or other big companies, you don't have to carry on alone.
With assistance + voice + technology under your belt, you'll find it much easier to prepare and take the test.