How I got banned from CodeWars

Written by poilon | Published 2017/07/01
Tech Story Tags: ruby | interview-questions

TLDRvia the TL;DR App

Hello everyone.

I’m a former C developer(for 5 years), that fell in love with Ruby and it’s ecosystem 4 years ago. After few months of practicing Ruby, I had quit my old job to become a full-time RoR developer in a great company, doing a lot of website crawling and working on a big rails application.

After 2 years in that company, I started to do a lot of recruitment, mainly sourcing and tech interviews.

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 ==(_)trueend

end

def mymethodend

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 !

Hacker Noon is how hackers start their afternoons. We’re a part of the @AMIfamily. We are now accepting submissions and happy to discuss advertising & sponsorship opportunities.

To learn more, read our about page, like/message us on Facebook, or simply, tweet/DM @HackerNoon.

If you enjoyed this story, we recommend reading our latest tech stories and trending tech stories. Until next time, don’t take the realities of the world for granted!


Published by HackerNoon on 2017/07/01