title: How does Spring know where to search for Components or Beans?
body: <p>In an interview i was asked by the interviewer that "<strong><em>How does Spring know where to search for Components or Beans?</em></strong>". </p>
  
  <p>As I was not aware about the internal flow details I was not able to answer the question properly.</p>
  
  <p>I said through <code>@Component</code> and <code>@Bean</code> we can find. But the interviewer was not happy with the question. 
  If anybody knows please share your knowledge. TIA</p>