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.
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
Daniel Demesmaecker wrote:When you try to move a package inside the same project, it will refactor.
If you move a package from on project to an other it will copy.
A cleaner solution is to create one main project and import all the other projects as seperate modules.
By the way, I also think this is more a question for the Ide forum
Jeanne Boyarsky wrote:Kevin,
Your .classpath file on the work computer specifies the "source directories". It looks you didn't commit this to the github repo. Which means, you are using the defaults on checkout.
Jeanne, is it your experience that .project and .classpath files (or any IDE-specific files) should be included in the git repository?
You have three stacks of cylinders where each cylinder may vary in height.
You can change the height of a stack by removing and discarding its topmost cylinder any number of
Find the maximum possible height of the stacks such that all of the
stacks are exactly the same height.
This means you must remove zero
or more cylinders from the top of zero or more of the three stacks
until they're all the same height, then print the height.
The removals must be performed in such a way as to maximize the height.
Note: An empty stack is still a stack.
Liutauras Vilda wrote:Looking to Piet's tip (missed it before), I must say I like it too. I have solution ready.
I really advise to follow Piet's suggestion, certainly easier approach than I had initially in my mind.
Anyway, go small.
First thing is to figure out how to normalize string/anagram. There is a habitual approach or using streams. As for habitual, think if you could convert string to an array of(?) and use Collections class to sort it? So later you could construct back the string from sorted array. Using streams api is slightly easier.