Recently, I was invited to take an online coding assessment with Amazon. As I'm contracted with my current job for a while yet, I thought it might be fun just to try it out, with no pressure. Here's what I learned from absolutely crashing and burning on that coding assessment:
I spent a good chunk of my time validating arguments, which -- while this may be what you'd do in real life -- is not a good idea for a coding assessment. Sometimes, companies will throw in edge cases -- maybe your
List is empty, or is
null -- but usually that's after they verify the behaviour of your solution on valid inputs.
You don't want to have to waste time Googling how to deep copy an array when the timer is counting down. Know how to work with all of your standard data structures and practice, practice, practice.
There will sometimes be caveats to your prompts. Maybe the prompt wants you to return an optimal solution if it exists, but if your solution falls below some threshold, don't return anything at all. Make sure you're satisfying the requirements of the prompt.
Online coding assessments more or less have to provide an online IDE of sorts to help you compile, debug, and run your programs. Don't use it. It will be unfamiliar, slow, and it may have particular features you don't want (code completion), or be missing some that you do (automatic library imports).
These coding assessments are meant to be quick, but not so quick that you run out of time if you know what you're doing. That being said, when you're finished, you'll probably want to go back and clean some code, optimise, and add some comments. Practice with less time than you're supposed to be allotted.
That's it! I think if I had followed my own advice above, I might have at least been able to finish the prompts in time. If you're a perfectionist like me, you'll need to leave that at the door to be able to first make a solution that works, and then go back and clean it up. Good luck!
If you enjoyed this post, please consider supporting my work by buying me a coffee!