Why A Take-Home Challenge?
The take-home challenge is designed to give you an opportunity to show off your coding chops. Interviewers will use this exercise to find out what you know and determine your skill and experience level. They are looking for you to demonstrate specific skills, domain knowledge and design experience.
That's a tall order, so let's take a look at how you can impress your interviewer with your submission and land that job.
Strategies to Ace It
First things first, don't skimp on showing off what you know! This is not the right time to write some quick and dirty code just to solve a problem. This is a chance to write clean, efficient and well-tested code. You will have at least a few days to complete your take-home challenge. If you feel you're too busy to do it right, ask for more time.
Here's what you should do in your code challenge:
- Write clean code the adheres to accepted design principles
- Test it!
- Write efficient code
- Provide a clean interface
- Write a clear, helpful README
Write Clean Code
The exact design patterns and principles you apply will depend on the challenge at hand. However, there are a few principles you can follow no matter what:
- Keep it DRY––Don't Repeat Yourself. If you have repititous code, break that code out into helper methods or functions.
- Adhere to the Single Responsibility Principle. If you're writing object-oriented code, each class you write should have ONE JOB. In a Rails app for example, don't fill up your
Personmodel with a lot of search logic. If you have a specific job to do, like "build a search feature", write a specific class to do it.
- Take advantage of language features. For example, if you're using Ruby and you need to collect the results of an iteration, use
each. Demonstrate that you know your language inside and out.
Test Your Code
This should go without saying, but I've still seen so many take-home challenge submissions with poor or no test coverage. While you don't neccessarily need to test every nook and cranny of your code, test the most important features and behaviors. As a professional developer, you will write lots and lots of tests. Your take home challenge should demonstrate that you know how to write tests, and illustrate how you think about what to test.
Write Efficient Code
The code you write to satisfy the requirements of the take-home challenge should be as efficient as possible. If you're building an app that makes database queries, take the time to optimize those queries. If you're building a program that manipulates or iterates over data structures, evaluate the pros and cons of using recursion versus looping. Regardless of what approach you choose, be ready to discuss your thinking and defend your decision.
Provide a Clean Interface
Whether you're creating a command line app or a web app, make sure the user interface is clean and intuitive. If you're building a CLI app, for example, provide an easy-to-use interactive menu from which to run the program. If you're building a web app, leverage your HTML and CSS skills to provide a simple and responsive front-end. You don't have to go crazy making everything look perfect, but you should demonstrate that you care about how your app looks and how a user interacts with it.
Write a README
The interviewer reviewing your take home challenge is already taking time out of their busy day to evaluate you. Make it as easy as possible for them to do so. Write a short and clear README that introduces your app and outlines how you solved the problem and met the requirements of the challenge. Provide instructions for running the app and point the reader to any code in particular that you feel is important or that you're proud of. Submissions with a good README always stand out from the crowd.
When you receive your next take-home challenge, don't get overwhelmed. If you apply the strategies outlined here, you'll be able to craft a strong submission that will help keep you in the running.