It’s at that point in life that I discovered CodeWars (https://www.codewars.com), and used it a lot to do my tech interviews. I trained myself often on the website, and resolved a lot of Katas.

With my colleagues, we wanted to challenge ourselves and the point was to earn the most CodeWars points in the weekend. With two kids it’s pretty hard to find focus-time, but my nights got shorter for a time !

After resolving ones of the most hard ruby katas with “normal” solutions (Brainfuck interpreter: https://www.codewars.com/kata/my-smallest-code-interpreter-aka-brainf-star-star-k, the builder of things: https://www.codewars.com/kata/the-builder-of-things and so much more…), and as a competitor in games (Super Smash Bros. Melee mainly), I had to find a way to destroy my friends at our little game :-)

The third weekend, something hit me. I was trying to understand how the katas are checked for validity and yes, I had found a way to resolve almost any kata with a same and really simple solution.

A Kata is checked this way: Does my solution is equal to theirs, or do theirs solution is equal to mine.

At first I tried to resolve it by returning nil in my method, and surcharge the == operator from NilClass this way

class NilClass def ==(_)

true

end end def mymethod

end

and I hit submit, and “pfiout”, I had resolved the Kata. I told myself “Oh shit, is that cheating ? Oh I don’t really care, that’s a solution, my friends will be blown !”

I then tried to make it on the biggest Kata of the website, a 1 kyu. The Three way compiler. As before I tried using a surcharge the == method on the Array or Hash classes, and again “pfiout”, I won points.

At this point, done for done, I told myself to just rekt my colleagues. I made this https://github.com/Poilon/codewars-hack, that will win codewars points for me.

I had a lot of fun finding, and then doing this. Made it to top 300 of the CodeWars power-ranking doing nothing. I did beat my friend, and successfully won our contest ! Of course I would love to have my account back, even with 0 points, just to answer comments and see the new solutions on the Kata I submitted myself.

Of course this is cheating, but if someone had done this during code interviews, I think he would have a really good chance of being hired !

Ruby is love, ruby is jazz. ❤ Paris.rb !