Your cart is currently empty!
Category: Tech
Three Pointers
Three Pointers is almost identical to “two pointers” except there is a third pointer (or “pincer”). This is useful for “three number sums”, or going with the ball factory example from the Two Pointer post, perhaps an item where three different balls are packaged together. A use case that I find fascinating might be K…
Divide and Conquer
This is a searching pattern that works best on pre-sorted data where you grab a midpoint value and would then determine whether the thing you’re looking for is of greater or lesser value. If you were dealing with a million numbers (or numerical IDs) then it could save you a lot of time. For example:…
Reversing a Linked List
As with many coding interview questions, the “usefulness” of a specific puzzle seems “useful” mostly in the context of getting a job. That said, if you need to use some data model to simulate some process in manufacturing, perhaps something where a “setup” requires a bunch of complicated bits and pieces to be entered “left…
Tortoise and Hare Pointers
So… this algorithm seems (at face value) rather pointless outside the context of a coding interview question. However, if you give it “a chance”, you’ll see that the Tortoise and Hare Pointer/Fast and Slow Pointer Pattern reveals the basic mechanic of identifying an Infinite Loop. While the example below does not account for what you…
Tortoise and Hare Pointers with The Movie Groundhog Day
Tortoise and Hare Pointers (the Fast and Slow Pointers). They make sense well enough, the analogy of the fast runner lapping a slow runner on a quarter mile track comes to mind, or perhaps a NASCAR loop where the slowest racer is eclipsed by the fastest… and yet, while I found myself able to appreciate…
Pointers, or “Making a Chimera”
If you read the previous blog post about “Sliding Window”, the concept of “Pointers” might be likened to a window of variable size, where whatever remains between the left side of the window and the right side is what will be iterated through to find what you’re looking for. Common uses for pointers might be…
Two Pointers
The code below is basically the same as the initial example used in the glossary, but doesn’t use reduce. For simpler memorization of the pattern, this example is better. As for the “What” and “Why” of Two Pointers, a frequent example would be some target value, and you need to iterate through some list/array to…
The Sliding Window
The code below is representative of a “semi-involved” Sliding Window. Also, it’s worth reminding that the whole purpose of “memorizing code” is less about “rote memorization” and more about having “rapid access” to a useful pattern. With that in mind the “memory hack” for the sample below is not all encompassing but covers the key…
“Setups and Payoffs in Fiction” … or, The Sliding Window Algorithm
BACKGROUND: While on my adventure to learn algorithms, I was fortunate to have Flatiron graduate Daniel Dawson recommend this course: Grokking the Coding Interview. Despite my having access to multiple Udemy courses, AlgoExpert, InterviewCake etc., (all very helpful in their own way)… Grokking the Coding Interview was a standout, in part because of the recommend,…
BubbleSort, Students by Height, and Sedimentation
Yesterday, I had the good fortune of working with two Flatiron School Graduates, Tyler Caprioli and Coral Fussman to talk through and walk through the BubbleSort Algorithm. Unless you know what a Bubble Sort is to begin with, it’s difficult to code outright. Understanding is a precursor to coding. We ended up working through a…
SubSequencing Arrays: “The Awards Ceremony”, and… a Few Words About Learning
Awesome coding challenge yesterday with fellow dev Ranika Williams from Flatiron School. Though I’ve been attempting to substitute values in code such as “index, idx, val” with more descriptive values and console logs, working through the problem via Zoom with Ranika gave me a new appreciation for the approach. If you’re attempting to tackle algorithms,…
Dealing Cards, or “Chunking” Arrays
When reviewing code, I often find that although I think “understand” what’s happening… it’s often when I try to put myself “into the shoes of the interpreter/compiler” that I realize some flaw in my perception. “Chunking Arrays” in JavaScript is one of those things. Though possible to force myself to memorize code using “totals” or…