You are on page 1of 1

Programming Pre-Interview Exercise

For a Scrabble like game words entered into the game require scoring. These scores are
based upon the letters used in each word, and also the length of the word. Each letter is
scored with a number between 1 and 9 (details in the table below), and the score based
on the letters is calculated by the summation of these values.
If the word contains two or more of the same character in a row (i.e a double letter) then
an additional 3 points are awarded.
This score is then multiplied by the score multiplier based on the length of the word
(detailed below)
The words entered for must be single words, and any punctuation characters contained
in the word must be ignored. Multiple words passed for scoring are considered to be an
error case and should be handled appropriately.

Letter Scores
A
B
C
D
E
F
G
H
I
J
K
L
M

1
4
2
3
1
2
2
3
2
5
3
2
3

N
O
P
Q
R
S
T
U
V
W
X
Y
Z

3
1
5
7
2
1
2
2
8
5
9
5
8

Length of Word Multipliers


Length of word
1-4 characters
5-6 characters
7-9 characters
9+ characters

Score Multiplier
1
2
3
4

Scoring Examples
Input word: Queen
Letter Score = 7 + 2 + 1 + 1 + 3 = 14
Multiple letter bonus for ee: 3
Multiplier = 2
Total Score = 17 * 2 = 34

Input word: geography


Letter Score = 2 + 1 + 1 + 2 + 2 + 1 + 5 + 3
+ 5 = 22
Multiplier = 3
Total Score = 22 * 3 = 66

Provide a simple console application to drive your implementation of the scoring. Your
implementation should be in .NET 3.5 (or later) targeting the .NET Framework 3.5 (or
later). In your scoring implementation consider all the usual things you consider in
production quality code. Please also include any supporting code (prototypes, tests, etc).
Your submissions will form part of a discussion in your technical interview.

You might also like