Integer to Roman

Asked atMeesho
1Give yourself 5 minutes
2Answer out loud, not in your head
3Then compare with the answer below
0
Stuck? Show a way to structure it+
  1. 01List symbols including subtractive values
  2. 02Process values from largest to smallest
  3. 03Append while the remaining number permits
  4. 04Subtract each appended value
  5. 05Validate input range

Reference answer

Then expect these follow-ups

  • How would you parse Roman back to integer?

    Tests: follow-up reasoning

  • Why is greedy safe only with the right symbol table?

    Tests: correctness reasoning

Free to read · better with Enzo

Practice this out loud with Enzo

Enzo runs it as a mock interview, pushes back with follow-ups, and grades you on the rubric.

Next question