ThoughtWorks Interview Process – Part 1

I have applied to ThoughtWorks (TW) from their job portal. The process starts with a Coding Assignment (will explain details in a while). If they are satisfied with your solution, they would invite you onsite. In the office you have a written test, one code-pairing round, then an interview panel discussion, then a written test and if things go fine you meet the General Manager.After all these things you will be asked to take some predictive index survey. Thats it!! 🙂

Let me explain things a bit in detail.

1. Coding Assignment:

After the resume screening, the HR will get in touch with and mail you the assignment problem and gives you enough time to send them the solution.

You will be sent two coding problems : One is the famous “Mars Rover” Problem and the other is “Sales Taxes” Problem. You can solve any one of the problems. I choose to solve the Mars Rover problem since it looked a bit interesting to me. [I am not pretty sure if solving both the problems has any advantage!].

Since I was kind of very occupied with my work, I worked over the Mars Rover problem on a friday night and mailed them the solution.

Things to consider when you are working on the assignment:

1. The problems given for the assignment can be solved using procedural programming in just 1 or 2 hours may be. But TW wants you to give more focus on the Design aspect.

2. Have a proper packaging structure, Exception handling, Test cases, boundary conditions. Importantly a proper documentation of the code. This should be something like you can ship it [I made this up :P]

PS: Everything I said here is from my perspective.

PROBLEM ONE: MARS ROVERS 

A squad of robotic rovers are to be landed by NASA on a plateau on Mars.
This plateau, which is curiously rectangular, must be navigated by the
rovers so that their on-board cameras can get a complete view of the
surrounding terrain to send back to Earth.

A rover’s position and location is represented by a combination of x and y
co-ordinates and a letter representing one of the four cardinal compass
points. The plateau is divided up into a grid to simplify navigation. An
example position might be 0, 0, N, which means the rover is in the bottom
left corner and facing North.

In order to control a rover, NASA sends a simple string of letters. The
possible letters are ‘L’, ‘R’ and ‘M’. ‘L’ and ‘R’ makes the rover spin 90
degrees left or right respectively, without moving from its current spot.
‘M’ means move forward one grid point, and maintain the same heading.

Assume that the square directly North from (x, y) is (x, y+1).

INPUT:
The first line of input is the upper-right coordinates of the plateau, the
lower-left coordinates are assumed to be 0,0.

The rest of the input is information pertaining to the rovers that have
been deployed. Each rover has two lines of input. The first line gives the
rover’s position, and the second line is a series of instructions telling
the rover how to explore the plateau.

The position is made up of two integers and a letter separated by spaces,
corresponding to the x and y co-ordinates and the rover’s orientation.

Each rover will be finished sequentially, which means that the second rover
won’t start to move until the first one has finished moving.

OUTPUT
The output for each rover should be its final co-ordinates and heading.

INPUT AND OUTPUT

Test Input:
5 5
1 2 N
LMLMLMLMM
3 3 E
MMRMMRMRRM

Expected Output:
1 3 N
5 1 E

Advertisements