Code Kata Challenge – And the Winner Is…

BTI360 Blog / July 9, 2014 in 

We’d like to take the opportunity to say thank you to everyone who joined us in taking on our Code Kata Challenge. It was great to see so many people participate! But now on to the reason you all are here…/wp-content/uploads/2014/07/1stPlace.png

The award for 1st place of our Code Kata Challenge:

  • Implement a queue class using 2 stacks internally
  • The queue class should implement an insert and retrieve method
  • The 2 internal stacks should implement push and pop methods

Is Spencer!  Spencer, as our 1st place winner, will be the final recipient of Are You Smart Enough to Work at Google?!

There were several reason’s Spencer was selected as #1.

  1. Deque class – Most submissions used the Java Stack class. Per the JavaDoc the Deque class is now preferred.
  2. Java implementation, Groovy tests – Includes the use of the Spock testing framework.
  3. Gradle – Post uses the open-source build automation tool Gradle
  4. Github – Style points as a GitHub submission
  5. EvilStackBasedQueue – The most important is the “evil” found in the EvilStackBasedQueue class. The class has two internal stacks but only uses one of them; recursion provides the evil ingredient that allows the class to work correctly. Recursion itself can be thought of as using a stack, since recursive function calls push function metadata onto the stack portion of the program’s memory address space.

While the implementation is less efficient than the 2nd and 3rd place entries, Spencer does indicate in his documentation that he would have produced a more efficient solution, if he were not making the “evil” implementation.

When doing code katas, sometimes after implementing a solution in the normal or obvious way, a constraint can be imposed upon the problem in which the usual implementation method is not allowed, or somehow restricted. This winner is an implementation that uses a constraint we didn’t ask for, but could have, assuming that we’d have been able to come up with it ourselves at all!

“Implement a queue using one and only one internal stack!”

Congrats Spencer for a great submission!

Don’t forget Code Kata Night is tomorrow from 3-5pm! If you have not already received an invite from us you should click the link below by the end of the day today!

Request your invite here!

Previous

Code Kata Challenge – 2nd Place: A Unique Submission

Next

Can you solve this code kata?

Close Form

Enjoy our Blog?

Then stay up-to-date with our latest posts delivered right to your inbox.

  • This field is for validation purposes and should be left unchanged.

Or catch us on social media

Stay in Touch

Whether we’re honing our craft, hanging out with our team, or volunteering in the community, we invite you to keep tabs on us.

  • This field is for validation purposes and should be left unchanged.