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

Hiring now

Meesho has 34 open roles right now

landed applies to roles like these for you, on each company’s own site, with answers written for the role.

Get 5x interviews10 free auto-applies. No card.
  • Graphic Designer

    Bangalore, Karnataka

  • Deputy Manager- FP&A

    Bangalore, Karnataka

  • Security Engineer III - Infra Security

    Bangalore, Karnataka

Or practice this question first

Next question