seniorSpring

How does Spring handle lazy initialization of beans?

Updated May 17, 2026

Short answer

Lazy initialization delays bean creation until it is first used.

Deep explanation

By default, singleton beans are eagerly initialized at startup. Using @Lazy defers instantiation, reducing startup time but shifting cost to first request. It can also help break circular dependencies.

Unlock with a Pro subscription to view this section.

View pricing

Real-world example

No real-world example available yet.

Unlock with a Pro subscription to view this section.

Upgrade to Pro

Common mistakes

No common mistakes listed yet.

Unlock with a Pro subscription to view this section.

Upgrade to Pro

Follow-up questions

No follow-up questions available yet.

Unlock with a Pro subscription to view this section.

Upgrade to Pro

More Spring interview questions

View all →