Why You Should Love (Not Fear) “Interview Questions”

crashdaddy
5 min readJul 16, 2020
It’s funny because it’s true!

Yay, Me!

This will be my last blog post for my enrollment at good ‘ol Austin Coding Academy. I submitted my final project, a puzzle game called Puzlr yesterday and this post is the last assignment.

Later they’ll make a video of its functionality for the graduation ceremony and I’ll get me a certificate certifying myself as a Full-Stack Web Developer. Which I was already, in php and mysql, but I wasn’t certified and I had never run into the tools they taught us how to use.

Now they’re preparing us for the job hunt. That’s what this article’s about.

Welcome to Your Nightmare

By now I’m sure you’ve had people trying to spook you up with horror stories about interview questions like

You have 1000 bottles of soda, and exactly one is poisoned. You have 10 test strips which can be used to detect poison. A single drop of poison will turn the test strip positive permanently. You can put any number of drops on a test strip at once and you can reuse a test strip as many times as you'd like (as long as the results are negative.) However, you can only run tests once per day and it takes seven days to return a result. How would you figure out the poisoned bottle in as few days as possible?

It’s been a thing for job hunters to hassle other job hunters with tales of malicious hiring managers and their “List of Questions” that you can’t imagine!

which isn’t any secret because all the hiring managers have been telling you that’s the kind of stuff they want you to be prepared to talk about

But it can be unsettling when people start pulling all these “brain teasers” at you and telling you that you have to be ready to whip them all out on a dime.

Welcome Out of Your Nightmare

It’s all just a matter of perspective, and I’ll share with you the perspective they gave me in the Army; “An inspection is your chance to show off how great you are without being prideful”

And that’s what these questions are. Possible (and not too extreme from what I saw) problems that you as a programmer may be tasked to teach a computer how to resolve.

I’m not Mr Worldly, I’ve only ever had one professional programming gig (6 years at Safeway). But I can tell you that my boss came up with more intricate nonsensery on the weekly than that interview question.

And that’s the advice I can give you — dive right in!

Most of what you’ll need is given to you in the description; bottles and test strips are objects, so start defining objects. Here’s what I did:

let foundBottle = false;
let poisonedBottle;
let testStrips =[];
let bottles = [];
let day = 0;
let minBottle=0;
let maxBottle=1000;
// initialize 10 test strips, all white, all ready to use
// (dayLeft:0) means days waiting for test result
// rangeMin, rangeMax are where that strip will be used
const initTestStrips = () => {for(let i=0; i<10;i++) {testStrips.push({
testStripNumber: i,
testStripColor: "white",
daysLeft: 0,
rangeMin: 0,
rangeMax: 0})
}
}
// figure up which bottle has the poison in itconst initPoison =() => {poisonedBottle = getRandomInt(1,1000);
}
// count how many test strips are not waiting for
// test results
const testStripsLeft = () => {let testStripsLeft = 0;
testStrips.forEach(testStrip => {
if(testStrip.daysLeft===0) {
testStripsLeft++;
}
})
return testStripsLeft;
}

That’s not the only way, either. You can also make a 10-digit binary number allotting each digit to a test strip, or split it into rows, or subdivide it into fractions, or any other approaches that are so crazy they just might work.

But then I also figured why not just make it an app!

So I started this

Just do what the interviewer asks

Because isn’t that really all they’re looking for? Your ability to take complex problems and translate them into something a computer can understand?

Once you’ve gotten this far, they’ve had a full-frontal eyeful of your problem solving approach and are probably ready to hire you at twice what they were offering just so you’ll stop looking.

But on the off chance that you get an interviewer that wants to keep you chained to one whiteboard brain teaser until you’ve resolved the whole thing (preferably while shining a glaring lightbulb in your face and with something of yours shackled to the table) I’ve got you there, too…

The Real Nightmare Was the Friends We Made Along the Way!

About the time you’ve designed your objects and maybe a mock-up of an app to solve their problem is about the time all the weird brain-teasery logic comes in.

You can try to muddle through it, but watching someone else program a computer is about as much fun as watching them watch tv, so you can offer a graceful exit with,

“This here’s the part where we should apply some teamwork for the best solution.”

Thus answering with a demonstration one of the questions about “teamwork” that they were going to ask later.

At that point, if they still want you to finish an algorithm to find one contaminated bottle of wine out of a thousand, that’s probably what they really wanted you to do, and just offered the job as a ruse to get you to solve it for them.

Bonus: The Number One Character Trait of Good Programmers

I’m going to tell you the number one character trait of all good programmers and you can tell yourself if you have it or not.

Have you ever heard that joke they say sometimes about how “lazy people make the best programmers because they automate everything?”

I’m in that joke, and I like it…

There’s a lot of truth to that statement, but it’s still not the number 1 character trait. That’s “fortitude.” The ability to know you’re never outmatched, there’s no problem you can’t solve and that with teamwork you can accomplish goals you couldn’t achieve on your own.

Fortitude. Dontgiveupedness. Tenacity. === Algorithmic acrobatics.

And those interview questions? They’re your opportunity to show off just how great you really are without being prideful.

--

--

crashdaddy

4a 75 73 74 20 61 6e 6f 74 68 65 72 20 63 6f 6d 70 75 74 65 72 20 6e 65 72 64 20 77 69 74 68 20 61 20 62 6c 6f 67