Advice for at-home programming challenges

Assigning job candidates a programming task to complete at home, despite having some problems, isn’t going away anytime soon. So how about some advice?

Usually you’ll have a set deadline. Good companies will indicate roughly how much time they think the task will take and not expect you to spend more than a few hours working on it. What the people on the company side often don’t account for is time to set up your system. I don’t use my private laptop for programming, and getting PHPStorm, Docker, xdebug, etc. installed last time I did one of these easily took two hours. These two hours shouldn’t count for the time allotted to the task, so if the deadline is tight or you know you will have to squeeze this in next to other responsibilities, you may want to ask for a longer deadline before starting.

Aside: If you are matter-of-fact about asking early and cheerfully assume that of course a reasonable company will want to set you up for success, that goes over better than realizing at the end of the deadline that you need an extension. "I don't have a working set-up on my private laptop and will have to install everything fresh, could we extend the deadline by one day to account for that?"

What if the company’s expectations seem excessive? You should follow up on that in an interview: Are they the kind of company who will expect you to work unpaid overtime because their estimation of project workload is always far too low? It’s possible that the hiring manager has just spitballed the time estimate. “A guestbook? Eh, should take three hours tops, sure.” Correctly estimating projects is hard, which is why my personal rule of thumb is that if I go over by up to 30% I’m not going to worry about it. Especially for high-stakes situations like these, I also take the time to go through my code a couple of times and make sure it represents the best that I can do.

Take half an hour before you start any actual coding to re-read, think about, and plan for your task. Sketch out what you’ll need to do on a napkin if that helps. Consider the end goal! I’ve seen someone spend two hours on setting up database tables in The Most Optimal Way Ever and then have no time left to do any programming, which was the part we were most interested in. In my opinion it is absolutely fine to take some shortcuts in a sample project that you wouldn’t take in a production project – but leave a comment so that they know you know that!

Aside: One of my shortcuts was from a task that was supposed to be done completely without frameworks; I created the LaziestTemplatingEngine class to str_replace {{something}} with the contents of $something in a .tpl file. I wasn't going to write mixed PHP and HTML, for goat's sake, it's not 1999 anymore. (Sorry, WordPress.)

Speaking of comments, absolutely use comments to show your thinking process. If you want to just get something working right now and come back to it later, note that! Then if you run out of time or energy, your interviewers will see that you had good intentions. If you weren’t sure about the best way to do something, make a note about what options you were considering and why you picked the way you did.

Another really nice touch is to add a README. If this code should be executable, describe how to do that. If it needs a specific version of X to work, note that. If there’s a bug you know about but couldn’t find or fix, better to be up front about it right here. Also impressive? Add what your next steps would have been, or what you realized halfway through that you could have done differently but didn’t have time to go back and change.

Aside: A few years ago we had someone turn in a PHP 7 project when PHP 7 was just out; my boss nearly rejected them because he didn't realize it wasn't PHP 5.X and he just thought it was broken when he tried to run it.

What if you can’t finish in time? You can ask for an extension. A good company, somewhere you want to work for, should understand that sometimes life happens. You can also offer to turn the project in at its current stage of completion if it’s, say, 70-80% done. That may be enough for the hiring manager to get an impression of your work and decide whether to move forward. If you’re asking not because of external time pressures but because you’ve spent twice as much time as indicated and you’re still not done, though, you should consider whether this company is the right fit for you.

The last piece of advice I have is to get someone familiar with programming to look it over, someone you trust to be honest with you. If you have someone in your network who also does hiring, they’d be a good choice. When I’ve asked for this I’ve used screen sharing with a voice call, so that I could point out and explain the parts I was worried about.

Leave a Reply

Your email address will not be published.

This site uses Akismet to reduce spam. Learn how your comment data is processed.