thzinc

Code Kata (programming challenges, "interview questions", etc.)

mmmPie - Interview question of the week from rendezvous with cassidoo

How can I write a piece of code that can be written quickly and trivially understood? I think it’s mostly good variable names in this case. (And I handle infinite pie!)

binaryPal - Interview question of the week from rendezvous with cassidoo

What’s faster: a typical JavaScript implementation of .toString() and some basic string manipulation or clever bit shifting? (TL;DR: It’s bit shifting, but it’s uglier code.)

oddSquareSum - Interview question of the week from rendezvous with cassidoo

In this case, writing tests to prove the solution was far more interesting than the solution itself.

removeZeroes - Interview question of the week from rendezvous with cassidoo

The simple case wasn’t hard, but the low-memory iterator pattern was a fun, self-imposed challenge.

rollDice (by ChatGPT) - Interview question of the week from rendezvous with cassidoo

I decided to tinker with ChatGPT while working on an answer to this week’s question. While each implementation was passable and useful as a starting point, it became almost immediately clear that ChatGPT’s contextual understanding of its own output is fairly limited. Iterating with ChatGPT on its own technical output...

scramble - Interview question of the week from rendezvous with cassidoo

The tests were harder than the implementation 🥴

numBalanced - Interview question of the week from rendezvous with cassidoo

This one was fun to think about the minimal amount of processing needed to produce the result. In this case, the question is carefully worded to allow naive processing that’s really fast.

A1 Reference Style Spreadsheet Column Names - Interview question of the week from rendezvous with cassidoo

Nice little brain teaser involving number base conversion 😄

missingBits - Interview question of the week from rendezvous with cassidoo

Nice, bite-sized algorithm question.

Spin the Wheel - Interview question of the week from rendezvous with cassidoo

Well, I spent quite a bit more time on this tonight than I’d originally anticipated. It’s not pretty, but it does work and has a little bit of viable game theory.

sumEveryOther - Interview question of the week from rendezvous with cassidoo

This was a fun, light interview question this week.

rectangleSum - Interview question of the week from rendezvous with cassidoo

This one was tricky to stay mindful of the number of iterations.

verticalSlashes - Interview question of the week from rendezvous with cassidoo

I do enjoy getting Cassidy’s newsletter late Sunday/early Monday and trying my hand at the “interview [questions] of the week.”