Explain what design patterns Spring Boot uses internally.
Interviewers arent asking if you know the patterns.
They are checking if you understand how Spring Boot is architected using them.
1. Singleton Pattern
Spring Boot Beans are Singleton by default.
When you annotate a class with @ Component, @ Service, or @ Repository, Spring creates only one instance by default.
You should say:
"All Spring beans are Singleton by default unless specified otherwise with scopes like @ RequestScope, which optimizes memory and ensures a consistent shared object graph."
2. Proxy Pattern
Spring AOP (Aspect-Oriented Programming) uses Proxies
3. Observer Pattern
Spring Event system = Observer pattern in action.
4. Factory Pattern
Spring uses factories everywhere.
BeanFactory, ApplicationContext, FactoryBean
You define a bean -> Spring decides when and how to instantiate it.
5. Builder Pattern
Used in clients like RestTemplateBuilder, WebClient.Builder.
Almost the whole video was about prompts. LLM are been Fine Tuned enough via SFT phases that we no need to think so must about prompts, rather thinking of how to manage the context window of you session, is the key to AI supposed development. Context Window was always the bottleneck which effect the quality.
Two Anthropic engineers spent 24 minutes exposing every Claude Code feature you didn't know existed.
Most people will scroll past this. Don't be most people.
@SumitM_X T
We cannot modify the collection while iterating on it. I recently discovered while solving a dsa problem where i was trying to modify an hashmap while iterating it.
It'll cause concurrent modification exception.
What will be the output?
List<String> list = new ArrayList<>(List.of("a", "b", "c"));
list.stream().forEach(e -> {
if (e.equals("b")) list.remove(e);
});
System.out.println(list);
Both have same idea. The difference is Observer pattern is implemented in our codebase where situations like something should happen when event occurs and we orchestrate using classes. Pub/Sub is same things but used to decouple the systems and facilitate asynchronous communication between them.
Simple Observer pattern is doen internally on the codebase, Pub Sub is for 2 system to communicate asynchronously.
the async communication between services might get destroyed if the message queues which facilitates the communication crashes. Nothing is perfect there are ways to face it.
1. Using managed distributed service instead on hosting our own instance of a queue, the vendors give us crash recovery out of the box.
2. The Jobs with are pending are marked as pending when the system crashed, Which we can be deal with it once the system is online agian.
For 2 systems to communicate they need to pass info between them. REST is based on HTTP protocol which is used mostly communication between servers and clients which involves JSON parsing.
MCP is based on JSON RPC which is also based on HTTP, and its main objective is to expose the functionalities via executable remote functions. These Functions are nothing but Tools which LLM use. The client like an claude desktop calls these MCP servers from which they get response form the executed fucntions, eg fetching a GitHub repo etc. They both use the same protocols, The difference is their purpose, we can implement our own MCP via simple HTTP and TCP, The particular senario of a LLM using Tools via a client and get response for a server is MCP. And general Web client and server communication is REST.
@DINESHVERM578 Rust, it has a very different learning curve than all other languages. Rust is made for people who understand the drawbacks or there previous lang and want to improve performance and productivity.
Cpp- manual memory management
Java - Runtime Overhead
Python - Everything.
The videos are never stored in the AWS, AWS only has the meta data of the shows and all the content. Open Connect, Netflix's own CDN which is in almost in every IPS across the regions, is hit when user press play, each CDN server get traffic form regions near it, Hence the load is distributed. Open Connect is the thing which made Netflix playback latency so low.
Applied System Design (Real Scale) 6
Netflix's Zero Buffer Streaming Architecture
Problem
When a new season of a hit show drops at midnight, 100M people hit 'Play' at the same time.
Why doesn't the AWS cloud where Netflix runs crash?
@SumitM_X When the req goes through the ISP the IP is changed to its own public IP, so when a 2 users are on same ISP then there both IP are same, Even though they are different uses. Ports are assigned by ISP are mapped to original ports but there can be reused very quickly.
Striver.
Raj Vikramaraj was placed at Amazon from NIT.
Good package. Great company.
But kept getting messages from juniors.
"Bhaiya how do you prepare?"
"Bhaiya which resources?"
Started making DSA videos to answer them.
No fancy setup. Just screen recording and passion.
Quit Amazon at peak career.
Everyone thought he was crazy.
Built TakeUForward.
Free DSA sheet used by millions.
A2Z DSA course that became the bible for placements.
Cracked by students at Google, Microsoft, Amazon.
All crediting one free sheet.
The Amazon engineer who left to teach for free.
Ended up building the most trusted placement resource in India.
this is how my github looks right now…
and honestly - it looks like shit
- no real projects
- no meaningful commits
am I cooked guys? I'm a sophomore btw 😭😭..
JWT is a way we authenticate a user,
RAG is a way we provide extra context for an LLM based on natural language queries.
New approaches don’t replace the old ones they build on them.
For example, we moved from session-based authentication to JWTs, not because sessions “died,” but because JWTs offer advantages in certain scenarios like scalability and stateless systems.
Saying “session-based auth is dead” or “web development is dead” is just noise. That kind of thinking lacks perspective.
The reality is: technologies evolve, they don’t suddenly become useless.
A lot of what you see online is exaggerated takes meant to grab attention not to inform. Don’t fall for that.
Real production traffic is much bigger than the dev environment.
And the lazy loading makes it more slow, where when we fetch users we don't fetch all its info, the info is fetched as we ask for it like getOrder again users db pool and tries to fetch, which usually keep db occupied all the time
You write:
List<User> users = userRepo.findAll();
for (User u : users) { System.out.println(u.getOrders().size());
}
Why is this slow in production but fine in dev?
As a developer,
have you ever wondered:
When Instagram loads comments instantly…
Are all comments fetched in one API call?
Or lazy loaded with pagination?