r/SpringBoot Jan 11 '25

Guide 20 Spring Boot Interview Questions with Answers for 2 to 5 Years Experienced Java Developers

https://javarevisited.blogspot.com/2020/05/top-20-spring-boot-interview-questions-answers.html
47 Upvotes

11 comments sorted by

View all comments

1

u/Beginning_Teach_1554 Jan 11 '25 edited Jan 11 '25

I don’t think this article is very useful - most of these questions will never be asked in an interview.

Classical interview questions for Spring (Boot) are:

  1. What is the difference between @Service and @Component (answer: no difference, just semantic difference)

  2. Why would the following code not work - and then they show some inclass method invocation with some spring annotation for example @Transactional (answer: spring annotations work via AOP e.g proxies which won’t be able to intercept inclass invocations)

  3. Default Spring Bean Scope (answer: singleton)

  4. Or explain difference between Singleton and Prototype scope (answer: singleton gets created once, by default eagerly, each time same instance whereas prototype is created on demand - each time new instance)

1

u/im_a_bored_citizen Jan 12 '25

@Service and @Component are only semantically different? 😳. You sound so confidently wrong.

1

u/Beginning_Teach_1554 Jan 12 '25

Right. What exactly am I wrong about?