thzinc

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

isIsomorphic - Interview question of the week from rendezvous with cassidoo

Wow, I haven’t done one of these for a few months. Let’s see how this goes!

maximumProfit - Interview question of the week from rendezvous with cassidoo

If I’m going to use Elixir, I might as well make use of its pattern matching!

explodeString - Interview question of the week from rendezvous with cassidoo

I’m doing some work in Elixir now, so I figure I’d take a shot at this week’s question with Elixir.

missingLetters - Interview question of the week from rendezvous with cassidoo

Simple, no-frills solution to this week’s question.

trimArray - Interview question of the week from rendezvous with cassidoo

There’s a really simple one-liner for arrays, but what about using this with generators? (i.e., the iterator pattern where a length is not known until reaching the end of the iteration)

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.”