
Ten tips to solve your next interview coding challenge
22 Nov 2021 #interview #careerWhile applying for a new job, often we’re given a coding challenge. A medium-size coding task to finish in a couple of hours or days. These are my tips to solve your next interview coding challenge.
When solving interview coding challenges, write code as clean as possible. Write good and consistent names. Keep your solution under version control. And, document major design choices and installation instructions.
TL;DR
- Follow good practices and stick to coding standards.
- Keep your solution under version control.
- Write a README file with installation instructions.
1. Stick to standards
Follow good practices and stick to coding standards. Write clean code.
Write descriptive names. Don’t use Information
or Info
as name suffixes. Like, AccountInfo
. And keep names consistent. If you used AddAccount
in one place, don’t use AccountAdd
anywhere else.
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.
Don’t keep commented out code. And, don’t have extra blank lines. Use linters and extensions for this.
Use third-party libraries to solve common problems. But, don’t keep unused libraries or NuGet packages.
Have clearly separated responsibilities. Use separate classes, maybe Services, and Repositories. But, stay away from Helper and Utility classes full of static methods. Often, they mean you have wrong abstractions.
Add unit or integration tests. At least for the main parts of your solution.
2. Version Control your solution
Keep your solution under version control. Use Git.
Write small and incremental commits.
Write good commit messages. Don’t use “Uploading changes”, “more changes” or anything among those lines.
3. Write a good README file
Write a good README file for your solution. Don’t miss this one!
Add installation instructions. Make it as easy as possible for the one reviewing your work to install and run your solution. For example, deploy your solution to a hosting provider or use Docker.
Add how to test your solution. Maybe, some step-by-step instructions with screenshots, a Postman collection with the endpoints to hit. You get the idea!
Tell what third-party tools you used. Include what libraries, NuGet packages, or third-party APIs you used.
Document any major design choices. Did you choose any architectural patterns? Any storage layer? Tell why.
Voilà! These are my best tips to rock in your next coding challenge. Remember, it’s your time to shine. Write as clean code as possible. And keep things consistent. Good luck!
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 on previous interviews.
Happy coding!