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!)
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!)
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.)
In this case, writing tests to prove the solution was far more interesting than the solution itself.
The simple case wasn’t hard, but the low-memory iterator pattern was a fun, self-imposed challenge.
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...
The tests were harder than the implementation 🥴
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.
Nice little brain teaser involving number base conversion 😄
Nice, bite-sized algorithm question.
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.
This was a fun, light interview question this week.
This one was tricky to stay mindful of the number of iterations.
I do enjoy getting Cassidy’s newsletter late Sunday/early Monday and trying my hand at the “interview [questions] of the week.”