During the process of being hired as a developer, you will be probably asked to pass an online coding test. No matter your experience, this kind of tests can be hard and stressful. In this article, you will get some tips to make your coding test better:
- Prepare the test
- Code your solution
- Submit the code
1. Prepare the test
Master the coding platform
Take some moments to know the coding platform. Please, don’t skip tutorials. Some important things you should know before starting code are:
- How the challenge gets started
- How to submit your solution
- How to check the remaining time
- How to select the programming language to code
If allowed, use your daily work tools. Autocompletion and running/testing your code in a known environment is helpful.
- 📁 Use a single tab browser screen: Close any other content that could distract you.
- 🔕 Turn off notifications: Go to airplane mode: Silent your mobile phone, watch, browser/OS notifications, etc.
- 🧘 Prepare your environment: Setup your place to be concentrated at your best (music/silence, chair, comfortable clothes, etc.)
Make your body ready
- 🌅 Select the best time for you to take the test: In my experience, in the early morning my brain feels fresher and less tired than any other moment during the day.
- 🥗 Have some healthy food and plenty of water before coding.: This is a point you cannot forget: Your brain must be energized.
- 🧹 Clean your desk: Having a clear space to work will free your mind and let you focus on coding.
- 🚰 Have some water near you: Being hydrated during the test will make you think better.
- 🚽 Avoid interruptions: Go to the toilet before starting.
2. Code your solution
Understanding the test problem
- 📖 Read the instructions nice and slow: If case you are not a native speaker, look for the word translations you don’t know.
- 😌 Don’t feel overwhelmed about large descriptions: Read them step by step writing down the requirements of the problem.
- ⛰️ Understand every aspect of the problem: Identify the average cases, but also the edge ones.
- 💾 Try different approaches: Think about patterns that could fit. Sometimes, reversing the problem is a good approach.
- 🧪 Define a great test plan: A good test plan is composed by many average cases, but also by edge cases.
- 💯 Work on code performance: Your solution will be tested in extreme cases, so time measuring and performance testing could find issues in those cases before submitting your solution.
- 🔍 Make the code readable and understandable: Use indentation, proper variables names, etc. If you are using an IDE that supports linting, use it.
- ⏱️ Keep the remaining time under control: Save enough time to submit your solution without rushing.
3. Submit the code
- 📝 Include comments: Some inline comments on relevant code lines can be helpful for the reviewer. You can also include a header comment to explain the decisions you took.
- 👣 Remove console outputs from the code: The ‘print’ statements are expensive in time consumption, so they can make the tests failing by timeout errors.
- ✨ Take your latest code online: In case you have coded on an external programming tool, don’t forget to bring the latest code to the online platform.
- 🏅 Re-run the tests: After all the hard work, be sure they pass before submitting it.
There is not a magical formula to pass coding tests, but taking into consideration things like these will make your test more achievable.
Do you have any comment or suggestion to these tips? Contact me at: firstname.lastname@example.org
Originally published at https://pabloblan.co on August 30, 2020.