Why Instructions are Important and Paying Attention to Details
I recently had a technical interview which was a simple project to be built over the weekend. The project was to build a “poker hand checker”. I felt very comfortable with the project because I enjoy playing and watching poker. I knew already what the ranking of hands are and what makes up a hand. I finished the app and did my best to show my skills in different ways throughout the app and was very confident in my submission. I was offered an interview after the technical lead of the team reviewed my submission and I want to share some of the things that went wrong during that interview.
To start I want to say that this was by no means a disaster. He said he liked my submission and that it was better than a lot of other ones that he had seen. However, he shared with me a few things that made me feel really dumb and I would like to share them with you so hopefully, you can learn from my mistakes as I did.
The first thing that really made me feel like I did a terrible job was the number of things that I missed in the document explaining the assignment. When I first received the assignment I read the entire document and looked at the example input/output. Like I said I was already comfortable with poker so as I built the project I didn’t look back at the document much, because I had a decent grasp on the intended outcome. I actually think this was ok but I think I made a big mistake by not re-reading the document after I finished. I think it's always good to double-check that everything is there when you're finished and I did not. This led to me missing a specific test case that had completely slipped my mind and missing the part in the document that asked you to run your program through a linter. These ended up being minor problems and I was able to explain how I would have changed the code to handle the missed case, however, it doesn't feel good to say “oh I missed that” when talking about instructions that were given to you quite clearly.
There were some other things I could have improved on but the other thing I really want to touch is a ruby syntax optimization that I knew about but missed in this project that I think many people new to ruby will find helpful. When I built my project I decided to check the hand's strength from highest to lowest and in my project that looked at calling a number of functions in order until one returned true. Those functions all had the same look.
- if statement to check if a hand rank is met
- if so return true
This is very simple but a nice syntax change could have saved a lot of space in my code. If you're a ruby developer you probably know that the last line of a function is returned even if you don't use the return keyword. Instead of writing essentially “if (conditional) return true” just writing the conditional statement will have the same effect.
The story is really to double-check your work. When you're doing a project like this for a job or interview and not just for yourself it's important to really show your best and that means checking your work and making sure it's ready for the customer or employer.