Category: Learning

  • State, Props, and Stranger Things

    State and Props. Two things crucial to understanding how we build components in React, and yet, while easy enough to regurgitate a definition… it become a bit more difficult to explain in one’s own words. Huge thanks to Flatiron instructor Derek Cerretani who helped me get to a point where I was able to believe…

  • Depth First Search… or Searching for Atlantis.

    This is going to be a short one. Because the analogy here is much more intuitive and can more easily be applied to a range of circumstances… Imagine you’re on a yacht near the Bimini Islands searching for The Lost City of Atlantis. You have “reliable” info that the city may be somewhere in the…

  • Breadth First Search… or Unclogging The Bathtub

    Encouraged by Flatiron instructor Jonathan Foster to make a blog post out of a Slack comment where I attempted to explain “Breadth First Search” in plain English, I thought it was time to finally kick off this blog about Better Heuristics for Understanding Code. If you don’t know what breadth first search is, you will…

  • 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…

  • 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…

  • 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…

  • 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…

  • 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…

  • 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…