As a very first thing, I must say that I don’t like whiteboard coding exercises during the job interviews.
These exercises have almost never any relation to real-life programming problems (“Reverse a linked list?” If your reply is anything besides “linkedList.Reverse();”, your answer is wrong.). There are only a few dozen common whiteboard coding questions – and every candidate with a common sense will review those before the interview.
Finally, success with whiteboard coding seems to have next to no connection with the actual qualities of the candidate. And yes, this includes “solving a problem under pressure”.
I much prefer to give the candidates a small task, to do at home in 2..3h. This will give me much more information – what is his coding style? Can he write high-quality and well-commented code? Did he actually manage to finish all parts of the task – and if not, then why? Does he even want the position enough to do a proper job?
That all said, FizzBuzz does have one good use – it can be used to quickly weed out the candidates who cannot program at all. If they cannot do a simple logical exercise, and write a loop with a couple of if-clauses inside it, they really shouldn’t be hired as developers.
That is why ex-coworker Erti-Chris and I were rather surprised after reading “Tales of a Non-Unicorn: A Story About The Trouble with Job Titles and Descriptions” (reddit thread). A person claiming to be “designer/developer if there ever was one” goes “OMG MATH” and cannot solve FizzBuzz (which has almost nothing to do with math)?!
The “standard solution” using modulus:
Method Print is used repeatedly, it is the same everywhere:
But what if we don’t allow modulus to be used?
But what about not using neither round nor modulus?
(and also the same limitations as above, nutcase version. Proudly mine).
Still too easy. What about not allowing modulus, rounding, multiplication and division?
Amusingly, the last version is fastest of them all.
And by now we were out of time and bored of this. It was fun, though – a sort of minor coding kata.
All the code above can be seen and executed in dotNetFiddle, https://dotnetfiddle.net/84PodI
- 55 231 külastust
- 50 999 (92.34%) arvutist
- 3 406 (6.17%) mobiilist
- 826 (1.50%) tabletist
- 282 035 otsingut
- 273 276 (96.89%) arvutist
- 8 759 (3.11%) mobiilist
- 165 538 (58.69%) inglise ⇒ eesti suunal
- 116 497 (41.31%) eesti ⇒ inglise suunal
- 211 942 sõna eesti ⇒ inglise suunal
- 199 640 sõna inglise ⇒ eesti suunal
Allpool on graafik külastajate hulgast, kuude kaupa. Nagu näha, siis on pidev kerge tõusutrend. Järsk tõus jaanuaris 2015 on seetõttu, et eelmine sõnastikuversioon (dukelupus.com/dict) hakkas automaatselt külastajaid uuele sõnastikule suunama.
- Ülemine ASP.NET 5’le. Saab teha siis, kui SmarterASP.net seda toetama hakkab.
- Korralik haldusliides.
- HTML5 <datalist> on endiselt Firefoxis katki, seega kas jQuery UI AutoComplete või mõni pisem lahendus. Kuivõrd Chromel ja IE’l datalistiga probleeme pole, siis kas brauserispetsiifiliseks?
Eraldi tahaks tänada Henri P.’d, kes teatas mitmetest probleemidest ja puudustest.