<Mehraj Hosen/>

Passionate Software Engineer with expertise in MERN and PERN stack. I enjoy System Design, High-Level Design (HLD), and building scalable, distributed systems — turning complex problems into clean, maintainable, and production-ready solutions using the modern JavaScript ecosystem and strong architectural practices.

Dhaka, Bangladesh

bannerImage

AboutMe;

bannerImage

Hi, I'm Mehraj — a passionate full-stack developer specializing in MERN (MongoDB, Express, React, Node.js) and PERN (PostgreSQL, Express, React, Node.js) stacks. I build scalable, high-performance web applications with clean code, responsive UIs, and robust backends. I've successfully delivered multiple freelance projects — from startups to mid-sized businesses — including e-commerce platforms, SaaS dashboards, admin panels, and real-time features. I also enjoy system design, performance optimization, API architecture, and turning client visions into production-ready products quickly and reliably. Love solving challenging problems and delivering value. Let's collaborate and build something impactful!

Education & Trainings;

MERN Stack Development

Creative IT Institute

2025-2026

MERN Stack Development

Interactive Cares

2025-2025

System Design: Theory to Implementation

Interactive Cares

2026-2026

[My Projects]

BUG Social App

A modern social media web application with features like posts, friends, messaging, groups, pages, and notifications – built using Vite + React + Tailwind on the frontend and Firebase on the backend.

✨ Features

👤 Account & Profile

  • Easy Signup / Login / Logout

  • Complete Profile Page (Photo, Cover, Bio, Location)

  • Ability to post on own profile

📝 Posts & Feed

  • Create Text + Image Posts

  • Feed Tabs: Global / Following / Groups

  • Edit & Delete Post

  • Share Post (with original content)

  • Event / Job / Product type Posts

  • Add Story option & reply to story messages

💬 Interaction

  • Like / Reaction Count

  • Comment (Add / Edit / Delete)

  • Share to Timeline

👥 Friends & Follow System

  • Friend Request (Send / Accept / Cancel)

  • Friend List & Unfriend option

  • User/Page Follow & Unfollow

✉️ Messaging

  • Direct Message (DM)

  • Group Chat & Page Inbox Messaging

  • Quick DM (Auto message from Interested/Buy/Apply click)

  • Typing Tracker (see when someone is typing)

🔔 Notifications

  • Like, Comment, Follow/Unfollow, Friend Actions & Message Notifications

  • Unseen Badge & Seen Support

📄 Page System

  • Create Page & View List

  • Page Profile & Post as Page

  • Follower CTA: Interested / Buy / Apply

👨‍👩‍👧 Group System

  • Group Posts (Admin / Member / Anonymous)

  • Group Chat

  • Separate Tab for My Group Posts

  • Public & Private Group System

🔎 Search & Navigation

  • Search Box & Result Modal

  • Navbar: Home / Notifications / Messages / Profile

🎨 UI Helpers

  • Loader, Skeleton, Toast

  • Fullscreen Overlay & Modal

⚡ Others

  • Custom 404 Page

  • Protected Route (Profile access only after login)

🛠️ Tech Stack

  • Frontend: Vite + React + Tailwind CSS

  • Backend: Firebase (Auth, Firestore, Storage, Realtime DB)


vitereacttailwindfirebase

/System Design & Case Studies/

Design Online Shopping Platform (E-Commerce)

Overview–

Online shopping platform that allows users to purchase mobiles, laptops, cameras, and books. Watches, apparel, shoes, etc.


Functional Requirements–

  • User should be able to search and find products based on product titles or names.

  • User should be able to view the details of the product (Description, image, available quantity, review)

  • User should be able to select the quantity and move the item to cart.

  • User should be able to make the payment and do the checkout.

  • User should be able to check the status of the order

  • Manage purchase of items having limited stock.


Non-Functional Requirements—

  • Scale: 10M MAU and 10 orders/sec

  • CAP Theorem: Highly available with respect to searching and viewing the items, and highly consistent with respect to placing the order and payment.


Core Entities—

  • User

  • Product

  • Cart

  • Order

  • Checkout

