ThoughtWorks is a global IT consultancy with an exclusive focus on end-
to-end global software development and delivery using advanced tools,
such as:

Java / J2EE
C# / .NET
Ruby
Agile Methodologies
EAI technologies like Tibco, MQSeries & MSMQ
Web Services

The company's leadership in the practical application of agile methods
on enterprise class projects allows its people to deliver higher
quality solutions more quickly and cost effectively, while giving
client business leaders greater program and project control.

With about 1600 people and growing, ThoughtWorks is establishing
itself as a world leader in delivering the most complex enterprise
applications. Our clients represent the top tier of global industry,
which are predominantly Global 1000 firms.

We pride ourselves on hiring the best candidates possible.  Therefore,
we have a very thorough hiring process.  In addition to the code
review you are about to begin, we also administer logic and general
aptitude assessments when you visit our office.  As a general rule, we
have found that those who perform well on the reviews and assessments
are better suited for the significant learning required by this
position.

Enclosed are two programming problems.  We ask that you read both
descriptions thoroughly then create a program to solve **ONE** of the
problems.  If you choose to do both problems, we will choose and
evaluate only one of your solutions.

·           For the solution, we would want you use either Java, Ruby
or C#.
·           We are interested in the DESIGN ASPECT of your solution
and would like to evaluate your OBJECT ORIENTED PROGRAMMING SKILLS.
·           You may use external libraries or tools for building or
testing purposes.  Specifically, you may use unit testing libraries or
build tools available for your chosen language (e.g., JUnit, Ant,
NUnit, NAnt, Test::Unit, Rake etc.)
·           Optionally, you may also include a brief explanation of
your design and assumptions along with your code.
·           Kindly note that we are NOT expecting a web-based
application or a comprehensive UI. Rather, we are expecting a simple,
console based application and interested in your source code.

Notes for C# developers:
·           For security reasons, please do NOT submit your C# code as
a .msi file.
·           For convenience of reviewing, we request you NOT to use
regions in the code.






==========

INTRODUCTION TO THE PROBLEMS

All problems below require some kind of input. You are free to
implement any mechanism for feeding input into your solution (for
example, using hard coded data within a unit test).  You should
provide sufficient evidence that your solution is complete by, as a
minimum, indicating that it works correctly against the supplied test
data.



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
==========

PROBLEM TWO: SALES TAXES

Basic sales tax is applicable at a rate of 10% on all goods, except
books, food, and medical products that are exempt. Import duty is an
additional sales tax applicable on all imported goods at a rate of 5%,
with no exemptions.

When I purchase items I receive a receipt which lists the name of all
the items and their price (including tax), finishing with the total
cost of the items, and the total amounts of sales taxes paid.  The
rounding rules for sales tax are that for a tax rate of n%, a shelf
price of p contains (np/100 rounded up to the nearest 0.05) amount of
sales tax.

Write an application that prints out the receipt details for these
shopping baskets...
INPUT:

Input 1:
1 book at 12.49
1 music CD at 14.99
1 chocolate bar at 0.85

Input 2:
1 imported box of chocolates at 10.00
1 imported bottle of perfume at 47.50

Input 3:
1 imported bottle of perfume at 27.99
1 bottle of perfume at 18.99
1 packet of headache pills at 9.75
1 box of imported chocolates at 11.25

OUTPUT

Output 1:
1 book : 12.49
1 music CD: 16.49
1 chocolate bar: 0.85
Sales Taxes: 1.50
Total: 29.83

Output 2:
1 imported box of chocolates: 10.50
1 imported bottle of perfume: 54.65
Sales Taxes: 7.65
Total: 65.15

Output 3:
1 imported bottle of perfume: 32.19
1 bottle of perfume: 20.89
1 packet of headache pills: 9.75
1 imported box of chocolates: 11.85
Sales Taxes: 6.70
Total: 74.68



-- 
You received this message because you are subscribed to the Google Groups 
"Algorithm Geeks" group.
To post to this group, send email to algogeeks@googlegroups.com.
To unsubscribe from this group, send email to 
algogeeks+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.

Reply via email to