
This OA had two questions: one algorithmic and one debugging-oriented. Overall difficulty was manageable, but execution pace mattered.
Q1: Minimum movement cost on a ring in target order
You are given a ring. From each position, you can move left or right, and the movement cost is time[i]. Start from 1, visit targets in order, and compute the minimum total cost.
Since the input size is small (time.length around 5000), preprocessing is enough:
- Build prefix sums for
O(1)clockwise path queries - For any
u -> v:- Clockwise cost = prefix sum difference
- Counterclockwise cost = total ring sum - clockwise cost
- Add
min(clockwise, counterclockwise)for each transition
Complexity:
- Preprocessing
O(n) - Per transition query
O(1) - Total
O(n + q)whereqis number of targets
Q2: SpringBoot code fix task with built-in AI
The OA provided three frameworks; I picked SpringBoot. The task was to fix existing code and pass all tests.
This is mainly a simulation/debugging problem. The key challenge is fast root-cause localization.
The prompt includes built-in AI interaction. My workflow:
- Read the known-issue hints first
- Use AI to narrow down suspicious modules quickly
- Apply minimal targeted fixes
- Re-check edge cases to avoid regressions
Difficulty is not high, but speed in locating the bug decides the outcome.
Key takeaways
- Q1: use prefix sums to make each move query
O(1) - Q2: combine prompt hints and AI to locate bugs quickly
- For both: prioritize stable implementation and first-pass success
Support is available for both OA and VO. Feel free to reach out.
#sde #newgrad #jobsearch #oa #amazonoa
If you are preparing for Amazon OA/VO, feel free to reach out for problem breakdowns, variant practice suggestions, and interview prep direction.
Further Reading (External Links)
Need real interview questions? Contact WeChat Coding0201: Get Questions.
Contact
Email: [email protected] Telegram: @OAVOProxy