Logo
Logo
16 results for
  • The first time I built a “production ML pipeline,” it was a cron job that ran a Python script, trained a model, and saved the artifact to disk. It worked, until it didn’t. The model silently degraded over three weeks because the training data schema changed and nobody noticed. There were no tests, no validation, no monitoring. That experience, embarrassing as it was, taught me more about ML system design than any paper on model architecture.

    fundamentals ML system design AI Created Sun, 02 Jun 2024 00:00:00 +0000
  • The first time I recognized the sliding window pattern outside a textbook, I was reading the source code for a rate limiter. There was no comment saying “sliding window algorithm here.” There was just a loop, two indices into a circular buffer, and some simple arithmetic that maintained a count of events in the last N seconds. Once I saw it, I started seeing it everywhere — in network flow control, in moving average calculations, in deduplication logic.

    fundamentals algorithms Created Sat, 01 Jun 2024 00:00:00 +0000
  • If regular lifetime annotations are Rust’s intermediate boss, for<'a> is the final boss. Higher-Ranked Trait Bounds (HRTBs) look terrifying in signatures, but they solve a very specific and real problem.

    I avoided understanding HRTBs for over a year. Then I tried to write a function that takes a closure accepting references with any lifetime, and suddenly I had no choice. Let me save you that year.

    The Problem

    Say you want a function that accepts a closure. The closure takes a &str and returns something:

    Rust tutorial rust ownership lifetimes Created Fri, 31 May 2024 21:15:00 +0000
  • Linked lists are where candidates reveal whether they actually understand pointers. You can read a hundred tutorials on reversing a linked list, but the first time you try to code it under pressure, you will likely lose a node, corrupt the list, or write an infinite loop. I know because it happened to me in a mock interview. The problem itself is not hard. The pointer mechanics are.

    This lesson is about building the mental model that makes pointer operations feel mechanical rather than scary. Meta asks linked list questions constantly — their systems rely heavily on custom allocators and cache implementations, and linked lists are the natural test vehicle. Amazon uses the LRU cache variant to test both data structure design and implementation discipline.

    fundamentals interviews Created Fri, 31 May 2024 00:00:00 +0000
  • A colleague once asked me why adding TLS to a service increased our P99 latency by 50ms. She had measured it carefully, switching between HTTP and HTTPS in a load test. My first instinct was to say “encryption overhead” but that’s wrong — modern CPUs with AES-NI can encrypt gigabytes per second. The actual cost is the handshake. Once I explained what was actually happening in those first few round trips, the answer to “how do we fix it” became obvious: stop creating new connections.

    fundamentals networking Created Thu, 30 May 2024 00:00:00 +0000
  • 'static is the most misunderstood lifetime in Rust. Most people think it means “lives forever” or “global variable.” It kind of does — but also doesn’t. And the way it interacts with trait bounds will surprise you.

    I’ve seen experienced Rust developers get this wrong. So don’t feel bad if it’s been confusing.

    What ‘static Actually Means

    'static means: “this reference is valid for the entire duration of the program.”

    Rust tutorial rust ownership lifetimes Created Wed, 29 May 2024 13:25:00 +0000
  • Every time you make a function call, your program uses a stack. Every HTTP request in a web server sits in a queue. Every undo operation in your IDE is a stack. These structures are so fundamental they’re baked into the hardware itself — the CPU has dedicated stack instructions.

    Yet I consistently see engineers reach for generic slices or channels when a properly implemented stack or queue would be both clearer and faster. Let me show you what these structures actually are, why they’re the shape they are, and where they show up in the systems you work on every day.

    fundamentals data structures Created Tue, 28 May 2024 00:00:00 +0000
  • Putting a reference inside a struct is where lifetimes go from “mildly confusing” to “wait, what?” for most people. I remember spending an entire afternoon trying to make a struct hold a &str and wondering why the compiler kept yelling at me.

    The fundamental tension: structs outlive function calls. References might not. The compiler needs you to prove the reference won’t dangle.

    The Problem

    // This won't compile
    struct Excerpt {
        content: &str,
    }
    
    error[E0106]: missing lifetime specifier
     --> src/main.rs:2:14
      |
    2 |     content: &str,
      |              ^ expected named lifetime parameter
    

    Why? Because the compiler needs to know: how long does the thing content points to live? Without that information, it can’t guarantee the reference is valid for the struct’s entire lifetime.

    Rust tutorial rust ownership lifetimes Created Mon, 27 May 2024 10:42:00 +0000
  • I got a 3 AM page for a service that was returning connection errors to every client. The application logs said dial tcp: lookup ...: too many open files. We hadn’t changed anything. Load was normal. But over 48 hours, something had been slowly accumulating open file descriptors and not closing them, and we hit the per-process limit. Restarting the service fixed the immediate problem; understanding why it happened required me to actually learn what file descriptors are and how the kernel manages them.

    fundamentals linux operating systems Created Mon, 27 May 2024 00:00:00 +0000
  • If lifetimes are so important, why don’t you see 'a plastered all over most Rust code? Because the compiler is smart enough to figure it out 90% of the time.

    Early Rust required explicit lifetime annotations on every function that dealt with references. The community quickly realized that the same patterns showed up over and over. So the Rust team codified those patterns into “elision rules” — three rules that let the compiler infer lifetimes automatically.

    Rust tutorial rust ownership lifetimes Created Sat, 25 May 2024 19:08:00 +0000