Java Interview Guide
Ôn phỏng vấn Java backend theo kiểu hỏi – đápMỗi bài: vấn đề → giải pháp → vấn đề mới
1Java Core
- 1.1OOP & SOLID
- 1.2Interface vs abstract class
- 1.3String, immutability, String pool
- 1.4equals, hashCode, HashMap bên trong
- 1.5Collections: chọn cấu trúc nào
- 1.6List, Deque bên trong
- 1.7Map, Set, Heap bên trong
- 1.8Exception
- 1.9Generics
- 1.10Access modifier, static, final, pass-by-value
- 1.11Lambda & functional interface
- 1.12Stream API & các loại vòng lặp
- 1.13Optional, record, sealed
- 1.14Big-O & độ phức tạp
- 1.15Thuật toán sắp xếp
- 1.16Design patterns hay hỏi
- 1.17Design patterns trong Spring
- 1.18I/O, NIO, reflection
2JVM
3Concurrency
Phần hay bị hỏi sâu nhất.
- 3.1Process vs Thread
- 3.2Tạo thread: Runnable vs Callable
- 3.3Thread pool & ExecutorService
- 3.4synchronized, volatile, atomic
- 3.5Race condition: hai request cùng sửa một dữ liệu
- 3.6Deadlock
- 3.7ReentrantLock & ReadWriteLock
- 3.8ThreadLocal
- 3.9CompletableFuture
- 3.10Concurrent collections
- 3.11Virtual threads
- 3.12Thread-safe từng method chưa đủ
4Spring
- 4.1Core & Boot
- 4.1.1IoC & Dependency Injection
- 4.1.2Bean scope & lifecycle
- 4.1.3AOP & proxy
- 4.1.4Auto-configuration & starters
- 4.1.5Profile & cấu hình
- 4.1.6Tự viết annotation
- 4.1.7Events, scheduling, @Async
- 4.1.8Spring Cache
- 4.1.9Actuator
- 4.1.10Debug Spring trên production
- 4.2Spring MVC
- 4.2.1Một request đi qua những đâu
- 4.2.2DispatcherServlet & HandlerMapping
- 4.2.3@Controller vs @RestController
- 4.2.4Nhận tham số
- 4.2.5HttpMessageConverter & Jackson
- 4.2.6Validation
- 4.2.7Exception handling
- 4.2.8Filter, Interceptor và AOP
- 4.2.9ResponseEntity, status code, header
- 4.2.10Upload & download file
- 4.2.11Gọi API khác: RestClient, WebClient
- 4.2.12Async trong MVC
- 4.2.13Test controller
- 4.3Spring Data JPA
- 4.3.1JPA, Hibernate, Spring Data
- 4.3.2Entity state & persistence context
- 4.3.3@Transactional và các bẫy
- 4.3.4Propagation & rollback
- 4.3.5Quan hệ entity
- 4.3.6N+1 query
- 4.3.7Lazy loading
- 4.3.8Query method, @Query, Specification
- 4.3.9Phân trang & sort
- 4.3.10Locking trong JPA
- 4.3.11Batch insert & hiệu năng
- 4.3.12Flyway & Liquibase
- 4.4Spring Security
- 4.4.1Filter chain
- 4.4.2Authentication flow
- 4.4.3Authorization
- 4.4.4Session-based login
- 4.4.5JWT
- 4.4.6Access & refresh token
- 4.4.7OAuth2 & OpenID Connect
- 4.4.8Resource Server & Keycloak
- 4.4.9Password, CORS, CSRF
- 4.4.10Method security & test
- 4.5Spring Reactive
- 4.5.1Vì sao cần reactive
- 4.5.2Event loop & non-blocking I/O
- 4.5.3Mono & Flux
- 4.5.4Operator hay dùng
- 4.5.5Lỗi, timeout, retry
- 4.5.6Backpressure
- 4.5.7Schedulers
- 4.5.8WebFlux & WebClient
- 4.5.9R2DBC
- 4.5.10MVC, WebFlux hay virtual threads
- 4.5.11StepVerifier
- 4.6Spring Cloud
- 4.6.1Từ monolith sang microservices
- 4.6.2Service discovery
- 4.6.3Config Server
- 4.6.4Spring Cloud Gateway
- 4.6.5OpenFeign & load balancer
- 4.6.6Resilience4j
- 4.6.7Spring Cloud Stream
- 4.6.8Distributed tracing
- 4.6.9Spring Cloud trên Kubernetes
5Testing
6Database (PostgreSQL)
- 6.1ACID & isolation level
- 6.2Kiến trúc PostgreSQL & WAL
- 6.3MVCC & VACUUM
- 6.4Index & EXPLAIN
- 6.5Lock & concurrent transaction
- 6.6Thiết kế schema & query
- 6.7Quan hệ bảng ↔ JPA
- 6.8Connection pool
- 6.9Replication, partition, sharding
- 6.10Backup & restore
- 6.11Full-text search với Elasticsearch/OpenSearch
- 6.12Vì sao Elasticsearch search nhanh: inverted index, Lucene
- 6.13Đồng bộ DB → search index
7Redis
8Messaging
9Networking & Web server
- 9.1Một request đi từ client tới Spring Boot
- 9.2IP, port, TCP và UDP
- 9.3Ping được nhưng không connect được: port & firewall
- 9.4DNS
- 9.5TLS/HTTPS
- 9.6HTTP: keep-alive, HTTP/2, caching
- 9.7Load balancer L4/L7, NAT, VPC
- 9.8Nginx reverse proxy
- 9.9Tomcat: connector & thread
- 9.10Timeout ở từng tầng
- 9.11Debug mạng: curl, dig, ss, tcpdump
10Linux: Process & Thread
11API Design & Security
12Keycloak
Identity Provider độc lập: quản lý user, đăng nhập, SSO. Phía Spring tích hợp xem bài 4.4.8.
13Cryptography
- 13.1Encoding, hash, encryption
- 13.2Hash & MAC
- 13.3Hash password
- 13.4Symmetric & AEAD
- 13.5RSA & chữ ký số
- 13.6PKI & quản lý key
14Distributed Systems
15System Design
- 15.1Khung trả lời phỏng vấn
- 15.2Requirement, SLO, capacity
- 15.3Scale app, scale DB
- 15.4Rate limiting
- 15.5API Gateway
- 15.6High Availability
- 15.7URL Shortener
- 15.8File Upload
- 15.9Notification
- 15.10Ticket Booking
- 15.11Payment
- 15.12Flash sale
- 15.13Chat
- 15.14News Feed
- 15.15Banking transfer
- 15.16Multi-region
16Docker
- 16.1Image, layer, container
- 16.2Dockerfile
- 16.3Namespace & cgroups
- 16.4Volume & networking
- 16.5Compose
- 16.6PID 1 & signal
- 16.7Security
17Kubernetes
- 17.1Control plane
- 17.2Pod & probe
- 17.3Deployment, StatefulSet, Job
- 17.4Service & Ingress
- 17.5ConfigMap, Secret, RBAC
- 17.6Resource & autoscaling
- 17.7Troubleshooting
- 17.8Helm
- 17.9Giám sát Kubernetes: Prometheus stack & dashboard
- 17.10Log tập trung trên Kubernetes: Loki & Promtail
- 17.11ELK / OpenSearch trên Kubernetes
18Git, CI/CD & Cloud
- 18.1Git: merge, rebase, khôi phục
- 18.2CI pipeline
- 18.3CD & zero-downtime
- 18.4Terraform
- 18.5AWS
- 18.6Azure
19Observability
- 19.1Log, metric, trace
- 19.2SLI, SLO, alert
- 19.3Prometheus & Grafana
- 19.4OpenTelemetry
- 19.5Profiling & chẩn đoán JVM
- 19.6Xử lý incident & postmortem
- 19.7ELK Stack tổng quan, Elasticsearch vs OpenSearch
- 19.8Elasticsearch bên trong: index, shard, mapping
- 19.9Đưa log vào: Beats, Fluent Bit, Logstash, Kafka
- 19.10Kibana / OpenSearch Dashboards
- 19.11Vận hành ELK: ILM, sizing, snapshot, bảo mật
- 19.12Chọn ELK, Loki hay log của cloud
20Leadership & Behavioral
- 20.1Phạm vi của senior
- 20.2Estimate & ưu tiên
- 20.3ADR & code review
- 20.4Giao tiếp & mentoring
- 20.5Kể chuyện theo STAR
21AI Coding Workflow
Final Project: Ticket Booking
- 1Tổng quan & 12 milestone
- 2M0 · Requirements, capacity, dựng hạ tầng
- 3M1 · Chống bán trùng ghế
- 4M2 · Hold + expiry
- 5M3 · Thanh toán an toàn
- 6M4 · Lỗi dây chuyền A→B→C
- 7M5 · Saga + Outbox + Inbox
- 8M6 · Notification
- 9M7 · Flash sale
- 10M8 · Scale catalog
- 11M9 · Benchmark mô hình chạy
- 12M10 · Security + observability
- 13M11 · High availability
- 14M12 · Game day + mock interview