Skip to content
Sharp

Spring Security interview questions

Spring Security Filter Chain

23 questions with answers and explanations · 23 flashcards

Questions

  1. When configuring Spring Security, which filter should be placed first in the filter chain to handle pre-flight requests?Multiple choiceHard
  2. What HTTP response code does Spring Security typically return for unauthorized requests?Multiple choiceEasy
  3. In a stateless JWT token, what component ensures the token's integrity and prevents tampering?Multiple choiceHard
  4. How does Spring Security handle a request identified as a potential CSRF attack?Multiple choiceEasy
  5. Why is separating authentication from authorization important in a real system?Multiple choiceEasy
  6. What does Spring Security's Authentication Filter primarily do?Multiple choiceEasy
  7. In the context of BCrypt, what does increasing the work factor achieve?Multiple choiceHard
  8. Which of the following filters in the Spring Security Filter Chain is primarily responsible for ensuring that requests originate from trusted sources and not…Multiple choiceEasy
  9. In a Spring Security Filter Chain, which filter is typically responsible for handling authentication?Multiple choiceEasy
  10. In the context of Spring Security, how does the framework ensure that a request has not been tampered with when using JWT?Multiple choiceHard
  11. After the filter chain authenticates a request, where should an order-ownership rule usually be enforced?Multiple choiceHard
  12. Why does HTML encoding user inputs in Java web applications matter in practice?Multiple choiceEasy
  13. Which approach should be used to mitigate SQL injection vulnerabilities in Java applications?Multiple choiceHard
  14. Why can using a weak BCrypt work factor for password storage in Java become a real problem?Multiple choiceMedium
  15. Which of the following best describes the purpose of the Spring Security Filter Chain?Multiple choiceMedium
  16. Why does the CSRF token in Spring Security matter in this design?Multiple choiceMedium
  17. In Spring Security, what role does the SecurityContextHolder play in handling authentication?Multiple choiceMedium
  18. Which Spring Security filter is responsible for handling CORS preflight requests?Multiple choiceMedium
  19. Why do teams use a stateless authentication mechanism such as JWT in Spring Security in production code?Multiple choiceMedium
  20. Which component of the Spring Security Filter Chain is responsible for preventing unauthorized access to protected resources by returning HTTP 403?Multiple choiceMedium
  21. Why is it important to use prepared statements in Java when dealing with SQL queries?Multiple choiceMedium
  22. Why is HTML encoding important in preventing Stored XSS attacks?Multiple choiceMedium
  23. Why is role=CUSTOMER in a valid JWT often insufficient to authorize GET /orders/123?Multiple choiceMedium