Romanizer
Reported by candidates from Atlassian's online assessment. Pattern, common pitfall, and the honest play if you blank under the timer.
Atlassian's March 2024 Romanizer question is a string transformation problem that catches candidates off guard. You get a number, you need to convert it to Roman numerals (or vice versa). It sounds simple until you realize the edge cases and the order of operations matter. The trick is recognizing that Roman numeral conversion is about breaking down the number into symbol groups in descending order, not just pattern matching. StealthCoder will have the conversion logic and edge case handling ready if you blank on the constraints.
Pattern and pitfall
The core pattern here is greedy decomposition with a lookup table. You iterate through symbol-value pairs in descending order and greedily subtract as much as you can, appending the symbol each time. The hidden complexity is handling subtractive notation (IV for 4, IX for 9, XL for 40, XC for 90, CD for 400, CM for 900). Many candidates hardcode these cases but miss the structural pattern. If the problem asks for bidirectional conversion (number to Roman and Roman to number), the reverse requires parsing the string left-to-right and handling the subtractive rule. StealthCoder covers both directions and the full symbol set, so you won't waste time debugging off-by-one errors.
If you see this problem in your OA tomorrow, the play is to recognize the pattern in 30 seconds. StealthCoder buys you that recognition.
You can drill Romanizer cold, or you can hedge it. StealthCoder runs invisibly during screen share and surfaces a working solution in under 2 seconds. The proctor sees the IDE. They don't see what's behind it. Built by an Amazon engineer who passed his OA cold and still thinks the filter is broken.
Get StealthCoderRelated leaked OAs
This OA pattern shows up on LeetCode as integer to roman. If you have time before the OA, drill that.
You've seen the question.
Make sure you actually pass Atlassian's OA.
Atlassian reuses patterns across OAs. Built by an Amazon engineer who passed his OA cold and still thinks the filter is broken. Works on HackerRank, CodeSignal, CoderPad, and Karat.
Romanizer FAQ
Is this just a memorization problem?+
No. You need to understand subtractive notation (why IV comes before V, not after) and why greedy decomposition works. The pattern is algorithmic, not rote. The symbol pairs are a lookup, but the logic is the test.
What's the most common mistake?+
Forgetting that 4 is IV (not IIII) and 9 is IX (not VIIII). Candidates often implement the main loop but miss the subtractive cases entirely. Test with small numbers like 3, 4, 8, 9 first.
What if they ask for the reverse (Roman to number)?+
Parse left-to-right. If the current symbol is smaller than the next one, subtract it. Otherwise, add it. This is the inverse of the greedy decomposition. Both directions are commonly asked together.
Are there upper or lower bounds on the input?+
Typical constraints are 1 to 3999 (standard Roman numeral range). Some questions extend to 4000+, which requires handling vinculum notation (a bar over the symbol for thousands). Check the problem statement for limits.
How should I prep if I have 48 hours?+
Code the greedy decomposition once, test it with 1, 4, 9, 27, 49, 99, 444, 3999. Implement the reverse. That's it. You don't need more time. The pattern is small and concrete.