A Simple code exam to determine if a candidate is capable of using Winforms and has basic C# skills.
We recently had to hire a new Developer to work on some of our legacy winforms applications. I needed to ensure that the candidate was capable of using C# and can deal with Winforms.
The basic premise is the "FizzBuzz" test, but in a boilerplate Winforms application. The premise is thus:
"Write a program that prints the numbers from 1 to 100 when the user clicks on the "Go!" button. But for multiples of three print the contents of the “Fizz” Textbox instead of the number and for the multiples of five print the contents of the “Buzz” textbox. For numbers which are multiples of both three and five print the contents of both textboxes."
The candidate should pay particular attention to the brief above, i.e. they shouldn't start from 0 and they shouldn't print any numbers divisible by 3 or 5.
This project was created with Visual Studio 2013, but it should run on most versions of Visual Studio. It has no dependencies other than the .net Framework.
There are a few extra bits the candidate can fix/tweak to improve the solution as a whole, from a winforms perspective:
- The form does not resize correctly
- The Input Text Boxes are not named correctly
- The "Hint" label could be replaced with a "Finished" label.
- Anything else you want the candidate to demonstrate
If you feel this "exam" is far too simple, then be aware that 50% of the candidates that took it could not complete the most basic aspect of it. Another 25% took over 30mins to finish it and only about 25% of candidates were able to complete the assignment in what I would deem a reasonable amount of time.