Welcome to the Wizkids C# test!
This small test gives you the opportunity to show off a few of your C# coding skills and some logical thinking.
You can create your own solution or use the Program.cs
sample file (replacing as appropriate, including inside Main()
if you so desire).
2. Write a method that prints the numbers from 1 to 100, but for multiples of 3 print Foo
, for multiples of 5 print Bar
and for numbers that are multiples of both 3 and 5 print FooBar
.
For example, find and replace all valid email adresses in the following text:
Christian has the email address [email protected].
Christian's friend, John Cave-Brown, has the email address [email protected].
John's daughter Kira studies at Oxford University and has the email adress [email protected].
Her Twitter handle is @kira.cavebrown.
In spell checking it is assumed that all words are wrong and alternative words are proposed if they fit better in the context. One way to generate alternative words is taking the original word and applying certain operations:
- Deleting a letter.
- Inserting a letter.
- Replacing a letter.
- Swapping two adjacent letters.
If only one operation is performed on the original word the Damerau–Levenshtein distance between the original word and the new alternative word is 1, for example, herroes [DELETE OPERATION] => heroes
. If two or more operations are performed on the new alternative word(s) the Damerau–Levenshtein distance increases with the amount of operations, for example, herros [DELETE OPERATION] => heros [INSERT OPERATION] => heroes
yields a Damerau–Levenshtein distance of 2.
The method should generate all possible alternative words based on the 4 operations listed above and maximum Damerau–Levenshtein distance = 1.
4.a How many non-unique alternative words can be generated using the word test
, alphabet a-z
(26 letters) and maximum Damerau–Levenshtein distance = 1?
4.b Write a method that can calculate the number of non-unique alternative words based on input word length and alphabet length (assuming maximum Damerau–Levenshtein distance = 1).
Without generating the word list again, i.e. write a formula based on input word length and alphabet word length.