The Two Pointer Technique: A Complete Guide

The two-pointer technique is one of the most common and powerful patterns used in competitive programming, data structures, and algorithms. It helps solve problems that involve searching, sorting, or traversing arrays, strings, or linked lists in an efficient way. Core The two-pointer technique is a way to solve array, string, and linked list problems using … Read full article: The Two Pointer Technique: A Complete Guide

Python Multiprocessing: Escaping the GIL

Why Multiprocessing exists? Python’s Global Interpreter Lock (GIL) allows only one thread to execute Python bytecode at a time, no matter how many CPU cores your machine has. Threading in Python is excellent for I/O-bound work — a thread waiting on a network response or disk read releases the GIL so another thread can run. … Read full article: Python Multiprocessing: Escaping the GIL

Understanding Parallelism, Asynchronous, Synchronous, Concurrency

Synchronous and asynchronous execution have a close relationship with parallelism and concurrency, two important concepts in computing that describe how multiple tasks can be handled. While they all deal with managing tasks, each term focuses on a different aspect of task execution. Let’s break down how synchronous, asynchronous, parallel, and concurrent execution are related. Introduction … Read full article: Understanding Parallelism, Asynchronous, Synchronous, Concurrency

Understanding Concurrency vs. Parallelism: The Definitive Guide

In software engineering and computer science, concurrency and parallelism are two of the most frequently confused concepts. Developers often use them interchangeably, but they describe fundamentally different aspects of system architecture and execution. Understanding this distinction is key to writing scalable, efficient, and responsive applications. Defination Concurrency where multiple tasks execute within the same time … Read full article: Understanding Concurrency vs. Parallelism: The Definitive Guide

Inside CPython’s Memory Allocator: Arenas, Pools, and Blocks

CPython ships its own specialised memory manager called pymalloc, which sits between the Python interpreter and the C-level malloc(). Pymalloc organises memory into a three-level hierarchy: Arena, Pool and Block Introduction Every time you create a small Python object — an integer, a short string, a tuple, a small dictionary — CPython has to find … Read full article: Inside CPython’s Memory Allocator: Arenas, Pools, and Blocks

Context Managers: The Cleanup Problem

Context managers in Python are constructs that allow you to properly manage resources, ensuring that they are acquired and released correctly. They are primarily used with the with statement to handle resources like file handling, database connections, threading locks, etc. The Issue Every resource you open — a file, a database connection, a network socket, … Read full article: Context Managers: The Cleanup Problem

Sharding

How to split a database across machines — the trade-offs, the strategies, and the failure modes that trip up real systems at scale. What sharding is A single database node has hard physical ceilings: disk capacity, RAM, CPU cycles, and write throughput are all finite. For most applications, this is fine for years. But at … Read full article: Sharding

Vertical vs Horizontal Scaling: A Complete Guide for System Designers

Every system hits a wall eventually. Requests pile up, latency climbs, and the database starts sweating. At that moment, every engineer faces the same fork in the road: do we make the machine bigger, or do we add more machines? That choice — vertical scaling versus horizontal scaling — is one of the most consequential … Read full article: Vertical vs Horizontal Scaling: A Complete Guide for System Designers

Demystifying HyperLogLog: How to Count Billions of Things in Kilobytes of Memory

Imagine you are running a rapidly growing website like backendmesh.com. One morning, a post goes viral. Traffic skyrockets. Millions of clicks are pouring in, and your boss asks a simple question: “How many unique visitors did we get today?” Introduction In the early days of the web, this was an easy question to answer. You … Read full article: Demystifying HyperLogLog: How to Count Billions of Things in Kilobytes of Memory