Step 1: Shopping cart
You are building a checkout system for shop which only sells apples and oranges. Apples cost 60p and oranges 25p. Build a checkout system which takes list of items scanned at the till and outputs the total cost. For example: [ Apple, Orange, Apple ] => £2.05 Make reasonable assumptions about the inputs to your solution; for example, many candidates take a list of strings as input
Step 2: Simple offers
The shop decides to introduce two new offers
buy one, get one free on Apples 3 for the price of 2 on Oranges
Update your checkout functions accordingly
Campbell Ritchie wrote:How long did they give you for this exercise? Did you ask you to create it during the interview? Where did you have your Git repository? How long did you take to create that app? I presume you didn't get the job?
I would worry a lot about somebody who didn't try to have a working prototype in 15 minutes. They want to see the way you handled the task, your code style, etc. Adding all those other things would worry me too, becuase it would raise suspicions about whether you are going to spend all your time doing extraneous things which add nothing to the value of the product. Also the way you wrote raises suspicions that you are trying to work out implementation details before deciding what to do.
Your thread title “Open ended interview question - How to tackle” doesn't tell us what the thread is about.