{"id":22546492,"url":"https://github.com/tailsdotcom/coding-test-pricing-service","last_synced_at":"2026-01-07T22:03:11.178Z","repository":{"id":74359945,"uuid":"110836323","full_name":"tailsdotcom/coding-test-pricing-service","owner":"tailsdotcom","description":"Backend developer interview test","archived":false,"fork":false,"pushed_at":"2019-04-25T09:37:35.000Z","size":11,"stargazers_count":0,"open_issues_count":0,"forks_count":5,"subscribers_count":22,"default_branch":"master","last_synced_at":"2025-02-02T09:31:03.547Z","etag":null,"topics":["keep"],"latest_commit_sha":null,"homepage":"","language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tailsdotcom.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-11-15T13:23:59.000Z","updated_at":"2023-07-13T15:33:41.000Z","dependencies_parsed_at":null,"dependency_job_id":"7eac441e-f05e-4892-9b4b-5cd46d48e1db","html_url":"https://github.com/tailsdotcom/coding-test-pricing-service","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tailsdotcom%2Fcoding-test-pricing-service","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tailsdotcom%2Fcoding-test-pricing-service/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tailsdotcom%2Fcoding-test-pricing-service/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tailsdotcom%2Fcoding-test-pricing-service/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tailsdotcom","download_url":"https://codeload.github.com/tailsdotcom/coding-test-pricing-service/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245999320,"owners_count":20707554,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["keep"],"created_at":"2024-12-07T15:08:00.796Z","updated_at":"2026-01-07T22:03:11.101Z","avatar_url":"https://github.com/tailsdotcom.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"# Coding Test: Pricing Service\n\nThank you for taking the time to complete our coding test. Your challenge is to\nrecreate a hypothetical version of our internal pricing service. \n\nYou can use any language, framework and/or library for this test. We want to \nsee how you think about and solve problems in code, so make sure there is a \ndecent chunk of your own code in there.\n\nFeel free to **spend as much or as little time as you'd like** as long as the \nspecified functionality is complete. As a ballpark, the test should take around\n90 minutes of development time.\n\n\n## Building the API\n\nUsing the [pricing data](./pricing.json), build a RESTful API endpoint that \naccepts requests like the one below.\n\n```json\n{\n    \"order\": {\n        \"id\": 12345,\n        \"customer\": {},\n        \"items\": [\n            {\n                \"product_id\": 1,\n                \"quantity\": 1\n            },\n            {\n                \"product_id\": 2,\n                \"quantity\": 5\n            },\n            {\n                \"product_id\": 3,\n                \"quantity\": 1\n            }\n        ]\n    }\n}\n```\n\nThe endpoint should return a data structure which includes:\n\n* the total price for the order\n* the total VAT for the order\n* the price and VAT for each item in the order\n\nData structure for the response is up to you.\n\nAll monetary values in the `pricing.json` file are in pennies (pound sterling, `GBP`).\nThe calculated results should be in pennies too.\nAny rounding should use standard arithmetic rounding to the nearest penny.\n\n\n## Going international\n\nIn this hypothetical universe we have decided to launch tails.com overseas. We \nnow want the pricing service to return prices in any currency. Those prices \nshould be calculated using the latest available exchange rate.\n\nExpand the API to allow a currency to be submitted as part of the request, and \nreturn the prices in that currency. How that currency code is passed in is up \nto you. \n\nUse a currency conversion rate API like \n[free.currencyconverterapi.com](https://free.currencyconverterapi.com/) \nto get the latest exchange rates as part of your solution. (Hint: you might \nwant to think about how to cache that data).\n\nFor the purposes of the test, assume the same VAT rates apply to all countries \nand currencies.\n\n\n## Testing\n\nWe would like to see some tests written in the testing framework of your choice\nfor the pricing logic. \n\nIf you do not have time to write tests, tell us how you\nwould test the pricing logic works as intended. For example: what level of \ntesting, what sorts of test cases, etc.\n\n\n## Submitting\n\nOnce you are happy with your code, zip it up and email it back to us along with \nanswers to the following questions:\n\n1. What command(s) do we run to install and start your server?\n2. If you had more time, what improvements would you make if any?\n3. What bits did you find the toughest? What bit are you most proud of? In both\n   cases, why?\n4. What one thing could we do to improve this test?\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftailsdotcom%2Fcoding-test-pricing-service","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftailsdotcom%2Fcoding-test-pricing-service","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftailsdotcom%2Fcoding-test-pricing-service/lists"}