Machine Learning From Scratch

  • Before Transformers: Why RNNs Could Never Scale to Modern AI- Part 1

    Before self-attention changed AI forever, recurrent neural networks tried to solve sequence modeling. Here’s why they eventually hit a wall. This is Part 1 of a 5-part series on Transformers. 📚 Blog Series Every Revolution Starts With a Problem In 2017, Google published a paper that fundamentally changed artificial intelligence. Attention Is All You Need.… Read more

  • 20 Data Engineering Interview Questions You Should Know for Databricks & PySpark Roles

    Data Engineering interviews now demand in-depth knowledge of Spark, PySpark, and Databricks beyond basic SQL and transformations. Candidates should understand concepts like Spark architecture, lazy evaluation, DAG, transformations, data skew, and troubleshooting techniques. Strong candidates demonstrate proficiency across coding, architecture, and production troubleshooting, distinguishing them in interviews. Read more

  • Stop Paying for Idle Servers: How I Built a Flask ML App That Costs Almost Nothing on AWS

    Introduction Imagine you’ve built an amazing house price prediction website(flask ML App) using Flask and a machine learning model. The application works perfectly. Users enter details like location, area, number of bedrooms, and the model predicts the property’s price within milliseconds. There’s just one problem. Most of the day, nobody is using it. Yet your AWS… Read more

  • Why Your FastAPI Event Loop Freezes Under Load: The Hidden Battle Between AsyncIO and Scikit-Learn

    Understanding Nested Parallelism,FastAPI, OpenMP Thread Contention, and the Right Way to Deploy CPU-Bound Machine Learning Models Imagine This… You have trained a Random Forest classifier using Scikit-Learn. Everything works perfectly during development. You deploy it behind FastAPI, add a bit of asynchronous programming using run_in_executor(), and your API happily serves requests. Then someone runs a… Read more

  • Longest Consecutive Sequence in Python: O(n) Hash Set Solution Explained

    Longest Consecutive Sequence in Python: O(n) Hash Set Solution Explained

    What Is Longest Consecutive Sequence in Python? The Longest Consecutive Sequence in Python problem is one of the most popular coding interview questions asked by top technology companies such as Google, Amazon, Microsoft, Meta, and Netflix. At first glance, the problem appears straightforward. However, the requirement to achieve O(n) time complexity makes it an excellent… Read more

  • PyTorch CNN Shape Mismatch Error: Fixing “mat1 and mat2 shapes cannot be multiplied

    PyTorch CNN Shape Mismatch Error is one of the most common and frustrating issues faced by machine learning engineers and deep learning beginners. If you’ve encountered the dreaded: error while training or evaluating a Convolutional Neural Network (CNN), you’re not alone. The good news is that this error is usually easy to diagnose once you… Read more