Sẵn sàng thử sức?
Phỏng vấn thử với AI, nhận đánh giá và feedback chi tiết
Clean Architecture / Layered Architecture là gì?
Tổ chức code thành các layers với dependencies đi từ ngoài vào trong:
- Presentation: Controllers, UI
- Application: Use cases, business logic
- Domain: Entities, business rules
- Infrastructure: Database, external services
Lợi ích: Testable, maintainable, framework-agnostic.
Docker là gì? Docker Compose dùng để làm gì?
Docker: Containerization platform, đóng gói app + dependencies.
Docker Compose: Quản lý multi-container applications.
# docker-compose.yml
version: '3.8'
services:
app:
build: .
ports:
- "3000:3000"
depends_on:
- db
db:
image: postgres:14
environment:
POSTGRES_PASSWORD: secret
CI/CD pipeline bao gồm những gì?
CI (Continuous Integration):
- Build code
- Run tests (unit, integration)
- Code quality checks (lint, security)
CD (Continuous Deployment):
- Deploy to staging
- Run E2E tests
- Deploy to production
Tools: GitHub Actions, GitLab CI, Jenkins, CircleCI.
Testing strategies: Unit, Integration, E2E?
| Type | Scope | Speed | Tools |
|---|---|---|---|
| Unit | Function/Component | Fast | Jest, Vitest |
| Integration | Module interactions | Medium | Supertest, RTL |
| E2E | Full user flow | Slow | Cypress, Playwright |
WebSocket vs REST API khi nào dùng?
REST API: Request-response, stateless. Phù hợp cho CRUD operations.
WebSocket: Bi-directional, persistent connection. Phù hợp cho:
- Real-time chat
- Live notifications
- Gaming
- Stock prices
Authentication flow trong fullstack app?
- User login với credentials
- Server verify, tạo JWT token
- Client lưu token (httpOnly cookie hoặc localStorage)
- Client gửi token trong requests (Authorization header)
- Server verify token mỗi request
Best practice: Access token (short-lived) + Refresh token (long-lived).