Skip to content

Instantly share code, notes, and snippets.

@haltaction
Forked from f3ath/sw-design-challenge.md
Created June 21, 2017 13:47
Show Gist options
  • Save haltaction/85597a834ffa94c8e04a4360bc5ad5bf to your computer and use it in GitHub Desktop.
Save haltaction/85597a834ffa94c8e04a4360bc5ad5bf 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