API–

  1. // Search Product

  1. GET: /products/search?q={seachTerm} → List <ProductId> list : Pagination

  1. // Product Detail

    1. GET:  /products/{productId}→ return the product details (json)

  2. // Insert Data

    1. POST: /cart {body: all product Id} → return cartId

  3. // checkout and payment

    1. POST: /checkout {body: all product Id with wty and price} → orderId

    2. POST: /payment {body: orderId and payment details} → confirmation

  4. // order Status

    1. GET: /status/{orderId}


High-Level Design–


Read Case Study →

Design Web Crawler

Overview–

A web crawler is a program that automatically traverses the web by downloading web pages and following links from one page to another. It is used to index the web for search engines, collect data for research, or monitor websites for changes.


Problem Definition–

  • Design a web crawler to extract text data from the web and store it to train an LLM.

  • Your crawler can run for only 5 days.


Functional Requirements–

  • Crawl the full web starting from seed urls

  • Extract text data and store


Scale–

  • 10B web pages

  • 2MB per page avg.

  • 5 days to scrape

  • Unlimited resources (withing reason)


Non-Functional Requirements–

  • Fault tolerant

  • Politeness

  • Scale to 10B pages

  • Efficiently crawl in under 5 days


Core Entities—

  • Text Data

  • URL metadata

  • Domain metadata


Interface–

input – set of seed urls

Output – text data


Data Flow–

  1. Take seed urls from a frontier and the IP from DNS

  2. Fetch HTML

  3. Extract text from HTML

  4. Store that text in database

  5. Extract the urls in the text and add to our frontier

  6. Repeat steps 1-5 until all urls have been crawled


High-Level Design–


Efficiency–

  1. Don’t crawl a URL that has already been added.

  2. Don’t parse a webpage with duplicate content that has already been parsed.

Read Case Study →

Design Youtube

Overview–

YouTube is a video-sharing platform that allows users to upload, view, and interact with video content. As of this video, it is the second most visited website in the world.


Functional Requirements–

  1. Users should be able to upload videos.

  2. Users should be able to watch/stream videos.


Scale 

~1M uploads/day

100M DAU

Max video size of 256GB


Non-Functional Requirements–

  • Availability >> Consistency for video uploads

  • Support uploading/streaming for large videos (256GB)

  • Low latency streaming (<500 ms) is true in low bandwidth

  • Scalability to scale to 1M uploads per day and 100M views


Core Entities—

  • User

  • Video

  • Video Metadata


API

//upload a video

POST /videos

{

videoMetadata

}

//watch a video

GET /videos/:videoId → video & videoMetadata


High-Level Design–



Read Case Study →

[My Articles]

The 1% Mindset: The Real Secret to Success

The 1% Mindset: The Real Secret to Success

By Mehraj H.

July 2026

The gap between where you are right now and what you want to wear isn’t about money, relationships, or success. It’s all attitude—1% attitude.


The top 1% don’t have more hours in a day than you do. They just behave differently. They minimize distractions, concentrate on their desires, and show up every single day—even when they don’t feel irresistible.


Success is not about being the most talented or the smartest person in the room. It's almost community. No one is watching, no one is clapping, and the results are not coming fast enough to take pictures. The 1% embody conflict because they recognize growth as outside the most effective comfort zone.


Think of a bamboo tree. You water and feed it every day for years and don’t take advantage of any signs of growth you see. Then suddenly, it quickly explodes. All of that was building strong foundations. Your small daily efforts make paintings the same way—they combine to create explosives time and time again.


Key Truths About the 1% Mindset:

  • Failure is not always the end—notes and practice.

  • The model is second to none. The right time is now.

  • Take responsibility. No one is coming to save you.

  • Train yourself, work, and keep moving forward.


You have everything to create the lifestyle you need with the interior you want. Stop settling for “right enough." Choose to be a part of the 1%.

Let's start today. Build a taller shelter. Press it a little more. Never give up.


The journey will not be easy, but it will be worth it. You got this!


One percent Mindset



Bloom Filters

Bloom Filters

By Mehraj H.

May 2026

Every time you visit a webpage, Chrome quietly runs a check — is this URL malicious?
It doesn't call a server. It doesn't scan a massive database. It uses a Bloom filter. And it gets an answer in microseconds. That's the magic of this data structure. Small. Fast. Brilliant. So what exactly is a Bloom filter?

