Pinned Tweet
Most backend engineers learn in fragments
A tutorial here,
A Stack Overflow answer there.
I spent 10 weeks building the complete picture.
APIs → Caching → Queues → Load Balancing → Microservices → DB Scaling → API Gateway → Monitoring → Security → CI/CD
10 weeks, 10 articles, One foundation.
Full series + all Medium articles in first reply 👇
you have to build your next startup using only one backend stack,
what are you choosing?
• java + spring boot
• node.js + nestjs
• python + fastapi
• go
• .net
no switching later.
5
6
765
Ritesh Roushan retweeted
your x feed isn't random, behind every scroll is a distributed system making millions of decisions in milliseconds.
your x feed isn't random, behind every scroll is a distributed system making millions of decisions in milliseconds.
Ritesh Roushan retweeted
Two engineers designed a payment processing system:
As senior developer, which one going to approve?
Ritesh Roushan retweeted
Clean Architecture is useful when you understand what each layer is responsible for
Most teams add the layers but still mix concerns.
Follow this practical breakdown:
1. Entities (Domain)
• Core business objects and rules
• No framework or database dependency
• Example: Order, Payment, User
• This layer should change the least
2. Use Cases (Application)
• Orchestrates the business flow
• Calls entities and repositories
• Example: PlaceOrder, CancelBooking
• Contains application-specific logic
3. Interface Adapters
• Converts data between layers
• Controllers, Presenters, Gateways
• Maps request DTOs to use case input
• Maps domain objects to database models
4. Frameworks & Drivers (Infrastructure)
• Database, web framework, external APIs
• PostgreSQL, Redis, HTTP clients
• This layer can change without affecting business rules
5. Dependency Rule
• Inner layers should not depend on outer layers
• Use cases depend on interfaces, not concrete classes
• Infrastructure implements those interfaces
6. What usually goes wrong
• Business logic inside controllers
• Database entities used as domain models
• Use cases directly calling framework code
• Too many layers for a simple CRUD app
Clean Architecture helps when the domain is complex and likely to change.
For simple services, a thinner structure is often better.
Do you separate domain logic from infrastructure in your projects?
Clean Architecture is useful when you understand what each layer is responsible for
Most teams add the layers but still mix concerns.
Follow this practical breakdown:
1. Entities (Domain)
• Core business objects and rules
• No framework or database dependency
• Example: Order, Payment, User
• This layer should change the least
2. Use Cases (Application)
• Orchestrates the business flow
• Calls entities and repositories
• Example: PlaceOrder, CancelBooking
• Contains application-specific logic
3. Interface Adapters
• Converts data between layers
• Controllers, Presenters, Gateways
• Maps request DTOs to use case input
• Maps domain objects to database models
4. Frameworks & Drivers (Infrastructure)
• Database, web framework, external APIs
• PostgreSQL, Redis, HTTP clients
• This layer can change without affecting business rules
5. Dependency Rule
• Inner layers should not depend on outer layers
• Use cases depend on interfaces, not concrete classes
• Infrastructure implements those interfaces
6. What usually goes wrong
• Business logic inside controllers
• Database entities used as domain models
• Use cases directly calling framework code
• Too many layers for a simple CRUD app
Clean Architecture helps when the domain is complex and likely to change.
For simple services, a thinner structure is often better.
Do you separate domain logic from infrastructure in your projects?
Ritesh Roushan retweeted
you can get a 4/5 performance rating, give 100%, work late, and stay loyal
yet you're still replaceable the moment business decides otherwise,
Welcome to tech
you can get a 4/5 performance rating, give 100%, work late, and stay loyal
yet you're still replaceable the moment business decides otherwise,
Welcome to tech
Ritesh Roushan retweeted
system design challenge: design a real-time notification system
Imagine building a notification platform that delivers millions of notifications across push, email, SMS, and in-app channels while ensuring reliability, prioritization, and delivery tracking.
Functional Requirements:
• Send notifications across multiple channels (push, email, SMS, in-app).
• Support scheduled, immediate, and recurring notifications.
• Allow users to configure notification preferences.
• Support priority-based delivery.
• Track delivery, failures, retries, and read status.
• Provide notification templates and personalization.
Non-Functional Requirements:
• High availability and fault tolerance.
• Low-latency delivery for critical notifications.
• Scalable delivery infrastructure.
• Reliable delivery with retry mechanisms.
• Prevent duplicate notifications.
• Cost optimization across notification providers.
Scale Assumptions:
• 100M registered users.
• 10M daily active users.
• 50M notifications per day.
• Peak traffic of 50K notifications per second.
• Multiple third-party providers can fail or rate-limit.
• Notifications can be delayed, scheduled, or triggered by events.
Your Task:
Design the complete HLD, covering:
• API Gateway and Notification Service
• Notification Ingestion Pipeline
• Kafka and Event Processing
• Priority Queues and Scheduling
• Delivery Workers
• Provider Routing and Failover
• Retry, DLQ, and Idempotency
• User Preferences and Template Management
• Database Design and Storage Strategy
• Rate Limiting and Backpressure
• Monitoring, Metrics, and Delivery Analytics
How would you design a notification system capable of delivering 50M notifications daily without losing messages or overwhelming external providers?
system design challenge: design a real-time notification system
Imagine building a notification platform that delivers millions of notifications across push, email, SMS, and in-app channels while ensuring reliability, prioritization, and delivery tracking.
Functional Requirements:
• Send notifications across multiple channels (push, email, SMS, in-app).
• Support scheduled, immediate, and recurring notifications.
• Allow users to configure notification preferences.
• Support priority-based delivery.
• Track delivery, failures, retries, and read status.
• Provide notification templates and personalization.
Non-Functional Requirements:
• High availability and fault tolerance.
• Low-latency delivery for critical notifications.
• Scalable delivery infrastructure.
• Reliable delivery with retry mechanisms.
• Prevent duplicate notifications.
• Cost optimization across notification providers.
Scale Assumptions:
• 100M registered users.
• 10M daily active users.
• 50M notifications per day.
• Peak traffic of 50K notifications per second.
• Multiple third-party providers can fail or rate-limit.
• Notifications can be delayed, scheduled, or triggered by events.
Your Task:
Design the complete HLD, covering:
• API Gateway and Notification Service
• Notification Ingestion Pipeline
• Kafka and Event Processing
• Priority Queues and Scheduling
• Delivery Workers
• Provider Routing and Failover
• Retry, DLQ, and Idempotency
• User Preferences and Template Management
• Database Design and Storage Strategy
• Rate Limiting and Backpressure
• Monitoring, Metrics, and Delivery Analytics
How would you design a notification system capable of delivering 50M notifications daily without losing messages or overwhelming external providers?
Ritesh Roushan retweeted
Most LLD interviews fail for the same few reasons
Candidates know the principles but still write designs that are hard to extend.
See what usually goes wrong:
1. Starting with patterns
• “I’ll use Strategy and Factory”
• No clear entities or responsibilities yet
• Patterns should solve a problem, not drive the design
2. Creating god classes
• One class handles too many things
• ParkingLot manages vehicles, payments, and rules
• Hard to change and hard to test
3. Overusing inheritance
• Deep class hierarchies for small variations
• Adding a new type requires changing multiple classes
• Composition is often cleaner
4. Ignoring extensibility
• Design works only for the current requirements
• No thought about adding a new vehicle type or payment method
• Interviewers specifically check this
5. Weak class relationships
• Everything is loosely connected
• Or everything inherits from everything
• Clear ownership and relationships matter
6. Not handling edge cases
• What happens on concurrent access
• Invalid state transitions
• Cleanup and expiry
• These separate average designs from good ones
7. Poor explanation
• Can draw classes but can’t explain why
• No trade-offs
• Interviewer can’t follow the thinking
A good LLD answer is simple, extensible, and easy to explain.
Principles and patterns help only when they make the design clearer.
What’s the most common LLD mistake you’ve seen or made?
Most LLD interviews fail for the same few reasons
Candidates know the principles but still write designs that are hard to extend.
See what usually goes wrong:
1. Starting with patterns
• “I’ll use Strategy and Factory”
• No clear entities or responsibilities yet
• Patterns should solve a problem, not drive the design
2. Creating god classes
• One class handles too many things
• ParkingLot manages vehicles, payments, and rules
• Hard to change and hard to test
3. Overusing inheritance
• Deep class hierarchies for small variations
• Adding a new type requires changing multiple classes
• Composition is often cleaner
4. Ignoring extensibility
• Design works only for the current requirements
• No thought about adding a new vehicle type or payment method
• Interviewers specifically check this
5. Weak class relationships
• Everything is loosely connected
• Or everything inherits from everything
• Clear ownership and relationships matter
6. Not handling edge cases
• What happens on concurrent access
• Invalid state transitions
• Cleanup and expiry
• These separate average designs from good ones
7. Poor explanation
• Can draw classes but can’t explain why
• No trade-offs
• Interviewer can’t follow the thinking
A good LLD answer is simple, extensible, and easy to explain.
Principles and patterns help only when they make the design clearer.
What’s the most common LLD mistake you’ve seen or made?
Ritesh Roushan retweeted
Dumb Vibe Coder Setup:
• ChatGPT
• Cursor
• 47 browser tabs
• Copy-paste every AI suggestion
• No Git commits
• Deploy directly to production
Smart Vibe Coder Setup:
Ritesh Roushan retweeted
interviewer:
your backend is processing 50,000 requests/sec, but the database is becoming the bottleneck.
what would you do first?
A. add read replicas
B. introduce caching
C. shard the database
D. optimize queries and indexes
Dumb Vibe Coder Setup:
• ChatGPT
• Cursor
• 47 browser tabs
• Copy-paste every AI suggestion
• No Git commits
• Deploy directly to production
Smart Vibe Coder Setup:
Two engineers designed a payment processing system:
As senior developer, which one going to approve?
interviewer:
your backend is processing 50,000 requests/sec, but the database is becoming the bottleneck.
what would you do first?
A. add read replicas
B. introduce caching
C. shard the database
D. optimize queries and indexes
Ritesh Roushan retweeted
hey @grok ,
if a company gives you a choice between hiring a developer who solves problems with ai and one who refuses to use ai but writes every line manually, who would you hire and why?







