Better Practice, Dec. 2018

(singke) #1
42 \ December 2018 \ http://www.phparch.com

Education Station


Interview Coding Challenges


Edward Barnard


I’ve encountered job interview coding challenges over the past year. In each case, the company
or recruiter said people have trouble with these. Let’s talk about that! We’ll look back at the
Education Station theme for 2018, pick a new theme for 2019, and tie it all together.

When arguments begin over which
is the best programming language, the
standard PHP joke runs like this:

Question: What do you call a good
PHP developer? Answer: Employed.

This joke does explain the general
perspective for PHP people. We’re
pragmatic. We deal less with theory
and more with practice. We translate
needs and requirements into something
concrete—a web application.
Generally speaking, we create visual-
izations—things which can be seen or
used—rather than algorithms.
Meanwhile, the days where employ-
ees stay with the same company 20-30
years are long gone. We move around
or move on from contract to contract.
For many of us, this means formal job
interviews. Many of those interviews
include coding challenges; that can be
a problem.
Let’s get to it.

Goals
Each of the challenges I encountered
was of the form “write the code to make
these tests pass.” There was a clear state-
ment of the problem and instructions
for running the tests. None of these
challenges had anything to do with
building web pages.
That fact seems strange to me. Why
bother with a coding challenge which
has nothing to do with the actual job
requirements?
Are these Kobayashi Maru^1 scenarios,
that is, no-win situations? Yes, and no.
One objective of the coding challenge is

1 Kobayashi Maru:
https://phpa.me/wikip-kobayashi-maru


to observe how you perform during the
scenario. It can be a win-win situation
rather than a no-win situation. Let’s see
what’s behind these challenges.
Fizz Buzz Test^2 explains the FizzBuzz
Test:

The “Fizz-Buzz test” is an interview
question designed to help filter
out the 99.5% of programming
job candidates who can’t seem to
program their way out of a wet
paper bag.

That 99.5 percentage comes from
the Coding Horror article Why Can’t
Programmers.. Program?^3 by Jeff
Atwood, co-founder of Stack Overflow:

I was incredulous when I read this
observation... “Like me, the author
is having trouble with the fact that
199 out of 200 applicants for every
programming job can’t write code
at all. I repeat: they can’t write any
code whatsoever.” The author... is
evidently turning away lots of
programmers who can’t write a
simple program: “After a fair bit of
trial and error I’ve discovered that
people who struggle to code don’t
just struggle on big problems, or
even smallish problems (i.e., write
an implementation of a linked list).
They struggle with tiny problems.”

Both of the above articles are
worth reading in their entirety (and
they’re short). The Coding Horror
comments section debates the merits

2 Fizz Buzz Test:
http://wiki.c2.com/?FizzBuzzTest
3 Why Can’t Programmers.. Program?:
https://phpa.me/codinghorror-cant-program

of FizzBuzz-style questions, e.g., does
not being able to implement recursion
mean you’re not a good programmer?
Coding Horror explains why inter-
viewers are presenting these sorts of
challenges—people “can’t seem to
program their way out of a wet paper
b a g .”
This claim is both harsh and unfair.
If 99.5 percent of job candidates have
trouble with these coding challenges,
that tells us:


  • These coding challenges have noth-
    ing to do with and are irrelevant
    as predictors of actual job perfor-
    mance, or

  • Our training system has nothing
    to do with and has no relevance to,
    our real-world jobs, or

  • Both of the above.
    However, the coding challenges exist.
    We’ll look at my strategies below, but
    first let’s consider the explicitly evil
    cousin, a specific type of whiteboard
    interview.


White Board Interviews
Adrianne Jeffries in Programmers are
confessing their coding sins to protest a
broken job interview process^4 shows how
a particular form of whiteboard inter-
view selects against a diverse population.

This interview style, widely used
by major tech companies includ-
ing Google and Amazon, typically
pits candidates against a white-
board without access to reference

4 Programmers are confessing their coding
sins to protest a broken job interview process:
https://theoutline.com/post/1166/
Free download pdf