Softwire Speed Coding Challenge – An Introduction


9 April 2012, by

Softwire recently hosted their second speed coding challenge, after the inaugural competition proved to be a resounding success. The competition was open to current employees (and recently departed interns) and was designed to give everyone a chance to show off their ability to code solutions to a variety of problems in as short a time as they can!

Entrants discussing an early question

Over the course of the next few months, I’ll be adding some details of the questions that were asked and discussing the winning answers (as well as announcing the eventual winner). In this post, I’ll explain the format of the night and the scoring system used and will give you the first question, so you can give it a shot yourself!

The night was organised by Rich Bradley, winner of the challenge last year. Questions were created by Rich and were designed to be challenging (but solvable) programming puzzles which would take 30-45 minutes each. Any programming language could be used, although C# was by far the most popular.

In total, there were four questions to be answered. Two questions were set before a brief pizza break (paid for by Softwire morale) with the final two questions being set after everyone had recovered their strength!

For each question, points were given based on the speed of the (correct) response, with a maximum of 5 points for 1st place, 4 for 2nd, 3 for 3rd and so on. In addition to this, extra style points (maximum 3 in total per question) could be given on the discretion of the reviewing team!

Questions could go on as long as necessary until someone got an answer, at which point everyone else would have half as much time again to finish (so a question answered correctly in 20 minutes would be ended after a half-hour).

So… without further ado, here’s the first question. Why not give it a try yourself? We’ll publish the winning answer in the next post.

Question 1 – Grid and row/column rotations

You have a four by four grid with a default starting configuration:

1    2    3    4
5    6    7    8
9    10   11   12
13   14   15   16

Define transformations on the grid as follows:

  • R1 means shift row 1 one space to the right, and wrap around, so starting from the original table, row 1 becomes {2, 3, 4, 1}
  • Similarly R2 changes row 2 to {6, 7, 8, 5}, etc.
  • C1-C4 do a similar thing on each column, i.e. {1, 5, 9, 13} becomes {5, 9, 13, 1}, etc.

So we have eight different transformations: R1 … R4, C1 … C4. Starting with the default starting configuration, how many distinct sequences of nine transformations result in the first column changing from {1, 5, 9, 13} to {1, 2, 3, 4}?

Check: 102,048 sequences of nine transformations leave the first row unchanged. NB – inefficient programs may take several minutes to determine this result, which may slow you down.

next article in series

Tags: , , , ,

Categories: Social, Softwire

«
»

Leave a Reply

* Mandatory fields


× two = 4

Submit Comment