Take a number and give the equivalent number in British English words, without using a tokenizer, or any external libraries, clever regex’s or the like.
For example:
- 1 = one
- 27 = twenty seven
- 115 = one hundred and fifteen
- 3700 = three thousand seven hundred
- 56945781 = fifty six million nine hundred and forty five thousand seven hundred and eighty one
- 126000010 = one hundred and twenty six million and ten
- etc..
- up to 999999999 = nine hundred and ninety nine million nine hundred and ninety nine thousand nine hundred and ninety nine… I think ;)
As a pointer on what we’re looking for:
- Clear separation of concerns & general good OO practices
- Well defined objects / interfaces
- Application of patterns to solve the problem
- Testing and CI considerations
don’t spend days on this, it is meant to be a quick test… but it is important