This time Microsoft 26NG SDE OA, the overall difficulty is still relatively basic, but clear thinking + speed of implementation are the key. Many students will underestimate Microsoft OA, but in fact the main sticking points are in detail processing and time allocation.
I did it in the morning this time, and the two questions took about 20 minutes to go directly to AC, and the pace was very smooth. Simply organize the questions and core ideas to provide a reference for students who want to do it later.

T1: Jump maximum score
Question description
The player starts from index 0 and reaches the goal n-1. Each time you can:
- Move 1 step to the right
- Or jump p steps to the right (p is a prime number whose ones digit is 3)
Each time a position is reached, the points for that position will be accumulated to find the maximum total score.
Core idea
The essence of this question is a one-dimensional DP + special step size set:
Step 1: Preprocess all steps that meet the conditions
- Exist
[1,n]Sieve prime numbers in range (Ehrstein sieve) - Filter out prime numbers with units digit 3 (such as 3, 13, 23, …)
Step 2: DP transfer
- Definition
Dp[i]Represents the maximum score to reach i - Initialization:
Dp[0] = score[0]
Transfer logic: From i you can go to:
I+1I+p(p belongs to the set of legal prime numbers)
Update: dp[j] = max(dp[j], dp[i] + score[j])
T2: Minimal operation to change n to 0
Question description
Given a positive integer n, each time you can:
- Add or subtract one
2^i
Find the minimum number of operations such that n becomes 0.
Core idea
This question is actually a variation of the classic question. The essence is:
Convert n to non-adjacent form (NAF)
Or understood as "binary greedy with carry"
Greedy strategy
Processing starting from the lowest bit:
- If n is an even number → shift right directly
- If n is odd:
- Look at the last two:
01→ Decrease 1 (to 00)11→ Add 1 (better to trigger carry)
- Look at the last two:
Are you worried about autumn/spring recruitment/internship OA in big factories?
Programhelp provides professional, efficient and safe OA writing services, specially designed to escort autumn recruitment, spring recruitment and internship OA of large companies, helping you easily pass the first level and go straight to the interview!
Core advantages:
- Deeply familiar with the question judging rules of mainstream platforms such as HackerRank, Niuke.com, CodeSignal, etc., accurately control runtime, memory and hidden test cases, and submit 100% green code (no WA/TLE/MLE).
- Using a secure remote desktop + traceless operation mode, you actually control the submission, leaving no traces of taking the exam, effectively avoiding proctoring, behavior detection, code duplication checking and AI detection.
- The service covers OA platforms commonly used by major manufacturers such as Amazon, Meta, Uber, Byte, Alibaba, Tencent, Airbnb, Robinhood, etc. It also supports LeetCode Contest, AtCoder, etc.
- No pass full refund, zero risk guarantee.
- Quickly evaluate and provide a plan within 30 minutes after receiving the order, support time-limited OA to make changes while making, and ensure that the optimal solution is submitted before the deadline.
Need OA ghostwriting , contact us anytime!