NewThe Learning module is now liveSee what's new
avatar
rohanverma98Sep 2, 2026

Oracle OA, harder than the easy reputation suggests

Interview Experiences
oracle

Oracle OA, harder than the easy reputation suggests

Sharing this since there isn't a lot posted about the Oracle OA specifically, mostly onsite stuff. Passed the OA and just moved on to the phone screen a few days later.

Question was a string manipulation problem on HackerRank. You get a lowercase string and each move lets you swap out a single character for any other letter. The goal is to figure out the minimum number of swaps so no two neighboring characters end up the same. Sounds simple until you actually sit down and try to prove greedy works, since the naive instinct is to just walk left to right and fix runs as you see them, but you have to be careful about how a run of the same letter three or four long gets handled without accidentally creating a new collision with whatever comes after it.

Follow up was basically the same question but they asked what changes if you're restricted to only two letters in the whole alphabet, which forces you to think about parity instead of just greedy scanning.

All test cases had to pass on HackerRank, no partial credit really counted for much. Be familiar with these concepts, greedy proofs come up more than people expect for something billed as an easy round.

7761.1k

Replies (4)

avatar
vikram.patelSep 2, 2026

the two letter follow up is a nice touch, most companies just stop at the base problem

30
avatar
User-s6c0pSep 2, 2026

did they let you pick language freely or was it fixed to something specific?

26
avatar
rohanverma98Sep 2, 2026

picked python, seemed fine on their end

40
avatar
User-vpwcjSep 2, 2026

thanks for sharing, oracle OA writeups are rare

25
avatar
gracewang0912Sep 2, 2026

test cases on hackerrank for oracle screens are brutal, definitely stricter than I expected too

25
avatar
noahdavisSep 2, 2026

yeah I got timed out on an edge case even though my logic was right

32
No more replies