Skip to content

Instantly share code, notes, and snippets.

@f3ath
Last active June 21, 2017 13:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save f3ath/d9a7692189c3e986c2f6824a5e2fb903 to your computer and use it in GitHub Desktop.
Save f3ath/d9a7692189c3e986c2f6824a5e2fb903 to your computer and use it in GitHub Desktop.
  1. Design the object model for a currency conversion library. Assume you're working for a bank which allows its clients to deposit money into their USD account. Customers have cash in different currencies and want to know the amount in USD which will be added to their account. You want to create a library for a widget which calculates the resulting amount in USD.
    UI looks like this:
[Currency name] [Amount] 
[Currency name] [Amount] 
[+] 
… 
[Resulting amount in USD] 

The actual rates are available as JSON array [{"code": "EUR", "name": "Euro", "rate": 1.2345}, …]

  1. Add discounted rates for amounts over $333.33 (111.12 + 222.21)
  2. Some users are VIP, we want to add a 1% bonus to the resulting amount
  3. Add a backup source URL in case the request is taking longer than 1 second
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment