Category: Learning

  • “Big O” Notation Personified

    Big O Notation… once you get practicing, it starts to fall into place, but wouldn’t it be nice if there WAS a magic bullet, something to help you memorize it from the beginning? Now, there is, sort of. Meet the “Big O” Cast of Characters. NOTE: these are just the major players. O(1), O(n), O(n^2),…

  • Database Associations in Plain English

    A lot of beginners (myself included) seem to run into issues when it comes to back end associations/relationships for database models… NOTE: (this article is written in the context of ActiveRecord, so mostly applicable to Ruby programmers.) I also find that using Figma (etc.) to draw out the relationships can lead to an illusion of…

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