Hello there, lately I’ve been working with a great deal of algorithms and coding challenges as I continue my journey for my first full time position as a software engineer! More than likely, you will have to complete a coding challenge or solve an algorithm to acquire a job in software development. This isn’t always the case, as there are some exceptions. Some companies may feel coding challenges don’t accurately assess an individuals skill set.
In my experience so far though, most companies require a coding challenge or algorithm as part of their hiring process. I haven’t made it past the 2nd round in the interview process with a company yet, but I have encountered coding challenges in the 1st and 2nd round. My job search started about 3 months ago, and I have attempted 4 challenges for potential positions. I have yet to solve one completely within the time limits, but every time I get closer and closer even though the questions differ in topics. My last challenge I actually solved 1 minute after the time expired! I was so close, and it felt so good. I would like to provide several tips on how to prepare and conquer your next coding challenge!
1. Be Prepared
This may seem like common sense, but get a good night rest the night before! Sleep is very important for the mind! Also make sure to eat, so your mind isn’t distracted by hunger. I like to have a pen and notepad next to my computer on my desk to write out ideas and solutions during my challenges. I find this quicker than using any method on the computer. Writing down your ideas can keep you organized as you navigate towards the solution. Lastly, make sure you are in a distraction free environment.
2. Completely Understand The Question/Scenario
This is so important! Please read, read, and re-read the question before attempting to solve it. I know you may be anxious, excited, and ready to code. At least, that is how I am, and not to mention the time limit lingering in the back of your mind. If you don’t understand the question or miss a minor detail, it could derail you from success. As programmers, details are everything!
3. Break Down The Problem Into Smaller Pieces
Coding challenges can be intimidating. I remember one of my first challenges, I almost quit as soon as I started it. I decided to give it a go anyway, and apply what I did know. Normally when faced with coding challenges, there are “tests” you must pass to successfully complete the challenge. When all “tests” are passing, the challenge is complete. Most challenges I have encountered have at least 4 to 5 tests. Try to break down the test from easiest to most difficult to solve or pass. Complete the easier ones one by one and gradually work towards the more difficult tests. Beware, some tests may be private. When the test is private, the input and output are hidden. You must make educated guesses on how to get the private tests to pass. Sometimes you can advance to the next round of the interview process without fully completing the challenge or passing all the tests. Coding challenges are difficult, and almost everyone in the industry knows it.
4. Be Resourceful, Ask Questions
If you are allowed to look information up on Google, do it! Sometimes coding challenges will allow the participants to use Google for help. I love this because in the real world when are we ever going to code without the availability of documentations/specs or Google/Stack Overflow. I haven’t met a programmer yet, who doesn’t use some sort of reference for assistance when coding. If you’re in a paired coding challenge with an interviewer, more than likely they are a developer themself. Most interviewers from my personal experience will allow you ask questions. I suggest if you’re stuck, do it. Also talk out loud. It isn’t weird or uncommon for a programmer to talk to him or herself as they code. I do it all the time to help me with the flow. Also, the interviewer can get a better grasp on how you think by listening to you talk out loud. Remember, there are no dumb questions!
5. Write clean code
Please ensure to write clean code. This is an important aspect of coding. Ident correctly, and add comments where applicable. Some of the IDE’s you may use for an interview may lack tools you are used to programming with. I personally use Visual Studio, and VS will auto finish code lines or make suggestions and indentions as you code. This makes coding a lot easier and efficient, but it can make an interview more difficult if you rely on these tools too often. I like to write comments in my challenges as well. This is not required, but it looks clean. It also helps me and I believe the interviewer easily follow the flow of my solution.
There are plenty of websites that offer free coding challenges to practice with. I use HackerRank and CodeWars for practice. I also purchases a book called, “Cracking the Coding Interview” by Gayle McDowell. I have found all 3 of these resources to be very helpful. Anytime I complete a challenge I copy and paste the question and solution into a folder called Algorithms/Coding_Challenges that I created. I wanted to keep a record of all the challenges and algorithms I complete for referencing in the future.
7. You Will Always Gain Experience
Never give up. Especially during an actually interview. You may skip or return to a nagging algorithm or challenge from practice, but there is no 2nd chance in an interview. That is why you might as well give it your all! Even if you don’t complete the challenges like me, you will learn a lot about what you do know and need to know. With every challenge, I gain more and more confidence as well. Like in life, every challenge is a learning experience. I also like to continue to work on the challenge after the interview is over. I like to see how far off I really was from finishing it completely. Plus when you actually do solve it, it’s a confidence boost!
I might not even be the best candidate to offer advice or tips on solving algorithms as I have yet to solve one within the limits. These are tips I follow and adhere to, and I believe there are guiding me to eventually success. I hope you find these tips helpful, and you want to reach out and chat about coding challenges you have encountered on your job search, please free feel to message me on LinkedIn and/or check out my portfolio site. I hope you have a great day!