Adarsh M

Adarsh M is a full-stack software engineer based in Kerala, India. I write here as I learn — data structures & algorithms, system design, and other things I pick up along the way.

October 16, 2026Bipartite Graphs and Two-Colouring3 min read

Can a graph's nodes be split into two groups so every edge crosses between them? How a BFS that alternates two colours answers it in linear time, why the answer is 'no' exactly when there's an odd cycle, and the problems that are secretly this one — from scheduling to splitting people into teams.

#DSA
October 16, 2026Bitmask DP: Solving the Travelling Salesman for Small n4 min read

When a DP state has to remember which items have been used, a bitmask can encode the set in one integer. How that turns the travelling salesman problem from n! routes into 2ⁿ·n states, the bit tricks you need, and how to recognise problems where n ≤ 20 is a hint.

#DSA
October 16, 2026Connection Pooling: Why Your App Shouldn't Open a Connection per Request3 min read

Opening a database connection costs round trips, TLS and authentication, and every open connection costs the database memory. How a pool reuses a few connections across many requests, how to size it, what happens when it's exhausted, and why serverless and many replicas need an external pooler like PgBouncer.

#System Design
October 16, 2026CSRF: How Another Site Can Act as You3 min read

Cross-site request forgery makes your browser send an authenticated request you never intended — because cookies go along automatically. How the attack works, why it doesn't need to read the response, and the defences that stop it: SameSite cookies, CSRF tokens, Origin checks, and safe GET requests.

#Web

Topics