It's a probabilistic data structure — a fancy way of saying it trades a small chance of being wrong for massive gains in speed and memory. Here's how it works: you have a bit array (just a row of 0s and 1s) and a few hash functions. When you add an item, the hash functions each point to a position in the array and flip those bits to 1. When you query for an item, you check those same positions. All 1s? Probably in the set. Even one 0? Definitely not in the set.

That "definitely not" is the superpower. Why does that matter? Imagine you're Cassandra or HBase, and someone queries for a key that doesn't exist. Without a Bloom filter, you'd do a full disk read — expensive, slow. With one, you check in memory first. If it says "definitely not here," you skip the disk entirely. Gone. Saved.

Medium uses Bloom filters to avoid recommending articles you've already read. Akamai uses them to decide whether a URL is worth caching. Redis has them built in. One data structure, sitting quietly behind some of the biggest systems in the world.
The honest trade-off: Bloom filters can give false positives — they might say "probably yes" when the answer is actually no. But they never give false negatives. If it says no, trust it completely. And the memory savings? For 1 million items, a HashSet needs ~100MB. A Bloom filter? Around 1MB. Same job. 100x less memory. When should you actually use one?

When you need to check membership at scale, can tolerate rare false positives, and can't afford the cost of always hitting disk or a remote database. Spell checkers, fraud detection, network routers, CDN caches — the use cases are everywhere once you start looking.

It's not a replacement for a database. It's the bouncer at the door that turns away the obvious misses before they waste anyone's time. One bit array. A few hash functions. Millions of expensive lookups saved every second. Not bad for a 1970 invention.

#SystemDesign #BloomFilter #DataStructures #SoftwareEngineering #BackendDevelopment #DistributedSystems #DatabaseOptimization #WebPerformance #Programming #TechLeadership #ComputerScience #SoftwareArchitecture

Cache Invalidation

Cache Invalidation

By Mehraj H.

May 2026


"There are only two hard things in computer science: cache invalidation and naming things." — Phil Karlton


I used to laugh at this quote. Then I spent a week debugging why our users were seeing prices from 3 hours ago. I stopped laughing.

Here's what nobody tells you about caching: the moment you add one, you stop having one source of truth. You now have two—your database and your cache. And keeping them in sync? That's the real job.

Why is it so genuinely hard?

It's not a single problem. It's a cluster of problems wearing a trench coat.

Data changes in unpredictable ways. A user updates their profile. An inventory item sells out. A price gets revised. Your cache doesn't know any of this happened — it just happily keeps serving the old value, convinced it's being helpful.

Then there's timing. Even when you do invalidate the cache, there's a window — however small — where stale data leaks through. In distributed systems with dozens of nodes, that window multiplies.

And then the classic trap hits: you delete a cache entry right as another process is reading it, a third process is writing to the DB, and a fourth is about to repopulate the cache with the old value. Welcome to race conditions.

The strategies engineers actually use:

→ TTL (Time-to-Live): Set an expiry. Simple, predictable. But you're accepting "stale for up to X minutes" as a business decision, not just a tech one.

→ Write-through: Update cache and DB together on every write. Consistent, but adds latency to your writes.

→ Write-behind (write-back): Update cache first, sync to DB asynchronously. Fast writes are risky—if the cache dies before the sync, you lose data.

→ Event-driven invalidation: Publish a change event whenever data updates; subscribers invalidate the relevant cache keys. Elegant at scale, complex to implement correctly.

The lesson I keep coming back to:

Caching is never just a performance decision. It's a consistency decision. Every cache entry is a bet that the data won't change before the TTL expires — or that you'll catch it when it does.

The engineers who get burned by cache bugs aren't the ones who don't understand caching. They're the ones who underestimated how many moving parts stand between "data changed in the DB" and "cache reflects that change."

Phil Karlton said it in the 90s. Thirty years of distributed systems later, it's still true.

If you're building anything at scale, treat cache invalidation with the same seriousness you'd give schema migrations or API versioning. It deserves it.


My NPM Packages

Loading your NPM packages...

[Get In Touch]

Have a project in mind? Want to collaborate? Or just say hi? Feel free to reach out — I reply within 24 hours!

Location

Dhaka, Bangladesh

© 2026 Mehraj Hosen. All rights reserved.