Ritesh Roushan retweeted
developer, a simple question for you:
your mobile app uses /api/v1/users,
but you need to change the response structure.
how do you avoid breaking existing users?
Ritesh Roushan retweeted
a junior developer presents this system design to you,
take a look at the approach.
would you approve it for production, or ask them to change something first?
Ritesh Roushan retweeted
every AI giant has a different strategy,
who do you think will win the AI race: OpenAI, Anthropic, Google, Meta, xAI?
Ritesh Roushan retweeted
two devs, same deadline
A) spends 5 hours coding manually.
B) ships in 1 hour using AI and verifies everything.
who's the better engineer?
Ritesh Roushan retweeted
which developer would you hire?
A) uses AI to build faster
B) writes everything from scratch
speed or fundamentals?
Ritesh Roushan retweeted
System Design: How would you build an AI agent orchestration platform?
Imagine asking 3 AI agents to complete one task:
→ Agent 1 writes the code.
→ Agent 2 reviews it.
→ Agent 3 runs tests before merging.
Sounds simple, right?
The real challenge is coordinating everything reliably.
1. Orchestration Layer
- A central orchestrator assigns tasks, tracks workflow state, and coordinates agents.
2. Workflow Engine
- Represent dependencies as a DAG.
- Code writing must finish before review starts, and tests run after approval.
- Independent tasks can execute in parallel.
Each task follows a state machine:
"PENDING → READY → RUNNING → COMPLETED"
On failure:
"RUNNING → RETRY_WAIT → READY"
If retries are exhausted, the task moves to "FAILED".
Persist state transitions so workflows can recover after crashes.
A task becomes "READY" only when its dependencies are satisfied.
3. Execution Queue
- Use Kafka or a durable job queue to distribute tasks to workers.
- Workers claim jobs, execute them, and report results.
- Use idempotency keys to prevent duplicate processing.
4. Failure Handling
Failures are inevitable. Design for them.
- Transient errors: Retry with exponential backoff and jitter.
- Repeated failures: Move tasks to a dead-letter queue for investigation.
- Worker crashes: Use leases and heartbeats to detect abandoned tasks and safely reassign them.
- Model/API timeouts: Apply timeouts, retry limits, and circuit breakers.
- Partial failures: Persist completed outputs so successful agents don't need to rerun unnecessarily.
- Invalid agent output: Validate results before allowing dependent tasks to proceed.
Never assume a retry means the previous execution didn't happen.
Use idempotency and durable checkpoints to avoid duplicate side effects.
5. Shared Context
- Store task instructions, agent outputs, code diffs, logs, and conversation history in shared storage.
- Pass each agent only the context it needs.
6. Conflict Prevention
- Give coding agents isolated Git branches or worktrees.
- Validate diffs, run tests, and merge only after conflict checks and required approvals.
7. Observability & Cost Control
- Track token usage, model costs, execution time, retries, and failure rates.
- Set budgets and stop runaway workflows.
8. Pause, Resume & Cancel
Persist workflow state in PostgreSQL.
- Pause: Stop scheduling new tasks and let active workers reach safe checkpoints.
- Resume: Requeue eligible tasks.
- Cancel: Stop pending tasks and signal active workers to terminate safely.
Keep "FAILED" and "CANCELLED" separate: one means execution failed; the other means execution was intentionally stopped.
Architecture at a glance:
Developer → API → Orchestrator → Workflow Engine → Durable Queue → Agent Workers
Supporting services:
- PostgreSQL - workflow state and checkpoints
- Redis - caching and short-lived coordination
- Object storage - logs, artifacts, and code outputs
- Retry/DLQ mechanism - failed task recovery
- Observability - logs, metrics, traces, and cost tracking
The key principle: assume every component can fail, and make recovery part of the architecture.
How would you prevent two agents from modifying the same files and accidentally overwriting each other's work?
System Design Problem: Design an AI Agent Orchestration Platform.
A developer asks multiple AI agents to work on a large task.
One agent writes code, another reviews it, and another runs tests before the changes are merged.
Requirements:
- Coordinate agents working on the same task
- Manage task dependencies and execution order
- Share context and results between agents
- Handle agent failures and retry tasks
- Prevent conflicting code changes
- Track token usage and execution costs
- Pause, resume, or cancel workflows
How would you design the architecture?
Ritesh Roushan retweeted
I was asked this in an Uber SDE-1 interview last year.
Problem:
Design the low-level system for matching a rider with the nearest available driver.
My answer:
I’ll store drivers in a hash map keyed by driver ID. When a rider requests a ride, I’ll scan all online drivers, calculate distance for each, and pick the closest one. Then mark that driver as busy.
But then they asked:
How does this work when you have 50k online drivers in a city, and 200 ride requests come in at the same second?
I knew the interview was cooked right there.
What’s your response to get selected?
Ritesh Roushan retweeted
How Kafka works under the hood?
Kafka is not a simple message queue,
It is a distributed commit log.
Let's see what actually happens when a producer writes and a consumer reads:
1. Messages are written to a partition
• A topic is split into partitions
• Each partition is an ordered, append-only log
• Producers write to one partition (by key or round-robin)
• Order is guaranteed only inside a single partition
2. Data is stored on disk, not just in memory
• Messages are appended to log segments on disk
• Kafka uses sequential writes, which are fast
• Old segments are cleaned based on retention (time or size)
• This is why Kafka can hold data for days or weeks
3. Replication keeps copies
• Each partition has a leader and followers
• Producer writes only to the leader
• Followers pull data from the leader
• A message is considered committed only after enough replicas have it (ISR)
4. Consumers pull, they don’t get pushed
• Consumers track their own offset
• They ask the broker for the next messages from a partition
• This pull model lets slow consumers catch up without overwhelming the broker
• Offsets are stored (usually in an internal topic)
5. Consumer groups share the load
• One consumer group reads a topic together
• Each partition is assigned to only one consumer in the group
• Adding consumers can increase throughput, but only up to the number of partitions
• Rebalancing happens when consumers join or leave
6. Brokers are stateless for consumers
• Brokers don’t track what each consumer has read
• Consumers store their own progress
• This makes scaling consumers easy and keeps brokers simpler
7. High throughput comes from batching and sequential I/O
• Producers batch messages
• Compression reduces network and disk usage
• Sequential disk writes avoid random I/O
• This is why Kafka can handle millions of messages per second
Kafka’s power is not magic.
It is an append-only log, replication, and consumers that pull at their own speed.
Have you used Kafka for something other than simple event streaming?
Ritesh Roushan retweeted
if you think you're good at backend development,
this bug shouldn't survive your code review.
what's the bug, and how would you fix it before it costs real money?
Ritesh Roushan retweeted
if you think you understand rate limiting,
explain why your Redis-based limiter might still fail when traffic hits 1M requests/sec.
which architecture would you trust in production?
Ritesh Roushan retweeted
these days, a lot of candidates are getting rejected in interviews after riding the AI hype.
i've seen people share their interview experiences where they couldn't answer basic questions about the fundamentals behind the projects they built using AI.
Ritesh Roushan retweeted
hey ted @notmiramurati ,
i registered on unfair.so 3 weeks ago, and my page is still waiting for verification.
i can see campaigns now, but i'm still waiting for approval.
also, check your dms, bro. i've already shared my page with you there.
just verify my page so i can get started.
Ritesh Roushan retweeted
tech lead asks:
your database is handling 10k requests/sec. would you scale it vertically, add read replicas, or introduce sharding?
your answer reveals how much you actually understand system design.
Ritesh Roushan retweeted
have you ever wondered why RAM comes in 8, 16, 32, 64, 128 GB...
but rarely 10, 20, or 100 GB?
there's a computer science reason behind this.
do you know why?
Ritesh Roushan retweeted
List of Companies hiring for SDE-1 roles
Entry-level hiring is not closed.
It is just more selective than it used to be.
check this practical list of companies that regularly hire SDE-1 / Associate Software Engineers in India (as of late 2026):
1. Amazon
• Actively hiring SDE-1 through University Talent Acquisition
• Locations: Hyderabad, Bengaluru, Chennai, others
• Focus: DSA, problem-solving, Leadership Principles
• Strongest structured path for freshers right now
2. Microsoft
• Regular SDE-1 / Software Engineer hiring for India Development Centers
• Focus: Coding + fundamentals
• Off-campus and campus both possible
3. Google
• Hiring exists, but volume is lower for pure freshers
• Stronger path is intern → return offer or strong OA performance
• High bar on coding and problem-solving
4. Flipkart, Swiggy, Zomato, PhonePe
• Product companies that hire SDE-1
• Focus: Backend, scalability basics, ownership
• Good for people who want real product experience early
5. Startups (Series A–C)
• Abstrabit, various AI and SaaS startups
• Often open to 0–1 year experience
• Skills: Full-stack or backend with ability to ship features
6. Banks and fintech
• Citi, Mastercard, and similar
• SDE-1 / Associate roles in engineering teams
• Focus: Java, SQL, system basics
7. Product companies (Salesforce, Adobe, Atlassian-style)
• Hire Associate / SDE-1 roles in India
• Usually prefer some internship or project experience
What actually gets you shortlisted for SDE-1:
• Clean DSA (medium problems under time pressure)
• One or two solid projects with code on GitHub
• Ability to explain your code and trade-offs
• Basic system design awareness (even at entry level)
Amazon is currently the most consistent structured option for pure freshers in India.
Other companies hire, but the volume and process vary a lot.
Are you targeting Amazon-style structured hiring, or product startups for your first role?
Ritesh Roushan retweeted
if you think you're good at system design,
design an AI agent that can remember, reason, and call APIs.
which architecture would you choose?
Ritesh Roushan retweeted
AI might be the fastest-growing industry in history and still one of the hardest ways to make money.
Why are AI companies burning billions despite explosive user growth?
A) GPU and infrastructure costs
B) Free users consuming expensive compute
C) Price wars killing profit margins
D) Users love AI but won't pay enough
Ritesh Roushan retweeted
Companies are still hiring Software Engineers every single day
The market is not dead,
The numbers are just different from what most people see on LinkedIn.
See what top companies are paying in 2026 (US total compensation):
1. Anthropic
• Role: Software Engineer / Member of Technical Staff
• Median TC: ~$880K+
• Skills: Production systems, LLM infrastructure, reliability, strong CS fundamentals
2. OpenAI
• Role: Software Engineer / Research Engineer
• Median TC: ~$875K
• Skills: Distributed systems, model serving, evaluation, shipping under ambiguity
3. xAI
• Role: Software Engineer
• Median TC: ~$620K
• Skills: Large-scale infrastructure, training systems, backend performance
4. Meta
• Role: E5 Senior Software Engineer
• TC range: ~$400K–$450K+
• Skills: System design, product sense, high-scale backend, coding interviews
5. Google
• Role: L5 Senior Software Engineer
• TC range: ~$400K–$430K
• Skills: Algorithms, system design, distributed systems, ownership
6. Netflix
• Role: Senior Software Engineer
• TC range: ~$400K–$550K (high base, low equity)
• Skills: Full ownership, strong judgment, production reliability
7. Stripe / Databricks
• Role: Senior / Staff Engineer
• TC range: ~$400K–$700K+ at senior+ levels
• Skills: Payments / data systems, API design, reliability at scale
Key reality:
• Most of the extreme numbers are total compensation (base + equity + bonus), not cash in hand.
• AI labs and infrastructure companies are currently paying the highest premiums.
• Traditional FAANG still pays very well, especially at senior levels.
• The skill that separates candidates is not “I know Python” It is system design + production experience + ability to ship.
The race is still on.
The companies that pay the most are looking for people who can build and run real systems, not just solve LeetCode.
Which company are you targeting right now, and what skill are you weakest in for that level?








