Compass Interview Question: Write a program to convert a ... | Glassdoor

Interview Question

Software Engineer Interview New York, NY

Write a program to convert a the representation of a number

  in one base to its representation in another base, where the bases can range from 2 to 36. char* convert(char* number, int fromBase, int toBase); essentially.

Interview Answer

2 Answers


Probably not the most elegant, but simply converted the input from the source base to its base 10 representation and then from its base 10 representation to the target base.

Interview Candidate on Jan 30, 2016

Something like this:

Adam on Feb 4, 2016

Add Answers or Comments

To comment on this, Sign In or Sign Up.