The Pizza Question
Posted on February 1, 2023 by Michael Keane GallowayThe year was 2013. I was in graduate school, and I was hungry. I logged into my favorite pizzeria’s website, made my selections for toppings, and clicked add to order. Nothing happened.
Having spent the last year working as a web developer, I fired up firebug (the web page debugger plugin that I used in FireFox). It turns out the variable for the maximum number of pizzas a person could order, was undefined. That value was checked when the add to order button as clicked, and this was the underlying cause of the exception in the console.
I simply used the developer console to set the value of the variable to 10. Clicked the button, and ordered my pizza. This incident became a fun little anecdote to share at parties. Sometimes I simplified it for my audience to say that I got a pizza once by “hacking” a website.
Years later I started presenting this scenario to prospective candidates I interviewed. I like drawing questions from experiences that I’ve had working on software, so I thought that this would be a fun scenario. I think it’s certainly caught some candidates off guard, because it does seem a little out of left field. I do get the very pragmatic “I would just call them instead” answer.
It usually doesn’t take much directing to get anyone to say they would open up the debugger. Then it becomes an exercise in how the candidate debugs a simple problem. I haven’t used this question in a while, but I might return to using it as a good soft open to see how candidates think before ramping up to more challenging problems. I could also see myself using it if I ever have to do a phone screener.