
This OA had two different styles: one algorithmic question and one engineering/debugging question. Difficulty was moderate, and execution speed mattered.
Q1: Minimum movement cost on a ring in target order
Problem
You are on a ring. From each position, you may move left or right. Passing index i costs time[i].
Start from position 1, then visit targets in the given order. Return the minimum total cost.
Interview-ready wording
With time.length around 5000, preprocessing is enough.
I build prefix sums so clockwise path cost is O(1) between any two points u -> v.
- Clockwise cost:
O(1)from prefix sums - Counterclockwise cost:
ringTotal - clockwiseCost - Step cost:
min(clockwise, counterclockwise)
Then I iterate through targets and accumulate costs.
Complexity
- Preprocessing:
O(n) - Per transition query:
O(1) - Total:
O(n + q)whereqis target count
Q2: Fix existing code in SpringBoot and pass tests
Problem style
Three frameworks were offered; I chose SpringBoot.
Goal: modify existing code and pass all test cases.
Interview-ready wording
This is mostly a simulation/debugging task. The main challenge is fast root-cause localization, not algorithm complexity.
The OA includes built-in AI interaction. My approach:
- Read the known-issue hints in the prompt first
- Use AI to narrow down failing modules and trigger conditions
- Apply minimal targeted fixes
- Re-check edge cases to avoid regressions
This question rewards debugging efficiency and clarity of reasoning.
Key takeaways for this OA
- Q1: avoid brute-force walking; prefix sums give stable
O(1)transitions - Q2: avoid random edits; combine prompt hints + AI for fast localization
- Both: control implementation pace for a high first-pass success rate
Support is available for both OA and VO. Feel free to reach out.
#sde #newgrad #jobsearch #oa #amazonoa
Further Reading (External Links)
Need real interview questions? Contact WeChat Coding0201: Get Questions.
Contact
Email: [email protected]
Telegram: @OAVOProxy