Want to ace your next take-home coding exercises? Follow these 13 short tips
22 Nov 2021 #interview #careerTake-home coding exercises aren’t rare in interviews.
I’ve found from 4-hour exercises to 2-day exercises to a Pull Request in an open-source project.
Even though, in my CV I have links to my GitHub profile (with some green squares, not just cricket sounds) and my personal blog (the one you’re reading), I’ve had to finish take-home exercises.
Yes, hiring is broken!
For my last job, I had to solve a take-home challenge when applying as a C#/.NET backend software engineer. It was a decent company and I wanted to play the hiring game. So I accepted.
After I joined I was assigned to review applicants’ solutions.
Here are 13 short tips to help you solve your next take-home interview exercise. These are the same guidelines I used to review other people’s take-home exercises.
Stick to standards
Follow good practices and stick to coding standards. Write clean code.
1. Write descriptive names. Don’t use Information
or Info
as name suffixes, like AccountInfo
. Keep names consistent all over your code. If you used AddAccount
in one place, don’t use AccountAdd
anywhere else.
2. Use one single “spoken” language. Write variables, functions, classes, and all other names in the same language. Don’t mix English and your native language if your native language isn’t English. Always prefer the language you will be using at the new place.
3. Don’t keep commented-out code. And don’t have extra blank lines. Use linters and extensions to keep your code tidy.
4. Use third-party libraries to solve common problems. But don’t keep unused libraries or NuGet packages around.
5. Have clearly separated responsibilities. Use separate classes, maybe Services and Repositories or Commands and Queries. But stay away from Helper and Utility classes full of static methods. Often, they mean you have wrong abstractions.
6. Add unit or integration tests, at least for the main parts of your solution.
If you’re new to unit testing or want to learn more, don’t miss my Unit Testing 101 series where I cover everything from the basics of unit testing to mocking and best practices.
Version Control your solution
Keep your solution under version control. Use Git.
7. Write small and incremental commits. Don’t just use a single commit with “Finished homework” as the message.
8. Write good commit messages. Don’t use “Uploading changes,” “more changes,” or anything along those lines.
9. Use GitHub, GitLab, or any hosting service, unless you have different instructions for your take-home exercise.
Write a good README file
Write a good README file for your solution. Don’t miss this one! Seriously!
10. Add installation instructions. Make it easy for reviewers to install and run your solution. Consider using Docker or deploying your solution to a free hosting provider.
11. Add instructions to run and test your solution. Maybe, some step-by-step instructions with screenshots or a Postman collection with the endpoints to hit. You get the idea!
12. Tell what third-party tools you used. Include what libraries, NuGet packages, or third-party APIs you used.
13. Document any major design choices. Did you choose any architectural patterns? Any storage layer? Tell why.
Voilà! These are my best tips to succeed at your next take-home interview challenge. Remember, it’s your time to shine. Write code as clean as possible and maintain consistency. Good luck!
If you want to see how I followed these tips on a real take-home coding exercise, check SignalChat on my GitHub account. It’s a simple browser-based chat application using ASP.NET Core and SignalR.
Get ready for your next interview with these tips for remote interviews. And, to prepare for your technical interviews, check how to evaluate a postfix expression, how to solve the two-sum problem, and how to shift array elements. These are real questions I got in previous interviews.
Happy coding!