Spring Boot

Request & Response Handling

@PathVariable, @RequestParam, @RequestBody, @RequestHeader, content negotiation, JSON serialization

20 คำถามสัมภาษณ์·
Mid-Level
1

Which annotation allows extracting a value from an HTTP header in a Spring MVC controller?

คำตอบ

@RequestHeader allows extracting values from HTTP headers of the incoming request. This annotation automatically binds the value of a specific header to a method parameter. It supports type conversions and can be made optional with required=false. Useful for extracting authentication tokens, tracking information or client preferences like Accept-Language.

2

How to retrieve the value of a cookie named 'sessionId' in a controller method?

คำตอบ

@CookieValue allows extracting the value of a specific HTTP cookie and binding it to a method parameter. The annotation accepts the cookie name as a parameter and supports automatic type conversions. It can also be marked as optional with required=false. Commonly used for session identifiers, user preferences or analytics tracking tokens.

3

Why is injecting HttpServletRequest directly into a controller method less optimal than using Spring MVC annotations?

คำตอบ

Spring MVC annotations like @RequestParam, @RequestHeader or @PathVariable offer typed and automatic data extraction, with conversion and validation handling. Using HttpServletRequest directly requires manual parsing, makes code less readable and testable. Annotations also promote immutability and API contract clarity.

4

Which interface allows intercepting HTTP requests before they reach the controller in Spring MVC?

5

How to register a custom interceptor in a Spring MVC application?

+17 คำถามสัมภาษณ์

หัวข้อสัมภาษณ์ Spring Boot อื่นๆ

Spring Core - IoC & DI

Junior
22 คำถาม

Spring Boot Auto-Configuration

Junior
20 คำถาม

Spring Boot Starters

Junior
18 คำถาม

Application Properties & YAML

Junior
16 คำถาม

Logging with SLF4J & Logback

Junior
20 คำถาม

Spring Boot DevTools

Junior
15 คำถาม

Spring MVC Basics

Mid-Level
20 คำถาม

Spring REST Controllers

Mid-Level
20 คำถาม

Exception Handling

Mid-Level
25 คำถาม

Bean Validation

Mid-Level
25 คำถาม

Spring Data JPA Basics

Mid-Level
25 คำถาม

JPA Entities & Relationships

Mid-Level
30 คำถาม

JPA Queries

Mid-Level
30 คำถาม

Spring Data Repositories

Mid-Level
25 คำถาม

Spring Security Basics

Mid-Level
25 คำถาม

Spring Boot Actuator

Mid-Level
20 คำถาม

Unit Testing with JUnit & Mockito

Mid-Level
30 คำถาม

Spring Boot Testing

Mid-Level
30 คำถาม

Profiles & Environment

Mid-Level
20 คำถาม

RestTemplate & WebClient

Mid-Level
24 คำถาม

Async & Scheduling

Mid-Level
25 คำถาม

Caching with Spring

Mid-Level
25 คำถาม

Spring WebFlux (Reactive)

Mid-Level
25 คำถาม

Spring Transactions

Senior
30 คำถาม

Advanced Authentication & Authorization

Senior
30 คำถาม

JWT & Stateless Security

Senior
20 คำถาม

OAuth2 & Authorization Server

Senior
20 คำถาม

Spring Boot & Docker

Senior
19 คำถาม

Microservices with Spring

Senior
25 คำถาม

Spring Cloud Config

Senior
19 คำถาม

Performance Optimization

Senior
30 คำถาม

GraalVM Native Images

Senior
20 คำถาม

เชี่ยวชาญ Spring Boot สำหรับการสัมภาษณ์ครั้งถัดไป

เข้าถึงคำถามทั้งหมด flashcards แบบทดสอบเทคนิค แบบฝึกหัด code review และตัวจำลองสัมภาษณ์

เริ่มใช้ฟรี