dimanche 4 janvier 2015

How many engineers use 15 in solving FizzBuzz without knowing what it does?


I've seen many FizzBuzz solutions that employ the use of dividing the number in question by 15 with no explanation (comments) as to why they can actually use 15. I had to look this up for myself and I now only understand via a proof (but not intuition unfortunately). This may be too much of an open-ended question or illicit debates but I wanted to open a discussion about using facts while solving something and not knowing why a fact works.


I personally would ask someone in an interview why they used 15 instead of checking divisibility by 3 && 5. Alternatively I would ask them to solve a variant of FizzBuzz with non relatively prime a, b and check if they use the product of a, b.





Aucun commentaire:

Enregistrer un commentaire