Ritesh Roushan (@devXritesh) header
Ritesh Roushan (@devXritesh) profile picture

Software Engineer • Talk about System Design, Distributed Systems and AI Agents • Building B2B SaaS

DM for Collab & Work 📨
Joined February 2018
Photo by Ritesh Roushan (@devXritesh)Photo by Ritesh Roushan (@devXritesh)Photo by Ritesh Roushan (@devXritesh)Photo by Ritesh Roushan (@devXritesh)Photo by Ritesh Roushan (@devXritesh)Photo by Ritesh Roushan (@devXritesh)Photo by Ritesh Roushan (@devXritesh)Photo by Ritesh Roushan (@devXritesh)Photo by Ritesh Roushan (@devXritesh)Photo by Ritesh Roushan (@devXritesh)
Ritesh Roushan retweeted
your x feed isn't random, behind every scroll is a distributed system making millions of decisions in milliseconds.
5
1
11
562
Ritesh Roushan retweeted
Two engineers designed a payment processing system: As senior developer, which one going to approve?
53
11
1
210
42,093
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?
14
1
35
906
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
33
4
1
60
3,036
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?
15
3
29
922
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?
33
1
47
992
Ritesh Roushan retweeted
The most brutally honest rejection ever 😭
62
14
6
387
41,760
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:
43
1
46
1,527
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
16
2
43
10,715
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?
21
1
30
952
Ritesh Roushan retweeted
if you're not a vibe coder, find the bug before a temporary outage becomes a bigger outage
8
2
17
1,851
Ritesh Roushan retweeted
I've been waiting a long time to write this: today, Spring is open to everyone. ​ AI let anyone build without waiting. But instead of building together, everyone became a team of one. ​ That's why we built Spring: a shared environment where product, design and engineering build together on the real product, with the right context, all the way to a pull request. ​ The speed of AI, with the power of a team. From A to PR.
115
28
60
276
231,060
Ritesh Roushan retweeted
As someone who constantly resizes clips, compresses videos, and adds subtitles, this is the kind of tool I actually need. Everything runs locally in the browser. No account required for free tools. AI subtitle generator included. ;clipvuno.com
Introducing ClipVuno 🎉 An all-in-one platform that makes everyday video, image, and file tasks easier for creators, developers, students, and everyone else. Here's what you can do with ClipVuno: 🎬 Video Tools – Convert, compress, and resize videos for different platforms. 🎙️ AI Subtitle Generator – Automatically turn speech in your videos into subtitles, saving hours of manual work. 📸 Image Tools – Resize, compress, and convert images into different formats. 📁 File Utilities – Convert and manage everyday files without switching between websites. ⚡ Fast & Easy – Simple tools designed to get your work done in just a few clicks. 🔗 clipvuno.com Would genuinely appreciate your support, reposts, and honest feedback! ❤️
2
2
12
608
Ritesh Roushan retweeted
okay, this is actually interesting 👀 aml cycle 2 just dropped, and seeing memory systems evaluated across text, code and now multimodal memory makes me curious about how far agent memory is actually progressing. memoraX held its #1 spot in text memory commercial products for the second consecutive cycle, while khipu topped the multimodal open-source track. 402 submissions went through evaluation, and 292 valid leaderboard entries made it through review. there's clearly a lot happening in agent memory right now. went through some of the leaderboard and there's plenty worth exploring: agentmemoryleaderboard.ai which memory approach would you bet on for the next generation of agents?
🤝 Paid partnership
🏆 AML Cycle 2 results are live! 💥 • 1M+ cross-platform impressions • 10M+ cumulative website clicks • 402 task submissions • Three tracks: text, code and multimodal memory This cycle brought together teams from across the global AI community, including teams from Alibaba Cloud DMS, Shopee, OPPO, KT and OceanBase—alongside university researchers, memory startups and independent developers. Explore the full results: agentmemoryleaderboard.ai Highlights and evaluation details below 🧵
39
4
42
1,327
Ritesh Roushan retweeted
if HR tells you on a video call, "today is your last working day. your access will be revoked at 5 PM," don't immediately say: "okay, thanks for the opportunity, can i finish my pending work?" instead, stay calm and ask for everything in writing. say this instead:
29
2
39
3,076
Ritesh Roushan retweeted
If you want to learn Low-Level Design (LLD), start with the fundamentals before jumping into problems Most people fail LLD rounds because they know patterns by name but don’t know when to use them. Here’s what to learn first: 1. Core OOP concepts • Encapsulation • Inheritance vs Composition • Polymorphism • Abstraction These decide how your classes interact. 2. SOLID principles • Single Responsibility • Open/Closed • Liskov Substitution • Interface Segregation • Dependency Inversion Understand the problem each one solves. 3. Design principles beyond SOLID • DRY (Don’t Repeat Yourself) • KISS (Keep It Simple) • YAGNI (You Aren’t Gonna Need It) • Composition over Inheritance These prevent over-engineering. 4. Common design patterns (only the useful ones) • Strategy • Factory • Observer • Singleton (use carefully) • Decorator Learn why the pattern exists, not just the structure. 5. Class relationships • Association • Aggregation • Composition • Inheritance Most LLD problems are about choosing the right relationship. Start with principles. Patterns make more sense after that.
23
3
79
2,299
Ritesh Roushan retweeted
Two senior engineers designed the same system: Engineer A: Used a microservices architecture with 12 services. Engineer B: Built a modular monolith with 4 well-defined modules. Same requirements. Same expected traffic. But Engineer B shipped faster and had fewer operational issues. Whose design would you approve?
39
6
112
18,682
Ritesh Roushan retweeted
the job market humbles freshers real quick, Dumb Fresher: • Applies to 500 jobs • Adds every technology to the resume • Waits for the perfect opportunity • Rejects internships for unrealistic expectations • Says "I know everything" in interviews Smart Fresher:
4
3
35
4,057
Ritesh Roushan retweeted
just a 2am thought: if we don't have redis, can we still scale a system to millions of requests?
17
1
34
1,472
Ritesh Roushan retweeted
Hexagonal Architecture (Ports and Adapters) is useful when you want your core logic to stay independent of external systems Most teams use the name but still couple business logic to frameworks and databases. Let's see how it actually works: 1. Core (Domain + Application) • Business rules and use cases • No dependency on database, web framework, or external APIs • This is the center of the hexagon 2. Ports • Interfaces that define how the core talks to the outside • Input ports: what the application can do (e.g. PlaceOrder) • Output ports: what the application needs (e.g. OrderRepository, PaymentGateway) 3. Adapters • Implementations of the ports • Driving adapters: HTTP controllers, CLI, message consumers • Driven adapters: PostgreSQL repository, Redis cache, third-party API client 4. Dependency direction • Adapters depend on ports • Core depends only on ports (interfaces) • Infrastructure never leaks into the domain 5. Practical benefits • Easier to test use cases without a database • Swap PostgreSQL for another store with less change • Add a new input (e.g. gRPC) without touching business logic 6. Common mistakes • Putting business logic in controllers • Letting database models become domain models • Creating ports for everything, even simple cases • Over-engineering small services Hexagonal Architecture is not about drawing hexagons. It’s about keeping your core logic testable and independent of delivery mechanisms and infrastructure. Are you using ports and adapters, or is your business logic still tied to the framework?
14
6
59
2,003