Mục lục bài học
- ĐÁNH SỐ ĐỂ TẠO TTS — 261 cặp, 522 mục đọc
- ĐIỀU HƯỚNG V5.2 — học xen kẽ trong cùng một chủ đề
- HƯỚNG DẪN BẮT ĐẦU — đọc 1 lần, rồi học theo module
- A. Học thế nào để không gấp đôi thời gian?
- B. Một thang độ khó cho tất cả chủ đề
- C. Vòng nói 5 lượt để biến từ vựng thụ động thành phản xạ
- D. Khung câu ít nhưng đa năng (dùng được trên toàn file)
- E. Cách dùng ChatGPT Voice hoặc một đối tác luyện tập
- F. Cách chấm: tách kỹ thuật khỏi tiếng Anh
- G. Ôn giãn cách và bài hội thoại đời thường
- H. Ví dụ hoàn chỉnh — đọc 1 lần trước khi dùng Speaking Labs
- START HERE — Mục tiêu và thứ tự học
- MÔ-ĐUN 01 [CORE] — “Thiết kế hệ thống” thực ra là làm gì?
- MÔ-ĐUN 02 [CORE] — Đọc, nghe và trả lời câu hỏi kỹ thuật bằng tiếng Anh (từ cơ bản)
- LAB A [CORE] — Cầu nối cho người mới: từ một câu nói thành Entities → Rules → APIs
- MÔ-ĐUN 03 [CORE] — LLD bước 1: yêu cầu → entities, classes, API
- MÔ-ĐUN 04 [CORE] — Database / SQL: từ bảng dữ liệu đến transaction và index
- 04.1. Khởi đầu thật đơn giản: entity → table
- 04.2. SQL từ dễ đến vừa
- 04.3. Index — vì sao giúp đọc nhưng có thể làm ghi chậm?
- 04.4. Transactions / ACID — hình dung trước khi học chữ
- 04.5. Những bất thường do concurrent transactions
- 04.6. Worked example — hai người cùng đặt một phòng
- 04.7. Tự làm 3 câu SQL ngắn
- 🎙️ SPEAKING LAB V5.2 — 04. SQL, indexes, ACID và locking
- MÔ-ĐUN 05 [CORE] — Network / HTTP: một request chạy từ trình duyệt đến backend thế nào?
- MÔ-ĐUN 06 [CORE] — OS + JVM + concurrency: vì sao hệ thống có thể sai khi nhiều request cùng đến?
- MÔ-ĐUN 07 [CORE] — LLD bước 2: Hotel Booking + states + concurrency
- 07.1. Đề bài và cách khoanh phạm vi
- 07.2. Các entities bắt buộc trước khi nghĩ tới class code
- 07.3. State machine
- 07.4. API contract cho MVP
- 07.5. Các classes và đường đi request
- 07.6. Worked sequence — booking phòng cuối
- 07.7. Bài tập biến thể, giảm gợi ý
- 07.8. Checklist LLD khi đi phỏng vấn
- 🎙️ SPEAKING LAB V5.2 — 07. Hotel Booking LLD + state machine
- MÔ-ĐUN 08 [CORE] — Testing, Cloud, Security, Java & DSA: những gì cần để đọc đề và bảo vệ giải pháp
- 08.1. Testing từ trực giác đến lựa chọn
- 08.2. Cloud và triển khai: định nghĩa + ứng dụng
- 08.3. Security cơ bản — nhìn theo rủi ro
- 08.4. Java Core và OOP — đối chiếu theo lỗi hay hỏi
- 08.5. DSA vocabulary và complexity — đủ dùng cho lời giải
- 08.6. Glossary nén để không bỏ mất nội dung hai file cũ [PLUS]
- 🎙️ SPEAKING LAB V5.2 — 08. Testing, Cloud, Security và DSA recap
- MÔ-ĐUN 08A [CORE][JAVA BACKEND] — Java Core + OOP: từ biết dùng đến giải thích được cơ chế
- 08A.0. PRETEST — 8 câu (6 phút, chưa xem phần dưới)
- 08A.1. static / instance / final: một ví dụ từ đơn giản đến tình huống
- 08A.2. Reference, pass-by-value, String, equality và hashCode()
- 08A.3. OOP, access modifiers và polymorphism — khi nào dùng interface?
- 08A.4. Collections, generics, Optional, Stream và exceptions
- 08A.5. Thread safety và dữ liệu: kết nối Java với Backend
- 08A.6. MOCK mới (12 phút): trả lời rồi mới mở đáp án
- 🎙️ SPEAKING LAB V5.2 — 08A. Java Core + OOP
- MÔ-ĐUN 08B [CORE][JAVA BACKEND] — Spring Boot + JPA/Hibernate: từ HTTP request đến database
- 08B.0. PRETEST — 7 câu (6 phút)
- 08B.1. Spring Container, IoC, DI, Beans — ví dụ đơn giản
- 08B.2. Request flow, DTO, validation và status codes
- 08B.3. JPA/Hibernate, Repository và entity lifecycle
- 08B.4. @Transactional: rollback, concurrency và self-invocation
- 08B.5. N+1, query tuning, authorization và tests
- 08B.6. LAB Spring/SQL tích hợp (18–25 phút)
- 08B.7. MOCK Spring/JPA — 12 câu chưa có đáp án lộ sẵn (15 phút)
- 🎙️ SPEAKING LAB V5.2 — 08B. Spring Boot + JPA/Hibernate
- LAB 08C [CORE][JAVA BACKEND] — Kiểm tra cuối: code → SQL → English → follow-up
- MÔ-ĐUN 09 [CORE] — Basic System Design: từ 1 server đến một hệ thống đủ tin cậy
- 09.1. System Design không đồng nghĩa “thiết kế YouTube/Netflix”
- 09.2. Level 1 — khởi đầu bằng cấu trúc tối giản
- 09.3. Level 2 — khi nhiều người đọc availability
- 09.4. Level 3 — external service bị chậm / lỗi
- 09.5. Level 4 — scale và background work
- 09.6. Bảng ra quyết định 8 trade-offs phổ biến
- 09.7. Một bài worked example đầy đủ (ngắn)
- 09.8. Tự làm — không có sẵn một đáp án duy nhất
- 🎙️ SPEAKING LAB V5.2 — 09. Basic System Design
- LAB B [CORE] — Debugging + API Integration: từ triệu chứng đến nguyên nhân
- B1. Quy trình 6 bước (dùng cho mọi lỗi)
- B2. WATCH — đơn đặt hàng trả 504 nhưng DB đã có order
- B3. COMPLETE — triệu chứng khác nhau, xử lý khác nhau
- B4. DO — API/data integration (10 phút)
- B5. Liên hệ đúng với V-Market (đọc sau khi hiểu B4)
- 🎙️ SPEAKING LAB V5.2 — B. Debugging và external integration
- 🎙️ CASE LAB V5.2 — V-Pulse (11 cặp Q&A)
- MÔ-ĐUN 10 [CORE][FDE] — Problem Decomposition cho người chưa từng học Solution Engineering
- 10.1. Decomposition khác LLD và System Design
- 10.2. Công thức 6 bước duy nhất
- 10.3. Worked example 1 — “Hệ thống booking đang rất chậm”
- 10.4. Worked example 2 — Data integration: ứng dụng rất gần FDE
- 10.5. Discovery questions — học theo nhóm, không học thuộc một trăm câu
- 10.6. Phân biệt assumptions, constraints, acceptance criteria và metrics
- 10.7. Luyện giải case chưa có sẵn giải pháp — giảm gợi ý
- 10.8. FDE interview scorecard (tự chấm 0–2 mỗi tiêu chí)
- 🎙️ SPEAKING LAB V5.2 — 10. FDE discovery và problem decomposition
- LAB C [CORE][FDE] — Cold Decomposition: đề mới, yêu cầu thay đổi, không học thuộc
- C0. Công thức dùng khi đứng hình
- C1. Cold case 1 — Kho hàng của cửa hàng nhỏ (12 phút)
- C2. Cold case 2 — Scheduling thay đổi thường xuyên (12 phút)
- C3. Cold case 3 — Bảo vệ sự chính xác của báo cáo (12 phút)
- C4. Cold case 4 — Đặt lịch dịch vụ (15 phút, luyện bằng tiếng Anh)
- C5. Khuôn trả lời 90 giây — không phải script cố định
- 🎙️ SPEAKING LAB V5.2 — C. FDE cold cases + changing requirements
- MÔ-ĐUN 11 [CORE] — Technical English: nói tự nhiên, ngắn, có cấu trúc
- 11.1. Vấn đề thật của người đã biết Java nhưng tiếng Anh kỹ thuật yếu
- 11.2. Bộ từ “động từ chuyên môn” đáng luyện nhất
- 11.3. Bốn kiểu hỏi — bốn cách trả lời (với câu thật)
- 11.4. Mini dialogue — mock discussion FDE (từng bước)
- 11.5. Vòng nói 10 phút hàng ngày
- 11.6. Project deep dive — 8 câu chỉ cần luyện 1 project thật sâu
- 11.7. DSA speaking tối giản
- 🎙️ SPEAKING LAB V5.2 — 11. Technical English, project story, DSA explanation
- 🎙️ CASE LAB V5.2 — Cross-project practice (3 cặp Q&A)
- LAB D [CORE] — Technical English Listening + Reading New Code + Practical Coding
- D1. Listening: phương pháp không cần audio đính kèm
- D2. 12 câu nghe/nói, từ dễ đến có follow-up
- D3. Reading unfamiliar Java: WATCH — nhận trách nhiệm của class trước
- D4. COMPLETE — đọc code và tìm tối thiểu 3 vấn đề
- D5. DO — thực hành Java không cho sẵn lời giải ngay
- D6. Learning interview: đọc tài liệu của một API giả tưởng
- D7. Behavioral English — đủ cho vòng intern/junior
- D8. Ghép project thật sau khi học cơ chế
- 🎙️ SPEAKING LAB V5.2 — D. Listening blind + unfamiliar Java + on-the-job learning
- MÔ-ĐUN 12 [CORE] — Bốn bài tập tổng hợp: gợi ý ít dần
- MÔ-ĐUN 13 [CORE] — Mock interview có đáp án, không học vẹt
- E0. Một vòng 70 phút
- E1. ĐÁP ÁN VÀ RUBRIC — KHÔNG XEM TRƯỚC KHI LÀM
- Cách dùng ba tài liệu project mà bạn đã cung cấp
- Error log template — copy sau mỗi mock
- Tiêu chuẩn dừng ôn một chủ đề
- Nguồn và giới hạn áp dụng
- Nguồn tham khảo — phân biệt tài liệu gốc và phần bổ sung
- KẾT THÚC — THẾ NÀO LÀ ĐỦ ĐỂ BẮT ĐẦU ĐI PHỎNG VẤN?
- 1. Bài luyện nghe không nhìn chữ: 15 prompt theo mức độ
- 2. 5 cuộc hội thoại mô phỏng — nói phần Candidate trước khi xem gợi ý
- 3. 4 phiên General English 7 phút (xen giữa buổi kỹ thuật)
- 4. Speaking project drill — đừng biến thành bản quảng cáo CV
- 5. Lịch 20 buổi tích hợp (tự điều chỉnh theo checkpoint)
- 6. Error log hai chiều — copy sau mỗi buổi
- 7. Kết thúc: tiêu chuẩn “đã học được” chứ không chỉ “đã đọc xong”
JAVA BACKEND + FDE — INTERVIEW FOUNDATION V5.2: LEARN → BUILD → SPEAK
V5.2, cập nhật 18/10/2026. Giữ các bài kiến thức/code/SQL từ V4 và tổ chức lại 261 cặp Q&A xen ngay từng chủ đề; không dồn 225 + 36 câu xuống cuối.
Nguồn: V4/V5.1 và ba file Project Deep Dive người học cung cấp. Các project là bản mô tả code; chưa xác minh độc lập repository hoặc đóng góp cá nhân.
Giáo trình nền (17/10/2026). Nội dung kỹ thuật V3.2 phía dưới được giữ nguyên để bảo toàn ví dụ, bài code/SQL, đáp án, checklist và phạm vi chuyên môn. V4 bổ sung lớp thực hành Speaking Lab vào 20 mô-đun/lab. Các đoạn hội thoại/mẫu trả lời V4 là bài luyện mới biên soạn theo nội dung V3.2, không phải câu hỏi phỏng vấn chính thức của công ty.
Mục tiêu: (1) hiểu và thực hành Java Backend/FDE; (2) hiểu câu hỏi tiếng Anh nói thành tiếng; (3) tự trả lời rõ ràng không đọc script; (4) xử lý follow-up bất ngờ. Không học tiếng Anh bằng cách thuộc lòng 100 đoạn văn.
ĐÁNH SỐ ĐỂ TẠO TTS — 261 cặp, 522 mục đọc
QUY TẮC ĐÁNH SỐ TTS (áp dụng đồng nhất trong hai file): Có 261 cặp Q&A = 522 mục đọc. Mỗi câu hỏi tính là một mục TTS, và toàn bộ câu trả lời tính là một mục TTS, dù câu trả lời có nhiều câu tiếng Anh. Số TTS chạy liên tục từ 001 đến 522 theo đúng thứ tự học. Số lẻ là câu hỏi; số chẵn kế tiếp là đáp án. Ví dụ: TTS 007 (Q) What is a business invariant? và TTS 008 (A) An invariant is a rule that must remain true after every valid operation. For example, one room must not be allocated to two confirmed bookings for the same night. Để tạo giọng đọc, sao chép toàn bộ nội dung sau dấu hai chấm của từng mục TTS, không đọc nhãn số hoặc Q/A. Số cặp Q001–Q261 cũng chạy liên tục và giống nhau giữa hai file.
ĐIỀU HƯỚNG V5.2 — học xen kẽ trong cùng một chủ đề
Nguyên tắc: không đọc hết lý thuyết rồi mới sang tập nói. Mở một bài theo dòng PRETEST → WATCH → COMPLETE/DO → LISTEN/SHADOW → FREE SPEAK → FOLLOW-UP → FEEDBACK. Đáp án Q&A đều nằm dưới mục mở rộng, không hiện sẵn khi đọc lướt. 261 câu không phải 261 bài phải thuộc lòng.
- Module thường: sau phần kiến thức và bài DO là Speaking Lab chứa đúng Q&A của module đó, đã tách FREE SPEAK và FOLLOW-UP.
- Module dài 04 / 08A / 08B: không phải làm 17/30/30 câu một lúc. Ngay sau các tiểu mục sẽ có MICRO SPEAK (2–10 câu) để học và nói tại chỗ; Speaking Lab cuối module chỉ tổng ôn, không lặp danh sách.
- Project labs: V-Market rồi V-Core sau LAB 08C; V-Pulse sau LAB B; Cross-project sau Module 11. Khi ôn JD Java Backend, ưu tiên V-Market; khi ôn integration/FDE, thêm V-Pulse.
- Mỗi lần: 1 đoạn kiến thức + 1 bài DO + khoảng 3–6 Q&A + một biến thể khó hơn. Lúc ôn mới nghe blind questions hoặc bản TTS.
- Nguyên tắc nguồn: Q&A bám theo bộ 261 câu V5.1; không sửa nội dung câu hỏi hoặc tự thêm achievement/project. Các câu project nói theo tài liệu mô tả, không chứng minh người học đã tự triển khai.
Cách đọc: phần câu hỏi hiện ra trước; bấm vào dòng Mở đáp án mẫu sau khi đã nói. Ở bản đánh số này, mỗi mục TTS nằm trên một dòng, kể cả khi đáp án có nhiều câu; số thứ tự khớp hoàn toàn với bản Q&A riêng.
HƯỚNG DẪN BẮT ĐẦU — đọc 1 lần, rồi học theo module
A. Học thế nào để không gấp đôi thời gian?
Mỗi buổi học 40–55 phút dùng một bài kỹ thuật bên dưới và Speaking Lab ở CUỐI bài đó. Không phải học xong toàn bộ tài liệu rồi mới học tiếng Anh.
| Bước | Phút | Việc thực hiện | Đầu ra quan sát được |
|---|---|---|---|
| 1. PRETEST | 3–4 | Che lời giải; thử hiểu đề và nêu 1–2 ý bằng tiếng Việt | Biết chỗ hổng kiến thức |
| 2. WATCH | 8–12 | Đọc ví dụ từ nguồn V3.2; truy vết logic/code; hiểu vì sao | Nói lại được ý bằng tiếng Việt |
| 3. COMPLETE → DO | 12–15 | Điền thiếu → làm bài biến thể không nhìn đáp án | Có output kỹ thuật độc lập |
| 4. LISTEN → SHADOW | 4–5 | Dùng TTS/Voice đọc 2 câu trong Speaking Lab, nghe không nhìn; bắt chước 2 lần | Nhận được âm và nhịp câu |
| 5. SPEAK → REPEAT | 8–12 | Trả lời câu cold; ghi âm; cùng ý nói lại 2–3 lần | Nói không đọc ở 2–4 câu rồi 45–90 giây |
| 6. FEEDBACK + LOG | 3–5 | Sửa 1 lỗi kiến thức + 1 lỗi diễn đạt nếu có | Có câu sửa và lịch ôn |
Nếu chỉ có 25 phút: 5' ôn source + 8' DO + 4' nghe/nhại + 6' cold speaking + 2' ghi lỗi. Nếu dư thời gian: luyện hội thoại đời thường 5–10 phút và ôn một bài cũ. Không bỏ DO để chỉ tập nói một đáp án sai.
B. Một thang độ khó cho tất cả chủ đề
- L0 — Recognize (10–20 giây): nghe/đọc câu hỏi, biết interviewer yêu cầu định nghĩa, luồng, lý do hay test; giải thích khái niệm bằng tiếng Việt.
- L1 — Supported (20–40 giây): tự nói 2–4 câu tiếng Anh đơn giản có mẫu
what → why → example. Có thể nhìn từ khóa; không nhìn nguyên câu. - L2 — Independent (45–90 giây): không nhìn script, trả lời
answer → reasoning → example/failure/test; người nghe hiểu được. - L3 — Interactive (90–150 giây): interviewer cắt ngang, đổi dữ kiện; bạn hỏi rõ assumption, nói lại lựa chọn và trade-off. L3 quan trọng với FDE và project deep dive.
Chưa đạt L1 thì không ép nói 4 phút. Với người đang giao tiếp cơ bản: bắt đầu chu kỳ 60 → 45 → 30 giây cho cùng một câu hỏi. Khi đã nói liền mạch, dùng 2 phút → 90 giây → 60 giây; khi đủ khả năng duy trì ý, mới thử 4/3/2. Giảm thời lượng không đồng nghĩa cố nói thật nhanh; phải giữ những ý kỹ thuật thiết yếu.
C. Vòng nói 5 lượt để biến từ vựng thụ động thành phản xạ
- LISTEN: che transcript; nghe câu hỏi 1 lượt bằng Voice/TTS; nói bằng tiếng Việt câu hỏi đang muốn gì. Nghe lại nếu cần.
- SHADOW: nhìn 1–2 câu mẫu, nghe và bắt chước âm, stress, ngắt cụm 2 lần. Shadowing không thay thế tự trả lời.
- RETRIEVE: che tài liệu, tự gọi lại 3–5 từ khóa (
transaction,rollback,consistency...), giải thích chúng bằng một câu. - FREE SPEAK: nhấn thu âm, tự nói 30–90 giây theo ý hiểu. Nếu quên từ: dùng câu dễ hơn; đừng chuyển toàn bộ sang tiếng Việt.
- FEEDBACK → REPEAT → TRANSFER: mở mẫu sau khi nói, sửa 1–2 điểm, nói lại; trả lời một câu biến thể chưa chuẩn bị. Transfer là phần chống học vẹt.
D. Khung câu ít nhưng đa năng (dùng được trên toàn file)
| Interviewer muốn | Cấu trúc | Mẫu dễ nói |
|---|---|---|
| Definition | X is... It is used to... For example... |
A transaction is a group of database operations. It helps keep updates consistent. |
| Mechanism | First... Then... Finally... If... |
First, the controller validates the request. Then the service applies business rules. |
| Compare | X is... while Y... I would use X when... |
An interface defines a contract, while an abstract class can share state and implementation. |
| Design | Before designing, I'd clarify... For an MVP, I'd... |
Before designing, I'd clarify the booking rules. For an MVP, I'd keep one backend service. |
| Failure | The problem is... This can happen when... I'd verify... |
The problem may be a duplicate retry. I'd verify it with request IDs and database records. |
| Trade-off | I chose... because... The downside is... |
I'd choose a modular monolith for a small MVP because it is simpler to deploy. |
| Test | I'd test... I would expect... |
I'd send two concurrent requests. I would expect only one successful reservation. |
Câu để câu giờ/hỏi lại: Could you repeat the last part? · Could you rephrase the question? · Do you mean X or Y? · May I take a moment to think? · Let me correct my answer. · I'm not sure about that detail; here's how I would verify it.
E. Cách dùng ChatGPT Voice hoặc một đối tác luyện tập
Dán prompt dưới đây trước một buổi speaking. Không yêu cầu AI đưa đáp án khi bạn chưa nói.
You are my technical English speaking coach. My current level is basic conversational English.
Focus on Java Backend and software-oriented Forward Deployed Engineer interviews.
Today's module: [PASTE MODULE NAME].
Ask ONE question at a time; do not show or read a model answer before I reply.
Start with a simple definition (20–40 seconds), then ask a how/why question,
then ask ONE unpredictable follow-up or change one requirement.
If I do not understand, first rephrase the question in simpler English.
Do not interrupt me for minor errors. After I finish, give feedback in this order:
(1) technical correctness, (2) clarity/organization, (3) two useful language corrections,
(4) one more natural short alternative, (5) ask me to answer again without a script.
Do not invent work experience for me. End with one new transfer question.
Cách làm listening blind: yêu cầu người đọc/AI chỉ đọc câu hỏi, không hiển thị câu hỏi dạng chữ nếu giao diện cho phép; người học nói lại ý yêu cầu trước khi trả lời. TTS có thể đọc với tốc độ vừa phải; tăng tốc dần sau khi hiểu.
F. Cách chấm: tách kỹ thuật khỏi tiếng Anh
| Trục | 0 | 1 | 2 | 3 |
|---|---|---|---|---|
| K — Technical correctness | Sai bản chất | Nhớ thuật ngữ nhưng thiếu cơ chế | Đúng ý, có ví dụ | Đúng + failure/trade-off/test phù hợp |
| S — Spoken independence | Không nói được | Đọc mẫu / lệ thuộc câu có sẵn | Tự nói 2–4 câu dễ hiểu | Tự nói 60–90s và trả lời follow-up |
| L — Listening | Không hiểu cả khi nhắc | Hiểu sau khi đọc chữ | Nghe được câu rõ/chậm | Nghe câu mới, tóm tắt và hỏi lại khi cần |
Chỉ chuyển mô-đun khi: K ≥ 2, S ≥ 2, hiểu ít nhất 2/3 câu nghe liên quan (L ≥ 2 nếu tự luyện được audio), và giải được bài DO/biến thể ở tài liệu gốc. Không cần phát âm như người bản ngữ. Nếu K thấp hãy quay lại kiến thức; nếu K tốt mà S thấp hãy tăng lượt trả lời/nhận sửa, không đọc lại cả chương.
Ghi lỗi: term (không hiểu từ), concept (không hiểu kỹ thuật), reasoning (không giải thích được), listening (không bắt âm), retrieval (biết nhưng không nhớ khi nói), fluency (dừng quá lâu), pronunciation (nghe không rõ), grammar (lỗi gây hiểu nhầm). Chỉ sửa tối đa 2–3 lỗi trong một lượt nói.
G. Ôn giãn cách và bài hội thoại đời thường
- Cuối buổi: không nhìn file, nói 1 định nghĩa + 1 tình huống biến thể.
- Ngày +1: nghe 1 câu cũ, trả lời không nhìn; sau đó câu mới cùng chủ đề.
- Ngày +3: kể lại một cơ chế/failure 60 giây, dùng từ khác mẫu cũ.
- Ngày +7: 3 câu từ 3 mô-đun ngẫu nhiên, có ít nhất 1 follow-up.
- Ngày +14: mini mock 5 phút không thông báo trước chủ đề.
- Song song: 5–10 phút General English nói về lịch học, công việc, khó khăn, sở thích; mục tiêu là đối đáp tự nhiên, không chỉ đọc thuật ngữ IT.
Các mốc ôn là lịch đề xuất, có thể điều chỉnh theo error log; không phải khoảng cách tối ưu cho mọi người.
H. Ví dụ hoàn chỉnh — đọc 1 lần trước khi dùng Speaking Labs
Tình huống: A user clicks Book twice after a timeout. Could this create two bookings?
- Hiểu bằng tiếng Việt: Timeout không chứng minh server thất bại. Retry có thể lặp side effect của POST; cần cơ chế chống trùng và kiểm tra kết quả cũ.
- 3 chunks:
the response was lost(phản hồi bị mất),retry the request(thử lại),idempotency key(khóa chống lặp hiệu ứng). - Shadow 2 câu: A timeout does not necessarily mean that the server failed. / I would use an idempotency key to prevent duplicate bookings.
- Guided speaking: The server may have . If the client , it may create . I would .
- Free speaking: trả lời 30–45 giây không nhìn; ghi âm. Sau đó đọc mẫu 1 lần rồi nói lại.
- Mẫu tham khảo (mở sau khi tự nói):
Sample response — chỉ mở sau khi tự trả lời
A timeout does not mean the booking failed. The server may have created the booking, but the response did not reach the client. If we blindly retry the request, we might create a duplicate. I would use an idempotency key and let the client check the booking status.
- Transfer (câu mới): What changes if the booking service calls an external room provider? Trả lời dựa trên giới hạn của local transaction, không lặp lại nguyên văn mẫu.
KIẾN THỨC GỐC V3.2 + SPEAKING LABS TÍCH HỢP
Tài liệu gốc V3.2 được giữ nguyên bên dưới (ngoại trừ tiêu đề chính được hiển thị như một tiêu đề nội dung). Mỗi mô-đun có SPEAKING LAB V5.2 sát phần lý thuyết; 04, 08A và 08B có thêm MICRO SPEAK sau từng tiểu mục. Mọi đáp án Q&A và mẫu trả lời dài V4 được đặt ngay tại chủ đề, dưới mục có thể mở sau khi tự nói.
JAVA BACKEND + FDE — INTERVIEW FOUNDATION V3.2
Phiên bản mở rộng V3.2, 17/10/2026 (kế thừa V3.1). Dành cho Intern/Fresher/Junior đang đồng thời ứng tuyển Java Backend và Forward Deployed Engineer (thiên về Software Engineering). Giải thích bằng tiếng Việt, giữ câu hỏi phỏng vấn bằng tiếng Anh. Không phải đề chính thức hoặc cam kết vượt phỏng vấn.
Điểm mới từ V3.1 lên V3.2: thêm 08A Java Core/OOP, 08B Spring Boot/JPA và LAB 08C Java–SQL–English theo PRETEST → WATCH → COMPLETE → DO → EXPLAIN; giữ nguyên các mô-đun CS, LLD, FDE và mock cũ.
Điểm mới so với V3: học thành bài nhỏ hơn; ví dụ mẫu → bài điền khuyết → bài biến thể chưa thấy → câu hỏi follow-up; luyện nghe–nói có quy trình; bài đọc/sửa Java/JSON lạ; FDE case đổi yêu cầu; bài mock suy luận khó hơn; có dấu mốc để biết có nên chuyển bài.
START HERE — Mục tiêu và thứ tự học
Bạn không bắt đầu từ số 0 về lập trình: Java Core, Spring Boot, OOP, SQL, DSA Easy đã quen. Nhưng bạn đang học từ cơ bản về design/decomposition và tiếng Anh kỹ thuật chưa thành phản xạ. Vì vậy:
- Không đọc 100% từ trên xuống như tiểu thuyết. Hoàn thành các bài thực hành bắt buộc trước; CS chỉ mở khi bài tập hoặc bài tự kiểm tra cho thấy bạn đang thiếu.
- Không học thuộc câu trả lời dài. Trả lời ý bằng tiếng Việt được trước, sau đó rút còn 3–5 câu tiếng Anh đơn giản.
- Không xem lời giải trước khi thử. Mỗi ví dụ có 4 nấc:
WATCH(xem),COMPLETE(điền),DO(tự làm),EXPLAIN(nói). - Không yêu cầu đúng hệt đáp án mẫu. Với system design/FDE có nhiều phương án đúng nếu phù hợp giả định, business rules, kiểm chứng và trade-off.
Bản đồ nội dung — đi theo đường học, không theo số môn CS
| Thứ tự | Mô-đun trong file | Bạn ra khỏi mô-đun khi... | Vai trò |
|---|---|---|---|
| 1 | 01. Bức tranh hệ thống | phân biệt requirement / data / rules / flow | Chung |
| 2 | 02. English: nhận diện câu hỏi | hiểu đúng 8/10 prompts mới | Chung |
| 3 | LAB A — Entities → Rules → API | tự tách được một tính năng rất nhỏ | Chung |
| 4 | 03. LLD User Registration | tự thiết kế một biến thể không nhìn mẫu | Chung |
| 5 | 04. SQL / Transaction | giải thích hai request cạnh tranh và test | Chung |
| 6 | 05. HTTP / Network | truy vết một request + timeout/retry | Chung |
| 7 | 06. OS / Concurrency / JVM | lý giải race/deadlock ở mức cơ bản | Chung |
| 8 | 07. LLD Booking | states, API, consistency và failure | Chung |
| 9 | 08. Testing / Cloud / Java recap | làm đề chẩn đoán; chỉ đào sâu câu sai | Tham khảo |
| 10 | 08A. Java Core + OOP Interview [NEW] | giải thích static/equality/Collections/OOP/concurrency + code độc lập | Java P0 |
| 11 | 08B. Spring Boot + JPA/Hibernate [NEW] | tự trace request, phân biệt transaction/locking, xử lý N+1 | Java P0 |
| 12 | LAB 08C. Java–SQL–English [NEW] | làm case lạ, code/query và nói ngắn không nhìn đáp án | Java P0 |
| 13 | 09. Basic System Design | thiết kế MVP + 3 lựa chọn có lý do | Chung |
| 14 | LAB B — Debug & Integration | trace được lỗi, chọn phương án khắc phục | Chung |
| 15 | 10. FDE Decomposition | discovery → scope → demo/acceptance | FDE |
| 16 | LAB C — FDE Cold Cases | làm case mới khi interviewer đổi yêu cầu | FDE |
| 17 | 11. Technical English thực chiến | nói 60–90 giây, xử lý follow-up | Chung |
| 18 | LAB D — Learning/Coding/Listening | đọc/sửa code lạ, nghe câu hỏi không nhìn trước | Chung |
| 19 | 12. Bài tập tổng hợp | độc lập làm case, không cần gợi ý | Chung |
| 20 | 13. Mock cũ + HARD MOCK mới | biết chính xác lỗ hổng sau khi làm đề mới | Chung |
Nếu chỉ còn 2–3 ngày:
- JD Java Backend: ưu tiên 02 → 08A (DO/MOCK) → 08B (DO/MOCK) → 04 → V-Market P0 → LAB 08C → LAB D → HARD MOCK. Chỉ mở lại WATCH ở câu sai.
- JD FDE: dùng tuyến gốc 02 → LAB A → 03 → 07 → 09 → 10 → LAB C → 11 → LAB D → HARD MOCK; bổ sung 08A/08B theo JD.
- DSA coding: file này không thay luyện Medium thực tế; ôn có chọn lọc ngoài file, nhất là trước online assessment.
Lối học ưu tiên cho Java Backend 0–1 năm [V3.2]
Bạn đã biết Java/SQL/Spring ở mức cơ bản nhưng đang yếu technical English, CS/LLD và project. Không cần đọc mọi mô-đun cùng độ sâu:
- Mỗi ngày 15–25 phút: Mô-đun 02 + 11/LAB D luyện nghe và trả lời câu kỹ thuật mới bằng tiếng Anh.
- Kiến thức nghề P0: Mô-đun 08A → 08B → LAB 08C, trước đó xem lại Mô-đun 04 nếu thiếu SQL/transaction. Học WATCH nếu chưa hiểu; nếu làm DO tốt thì nhảy MOCK.
- Một project sâu: V-Market Deep Dive theo
one flow → why → failure → test; đọc source thật, bổ sung kinh nghiệm internship đã triển khai. V-Core/V-Pulse chỉ đào sâu theo JD. - CS/LLD ứng dụng: LAB A → Mô-đun 03 → 07 → 09; Mô-đun 05–06 và 08.2/08.3 chỉ đào sâu nếu test cho thấy thiếu.
- FDE là nhánh riêng: Mô-đun 10 + LAB C khi ứng tuyển FDE/AI-first; không ép người chỉ phỏng vấn Java học hết nhánh này trước.
- DSA Medium có chọn lọc bên ngoài file: duy trì 20–30 phút theo pattern, rồi tập trung bộ bài phù hợp nếu đã có lịch OA; không dựa vào “học tủ chính xác đề”.
Thứ tự luyện trong một buổi: tự thử câu chưa từng xem → nếu bí thì đọc ví dụ → tự code/giải bài biến thể → nói tiếng Anh 30–60 giây → ghi lỗi. Đạt checkpoint thì chuyển, không đọc lại để đủ trang.
Cách học một bài: 35–45 phút, không quá tải
- PRETEST (3 phút): che đáp án, thử hai câu đơn giản. Nếu làm được, đọc nhanh ví dụ và chuyển bài thử.
- WATCH (8 phút): đọc một lời giải từng bước; sau mỗi bước giải thích "vì sao" bằng tiếng Việt.
- COMPLETE (8 phút): bài tương tự nhưng thiếu một số bước; mở gợi ý một nếu bí sau 2–3 phút.
- DO (12 phút): đề biến thể hoặc cold question; không dùng AI/đáp án.
- EXPLAIN (5 phút): nói tiếng Anh câu trả lời 30–60 giây, ghi âm nếu có thể; đánh giá đúng ý → cấu trúc → dễ hiểu trước khi sửa ngữ pháp.
- ERROR LOG (2 phút): sai vì
term / concept / reasoning / implementation / English / nerves? Chỉ ôn đúng loại lỗi.
Mức qua bài (tiêu chuẩn tự học, không phải chuẩn công ty): - Recognize: giải thích được nghĩa thuật ngữ khi gặp. - Explain: không nhìn tài liệu, nói được nguyên lý và ví dụ. - Apply: xử lý một đề đã đổi yêu cầu, vẫn giữ được business invariant. - Interview: nêu assumptions, reasoning, trade-off, tests; nói bằng tiếng Anh dễ hiểu.
Với CS rộng chỉ cần Explain; với LLD, decomposition và technical English phải cố đạt Apply/Interview.
Retrieval + spaced practice (ôn mà không đọc lại cả file)
| Lúc ôn | Chỉ làm gì? |
|---|---|
| Kết thúc buổi | Viết 3 ý chính từ trí nhớ, làm 1 câu mới |
| Ngày tiếp theo | Trả lời lại 2 câu sai; không đọc lý thuyết nếu đúng |
| Sau khoảng 3 ngày | 1 case biến thể + 1 câu giải thích tiếng Anh |
| Sau khoảng 7 ngày | Mini mock ngẫu nhiên từ nhiều mô-đun |
Các mốc trên là lịch thực dụng. Nguyên tắc hỗ trợ bởi nghiên cứu về worked examples, retrieval practice, distributed practice; xem mục Tài liệu tham khảo cuối file.
Bài chẩn đoán 8 phút — làm trước khi đọc
Không cần ghi đáp án hoàn hảo. Viết ngắn và đánh dấu chỗ bí:
- A user clicks Book twice and receives a timeout. Did the server necessarily fail? Tại sao?
- Design an API to borrow one library copy. Bạn cần hỏi lại điều gì trước?
- Explain one difference between an entity and a service.
- An operator says imports sometimes create duplicated products. Bạn cần hỏi gì trước khi đề xuất sửa?
- Walk me through a request from browser to database. Nói trong 30 giây.
- Nhìn câu Java
count++;chạy từ hai threads: có thể sai ở đâu?
Định hướng: bí (2)/(3) → LAB A; bí (1)/(6) → transaction/OS modules; bí (4) → FDE decomposition; hiểu mà không nói được (5) → English modules. Đây là bài phân loại lỗ hổng, không phải bài thi chấm điểm.
CHẶNG I — CƠ BẢN VỀ REQUIREMENTS VÀ TIẾNG ANH
MÔ-ĐUN 01 [CORE] — “Thiết kế hệ thống” thực ra là làm gì?
01.1. Bắt đầu bằng một câu chuyện không có thuật ngữ
Một khách gọi khách sạn: “Tôi muốn đặt phòng ngày 20–22/10”. Nhân viên sẽ:
- Hỏi ngày, số khách, loại phòng.
- Kiểm tra phòng có còn trống trong toàn bộ khoảng ngày không.
- Cho khách biết giá và điều kiện.
- Ghi nhận booking.
- Xác nhận hoặc chuyển nhân viên duyệt.
Chuyển sang hệ thống phần mềm:
Người dùng (UI)
↓ HTTP request
Backend API (Controller)
↓
Business logic (Service): kiểm tra dữ liệu, ngày, giá, quyền, trạng thái
↓
Database / external room provider
↓
Service quyết định kết quả
↓
HTTP response → UI
Bạn đã biết Spring Boot nên nhiều khối này không mới. Phần mới là học trả lời năm câu:
- WHAT: Chức năng cần làm gì? (functional requirement)
- WHO/WHEN: Ai dùng và khi nào được làm? (actor / business rules)
- HOW: Dữ liệu và API đi qua những đâu? (components / data flow)
- WHAT IF: Nếu dữ liệu sai, hai người thao tác cùng lúc, service bên ngoài chết thì sao? (failure cases)
- WHY: Vì sao chọn cách A thay vì B? (trade-off)
Phân biệt từ đầu: LLD quan tâm chi tiết entities/classes/methods/APIs; basic system design quan tâm components, data flow, storage và những thuộc tính như reliability; problem decomposition bắt đầu sớm hơn: khách hàng chưa biết rõ cần xây cái gì.
01.2. Từ yêu cầu đến mô tả rõ ràng
Yêu cầu mơ hồ: “Xây chức năng booking”.
Làm rõ thành: - Actor: Customer, Staff. - Input: arrival date, departure date, room type, guest count. - Rules: departure > arrival; không chấp nhận hết phòng; booking cần duyệt nếu quy trình yêu cầu. - Output: booking ID + trạng thái hoặc lý do từ chối. - Error: room unavailable, malformed dates, downstream timeout.
Worked example — trả lời tiếng Anh chỉ 3 câu:
First, I would clarify who uses the feature and what the booking rules are. Then I would define the main entities and APIs. Finally, I would consider invalid requests, concurrent bookings, and how we verify the result.
Tự kiểm tra (che phần trên): Nếu khách hỏi “cho phép huỷ phòng”, bạn nêu được 2 câu làm rõ + 2 business rules không?
Đáp án tham khảo
- Hỏi: Ai được hủy (khách, nhân viên)? Hủy trước giờ check-in bao lâu? Có hoàn tiền không?
- Rules: Không cho hủy booking đã hoàn tất lưu trú; chỉ chủ booking hoặc nhân viên có quyền mới được hủy. Quy tắc cụ thể phải xác nhận với khách hàng; đây chỉ là ví dụ giả định.
🎙️ SPEAKING LAB V5.2 — 01. Requirements, rules và request flow
Thứ tự sử dụng: PRETEST → WATCH & DO ngay trong phần kiến thức phía trên → LISTEN/SHADOW → FREE SPEAK → FOLLOW-UP → feedback. Không mở đáp án trước lượt nói đầu.
Những ý kỹ thuật phải hiểu trước khi nói: Functional requirement; business rule; component/data flow; failure case; trade-off.
Từ đơn → cụm nói được (chỉ chọn 3–5 cụm để ôn hôm nay):
| Useful chunk | Nghĩa |
|---|---|
clarify the requirement |
làm rõ yêu cầu |
apply business rules |
áp dụng quy tắc nghiệp vụ |
handle an invalid request |
xử lý yêu cầu không hợp lệ |
verify the result |
kiểm chứng kết quả |
1. PRETEST + WATCH + DO
Hoàn thành ít nhất một bài COMPLETE/DO ở phía trên (hoặc giải thích một ví dụ mới). Nếu chưa giải thích được cơ chế bằng tiếng Việt, quay lại bài kỹ thuật trước khi bắt đầu nói.
2. LISTEN → SHADOW
A — LISTEN & SHADOW (3–4 phút): Ẩn chữ; dùng TTS/Voice đọc lần lượt các câu sau. Lượt 1 nghe và tóm tắt ý; lượt 2–3 bắt chước nhịp nói, rồi nói lại không nhìn.
- First, I would clarify the booking requirements.
- Then I would define the data flow and possible failure cases.
3. COMPLETE ORALLY
B — COMPLETE ORALLY (1–2 phút): Điền bằng giọng nói, không cần viết câu hoàn chỉnh trước.
A booking feature needs . The service checks . If , the API should .
4. FREE SPEAK — định nghĩa / cơ chế (không nhìn script)
Chọn 3–5 câu/lượt trong 4 câu sau. Đáp án được thu gọn dưới từng câu; chỉ mở sau khi đã nói.
Q001 · MECHANISM / WHY · BASE V4
TTS 001 · Q: What is the difference between a requirement and a business rule?
Mở đáp án mẫu Q001 — sau khi tự trả lời
TTS 002 · A: A requirement describes what users need. A business rule describes the conditions the system must follow. For example, users can book rooms, but they cannot book an unavailable room.
Q002 · MECHANISM / WHY · BASE V4
TTS 003 · Q: Walk me through a simple booking request.
Mở đáp án mẫu Q002 — sau khi tự trả lời
TTS 004 · A: First, the API receives the booking request. Then the service checks dates and availability. Finally, the database stores the booking, and the API returns the result.
Q003 · FOUNDATION · ADD V5
TTS 005 · Q: What is a functional requirement?
Mở đáp án mẫu Q003 — sau khi tự trả lời
TTS 006 · A: A functional requirement describes what the system must do. For example, customers need to create and cancel bookings.
Q004 · FOUNDATION · ADD V5
TTS 007 · Q: What is a business invariant?
Mở đáp án mẫu Q004 — sau khi tự trả lời
TTS 008 · A: An invariant is a rule that must remain true after every valid operation. For example, one room must not be allocated to two confirmed bookings for the same night.
5. UNEXPECTED FOLLOW-UP — thay giả định và suy luận
Chọn ít nhất một câu dưới đây, tự trả lời trước; sau đó yêu cầu người luyện thay một điều kiện mới.
Q005 · SCENARIO / FOLLOW-UP · BASE V4
TTS 009 · Q: Why would you ask about staff approval before writing code?
Mở đáp án mẫu Q005 — sau khi tự trả lời
TTS 010 · A: Staff approval changes the booking workflow. I need to know whether a booking stays pending and whether it holds a room before approval. This affects states, availability, and tests.
Q006 · SCENARIO / FOLLOW-UP · BASE V4
TTS 011 · Q: What changes if customers can cancel a booking?
Mở đáp án mẫu Q006 — sau khi tự trả lời
TTS 012 · A: I would add a cancellation action and define who can cancel and when. The service should validate the booking state and update availability according to the agreed policy.
Q007 · SCENARIO / FOLLOW-UP · BASE V4
TTS 013 · Q: What would you test before releasing the feature?
Mở đáp án mẫu Q007 — sau khi tự trả lời
TTS 014 · A: I would test invalid dates, unavailable rooms, and successful bookings. I would also test concurrent requests, permissions, and the approval workflow if approval is required.
6. REPEAT + FEEDBACK — checkpoint
E — REPEAT + FEEDBACK: Chọn câu khó nhất ở phần FREE SPEAK, nói 3 lượt (45–60 giây → 30–45 giây → 20–30 giây ở L1; tăng thời lượng ở L2), giữ ý chính và một test/example. Mở câu trả lời ngay dưới câu hỏi sau lượt 1; mỗi lượt chỉ sửa tối đa 2 lỗi.
- Thời lượng mục tiêu: L1: 30–40 giây; L2: 60 giây, nêu requirement → rule → flow → failure.
- Điều kiện qua bài: Không lẫn business rule với API endpoint; nêu được 1 actor, 1 invariant, 1 failure và 1 cách test.
- Điểm dễ nói sai / hiểu sai: Nói “use Spring Boot” không trả lời được requirement; luôn bắt đầu với nhu cầu và quy tắc.
| Self-check (đánh dấu sau khi nói) | Yes/No |
|---|---|
| Tôi giải đúng kiến thức và nêu được ví dụ / failure / test cần thiết | [ ] |
| Tôi hiểu câu hỏi khi nghe, hoặc hỏi lại đúng chỗ | [ ] |
| Tôi tự nói không nhìn script; có mở đầu và kết luận rõ | [ ] |
| Tôi xử lý được ít nhất 1 follow-up mới | [ ] |
Mẫu trả lời dài V4 (tùy chọn; xem sau khi tự nói)
Show sample only after speaking
One possible answer (~40–90 words):
A requirement describes what users need to do, while a business rule defines the conditions that must hold. For a booking feature, I would ask who can book and whether staff approval is required. The API receives a request, the service validates the rules, and the database stores the booking. I would also test unavailable rooms and invalid dates.
Knowledge guardrail: Nói “use Spring Boot” không trả lời được requirement; luôn bắt đầu với nhu cầu và quy tắc.
Reverse recall: Che sample; nói lại bằng từ của mình rồi trả lời follow-up số 2 trong Speaking Lab 01.
MÔ-ĐUN 02 [CORE] — Đọc, nghe và trả lời câu hỏi kỹ thuật bằng tiếng Anh (từ cơ bản)
Tại sao học trước? Không hiểu interviewer hỏi gì thì biết kiến thức vẫn trả lời sai. Nhưng không cần học cả giáo trình ngữ pháp: học theo những cấu trúc xuất hiện trong phỏng vấn.
02.1. “Giải mã” câu hỏi theo cấu trúc
| Interviewer nói | Dịch ý | Phản xạ cần có |
|---|---|---|
| What is X? | X là gì? | Định nghĩa + ví dụ |
| How does X work? | X hoạt động thế nào? | Nêu từng bước |
| Why did you choose X? | Vì sao chọn X? | Lý do + phương án khác + đánh đổi |
| What's the difference between X and Y? | X và Y khác nhau thế nào? | So sánh 2–3 tiêu chí |
| What happens if X fails? | Chuyện gì xảy ra nếu X lỗi? | Hậu quả + cách phát hiện + phục hồi |
| Walk me through... | Giải thích tuần tự | Đi từ input → output |
| How would you design...? | Nếu giao bạn thiết kế thì...? | Hỏi rõ yêu cầu trước |
| What assumptions are you making? | Bạn đang giả định gì? | Nêu giả định, cách xác thực |
| How would you verify/test...? | Làm sao kiểm chứng? | Test case, metric, log |
| What is the trade-off? | Đánh đổi là gì? | Lợi ích ↔ chi phí/rủi ro |
| Could you elaborate? | Bạn nói chi tiết hơn được không? | Cho ví dụ hoặc cơ chế |
| Can you think of edge cases? | Các trường hợp biên? | Input rỗng, trùng, lỗi, đồng thời |
02.2. 12 từ “đổi nghĩa câu hỏi” phải nhận ra ngay
| Từ | Nghĩa | Cạm bẫy |
|---|---|---|
| NOT / EXCEPT / INCORRECT | không đúng / ngoại trừ | chọn phát biểu sai |
| BEST / MOST / LEAST | tốt nhất / nhiều nhất / ít nhất | so sánh tương đối |
| PRIMARY | chính, chủ yếu | không chọn lợi ích thứ yếu |
| necessary | cần | thiếu nó thì không có điều kiện đích |
| sufficient | đủ | có nó thì đảm bảo điều kiện đích |
| only if | chỉ khi | “A only if B”: A ⇒ B |
| unless | trừ khi | xem điều kiện ngoại lệ |
| given / assuming | cho trước / giả sử | không tự sửa giả định đề bài |
| always / never | luôn / không bao giờ | chú ý ngoại lệ |
| typically / by default | thường / mặc định | không có nghĩa 100% |
| concurrently | diễn ra chồng lấn | có thể không chạy song song thật |
| at least / at most | ít nhất / nhiều nhất | đảo nhầm giới hạn |
Ví dụ: “Which action is LEAST likely to prevent duplicate bookings?” → chọn hành động ít có tác dụng nhất, không phải hiệu quả nhất.
02.3. Bốn khung trả lời thay cho học thuộc từng câu
Khung A — định nghĩa: X is ... → It is used for ... → Example ...
A database transaction groups multiple operations into one logical unit. It helps preserve consistency when something fails. For example, booking creation and inventory updates may need to succeed or fail together.
Khung B — giải thích cơ chế: Input → Step 1 → Step 2 → Result → Failure
When a request reaches the controller, we validate the input, call the service, access the database, and return a response. If validation fails, we return a client error.
Khung C — giải thích quyết định: Goal → Choice → Because → Trade-off
For an early MVP, I would choose a modular monolith because it's simpler to build and deploy. The trade-off is that independent scaling and deployment are more limited than with separate services.
Khung D — gặp bài chưa rõ: Clarify → Assume → Propose → Verify
Could I clarify whether reservations need staff approval? If approval is required, I would introduce a pending state and a staff approval API. We can verify this with acceptance tests.
02.4. Các câu cứu nguy khi nghe chưa hiểu
- Could you repeat the last part, please? — Nhắc lại phần cuối.
- Could you rephrase the question? — Diễn đạt lại câu hỏi.
- Do you mean X or Y? — Xác nhận hiểu đúng.
- May I take a moment to think? — Xin vài giây suy nghĩ.
- I haven't implemented that myself. My current understanding is ... — Thành thật về phạm vi kinh nghiệm.
- Let me correct my previous answer. — Sửa câu trả lời.
Không nên: trả lời thật dài để che việc chưa hiểu, hoặc nhận đã dùng công nghệ mà mình chưa dùng.
02.5. Luyện nghe không cần có partner
- Chép 6 câu trong §1.1 vào ứng dụng đọc văn bản tiếng Anh (text-to-speech) hoặc nhờ người khác đọc; ẩn bản chữ.
- Nghe 1 lần, nói lại bằng tiếng Việt interviewer muốn dạng câu trả lời nào.
- Nghe lần 2 và trả lời bằng 2–4 câu tiếng Anh.
- Ghi lỗi vào ba nhóm: (a) không nghe rõ từ; (b) nghe rõ nhưng không hiểu thuật ngữ; (c) hiểu nhưng không nói ra được.
Bài tập tăng dần: - Dễ: What is an index? - Vừa: Why would an index improve some queries but slow down writes? - Khó: A query is slow even though the indexed column appears in WHERE. What would you check first?
Đáp án mẫu ngắn — chỉ xem sau khi tự nói
- An index is a data structure that helps a database locate relevant rows faster.
- An index can reduce the work needed to find rows. However, inserts and updates may also need to maintain the index.
- I would inspect the execution plan and query predicates first. I would check whether the database actually uses the index, the selectivity, and whether the query needs many rows.
Checkpoint Mô-đun 02: Tự nghe và phân loại đúng ≥ 8/10 câu dạng trên; tự trả lời 3 câu không đọc script. Nếu chưa làm được, lặp Mô-đun 02 trước khi đi tiếp.
🎙️ SPEAKING LAB V5.2 — 02. Nghe và phân loại câu hỏi phỏng vấn
Thứ tự sử dụng: PRETEST → WATCH & DO ngay trong phần kiến thức phía trên → LISTEN/SHADOW → FREE SPEAK → FOLLOW-UP → feedback. Không mở đáp án trước lượt nói đầu.
Những ý kỹ thuật phải hiểu trước khi nói: What / How / Why / Difference / What if / Verify / MOST / LEAST / EXCEPT / only if.
Từ đơn → cụm nói được (chỉ chọn 3–5 cụm để ôn hôm nay):
| Useful chunk | Nghĩa |
|---|---|
Could you elaborate? |
bạn giải thích thêm được không? |
The main difference is... |
khác biệt chính là... |
One possible failure is... |
một lỗi có thể xảy ra là... |
To verify this, I would... |
để kiểm chứng, tôi sẽ... |
1. PRETEST + WATCH + DO
Hoàn thành ít nhất một bài COMPLETE/DO ở phía trên (hoặc giải thích một ví dụ mới). Nếu chưa giải thích được cơ chế bằng tiếng Việt, quay lại bài kỹ thuật trước khi bắt đầu nói.
2. LISTEN → SHADOW
A — LISTEN & SHADOW (3–4 phút): Ẩn chữ; dùng TTS/Voice đọc lần lượt các câu sau. Lượt 1 nghe và tóm tắt ý; lượt 2–3 bắt chước nhịp nói, rồi nói lại không nhìn.
- Could you rephrase the last part of the question?
- The main trade-off is better read performance but more write overhead.
3. COMPLETE ORALLY
B — COMPLETE ORALLY (1–2 phút): Điền bằng giọng nói, không cần viết câu hoàn chỉnh trước.
You are asking about . My short answer is . For example, ___.
4. FREE SPEAK — định nghĩa / cơ chế (không nhìn script)
Chọn 3–5 câu/lượt trong 4 câu sau. Đáp án được thu gọn dưới từng câu; chỉ mở sau khi đã nói.
Q008 · MECHANISM / WHY · BASE V4
TTS 015 · Q: What kind of answer does “How does an index work?” require?
Mở đáp án mẫu Q008 — sau khi tự trả lời
TTS 016 · A: It requires a step-by-step explanation, not just a definition. I would explain how an index helps find matching rows, and then mention the extra storage and write cost.
Q009 · MECHANISM / WHY · BASE V4
TTS 017 · Q: Which action is LEAST likely to prevent duplicate bookings? Explain what LEAST changes.
Mở đáp án mẫu Q009 — sau khi tự trả lời
TTS 018 · A: Least means the smallest amount or the lowest effectiveness. So I must choose the action that is least effective at preventing duplicate bookings, not the best action.
Q010 · MECHANISM / WHY · BASE V4
TTS 019 · Q: Could you compare a requirement and an assumption?
Mở đáp án mẫu Q010 — sau khi tự trả lời
TTS 020 · A: A requirement tells us what the system needs to do. An assumption is something we believe is true but still need to confirm. I would check important assumptions with the customer.
Q011 · FOUNDATION · ADD V5
TTS 021 · Q: What does the word EXCEPT mean in a multiple-choice question?
Mở đáp án mẫu Q011 — sau khi tự trả lời
TTS 022 · A: It asks me to find the option that does not satisfy the stated condition. I would read all the options before choosing an answer.
5. UNEXPECTED FOLLOW-UP — thay giả định và suy luận
Chọn ít nhất một câu dưới đây, tự trả lời trước; sau đó yêu cầu người luyện thay một điều kiện mới.
Q012 · SCENARIO / FOLLOW-UP · BASE V4
TTS 023 · Q: What would you say if you did not hear a technical term?
Mở đáp án mẫu Q012 — sau khi tự trả lời
TTS 024 · A: I would say, Could you repeat that technical term, please? If I still do not understand, I would ask the interviewer to explain it in another way.
Q013 · SCENARIO / FOLLOW-UP · BASE V4
TTS 025 · Q: How would you clarify a question about a “best” solution with missing constraints?
Mở đáp án mẫu Q013 — sau khi tự trả lời
TTS 026 · A: I would ask what matters most, such as response time, cost, or consistency. The best solution depends on these constraints, so I would not choose one before clarifying them.
Q014 · SCENARIO / FOLLOW-UP · ADD V5
TTS 027 · Q: What would you say if you did not know the answer to a technical question?
Mở đáp án mẫu Q014 — sau khi tự trả lời
TTS 028 · A: I would explain what I know and make my uncertainty clear. Then I would describe how I would verify the missing detail. I would not claim experience I do not have.
6. REPEAT + FEEDBACK — checkpoint
E — REPEAT + FEEDBACK: Chọn câu khó nhất ở phần FREE SPEAK, nói 3 lượt (45–60 giây → 30–45 giây → 20–30 giây ở L1; tăng thời lượng ở L2), giữ ý chính và một test/example. Mở câu trả lời ngay dưới câu hỏi sau lượt 1; mỗi lượt chỉ sửa tối đa 2 lỗi.
- Thời lượng mục tiêu: L0: nghe và phân loại 8/10 prompts; L1: trả lời 2–4 câu; L2: hỏi lại tự nhiên.
- Điều kiện qua bài: Chỉ ra đúng nghĩa các từ phủ định/so sánh; hỏi lại khi thiếu dữ kiện thay vì đoán.
- Điểm dễ nói sai / hiểu sai: Đừng thấy BEST/MOST/NOT/EXCEPT rồi chọn theo phản xạ; tóm tắt lại yêu cầu đề trước.
| Self-check (đánh dấu sau khi nói) | Yes/No |
|---|---|
| Tôi giải đúng kiến thức và nêu được ví dụ / failure / test cần thiết | [ ] |
| Tôi hiểu câu hỏi khi nghe, hoặc hỏi lại đúng chỗ | [ ] |
| Tôi tự nói không nhìn script; có mở đầu và kết luận rõ | [ ] |
| Tôi xử lý được ít nhất 1 follow-up mới | [ ] |
Mẫu trả lời dài V4 (tùy chọn; xem sau khi tự nói)
Show sample only after speaking
One possible answer (~40–90 words):
The word “least” means I should choose the option that is the least effective, not the most effective. If a question is unclear, I would ask the interviewer to rephrase it. For a “best solution” question, I would first clarify the constraints, because the best option depends on the workload and business goals.
Knowledge guardrail: Đừng thấy BEST/MOST/NOT/EXCEPT rồi chọn theo phản xạ; tóm tắt lại yêu cầu đề trước.
Reverse recall: Che sample; nói lại bằng từ của mình rồi trả lời follow-up số 2 trong Speaking Lab 02.
CHẶNG II — TẬP THIẾT KẾ TỪ NHỎ ĐẾN TỔNG THỂ
LAB A [CORE] — Cầu nối cho người mới: từ một câu nói thành Entities → Rules → APIs
Vì sao làm lab này trước LLD đầy đủ? Khi mới học design, entity, business rule, state và API dễ bị trộn lẫn. Ta chia nhỏ, tập từng việc rồi mới ghép.
A0. Từ điển cực ngắn
| Thuật ngữ | Hiểu như người mới | Ví dụ |
|---|---|---|
| Actor | Ai làm? | Customer, Staff |
| Use case | Họ muốn làm gì? | Customer creates a booking |
| Entity | Thứ cần lưu/truy vết qua thời gian | Booking, Room |
| Attribute | Một đặc điểm của entity | booking.status |
| Business rule / invariant | Điều không được sai | Một phòng không bị giữ trùng cùng đêm |
| State | Giai đoạn của entity | PENDING, APPROVED |
| Transition | Hành động đưa entity sang state khác | approve: PENDING → APPROVED |
| API contract | Lời hứa input/output/lỗi giữa các bên | POST /bookings, 201/409 |
| Service | Logic xử lý use case / business rules | BookingService |
Bẫy: Không phải mọi danh từ đều phải thành table hoặc class. BookingStatus có thể là enum, Price có thể là value object; chia thế nào phụ thuộc domain.
A1. WATCH — một yêu cầu cực nhỏ
A user can create a personal note and archive it later.
Bước 1 — actor/use cases: User; Create note, Archive note.
Bước 2 — entity: Note(id, ownerId, content, status, createdAt).
Bước 3 — rules: content không để trống; chỉ owner được archive; archived note không được archive lần hai theo chính sách đã chốt.
Bước 4 — states: ACTIVE → ARCHIVED.
Bước 5 — API: POST /notes nhận {content} → 201 + note; POST /notes/{id}/archive → 200/204, 403 nếu thiếu quyền, 404 nếu không tồn tại. Quyết định trả 409/204 khi đã archived phải thống nhất với contract.
Bước 6 — classes: NoteController xử lý HTTP; NoteService kiểm owner và trạng thái; NoteRepository đọc/ghi DB.
Bước 7 — tests: tạo note rỗng → 400; người B archive note A → 403; archive thành công → DB status ARCHIVED.
English, ba câu đủ dùng: The main entity is Note. The service validates ownership and status changes. I would test invalid content and unauthorized archiving.
A2. COMPLETE — điền những ô còn thiếu (5 phút)
A student can enroll in a course. A course has a maximum capacity.
- Actor:
__________. - Use case:
__________. - Entities:
Student,Course,__________. - Invariant: total active enrollments for a course must not exceed
__________. - Proposed API:
POST /courses/{id}/__________. - Concurrent case: Two students enroll for the last seat. How would you protect the rule?
__________.
Gợi ý một
Một enrollment là mối quan hệ có thể có ngày tạo/trạng thái; Enrollment(studentId, courseId, status) có thể cần tồn tại độc lập. Count rồi insert mà không bảo vệ concurrency có thể vượt capacity.
Đáp án và lý do
Student; enroll; Enrollment; capacity; enrollments; dùng cơ chế kiểm soát cạnh tranh ở nguồn dữ liệu (ví dụ lock row Course trong transaction rồi đếm, hoặc atomic capacity reservation), kết hợp unique (course_id, student_id) và test đồng thời. Chọn giải pháp cụ thể tùy schema và isolation; chỉ @Transactional mà không có điều kiện/lock phù hợp không tự giải quyết mọi race.
A3. DO — case lạ không có khung điền (8 phút)
A team lead can approve an employee's leave request. An employee cannot approve their own request.
Trước khi xem đáp án, tự viết: 2 actors, tối đa 3 entities, states, 2 endpoints, 3 rules, 2 tests, một câu tiếng Anh giải thích vì sao cần role check.
Đáp án tham khảo
Actors: employee, team lead. Entity chính LeaveRequest(id, employeeId, approverId?, startDate, endDate, status) và User/Role; history nếu audit bắt buộc. States DRAFT → SUBMITTED → APPROVED/REJECTED; confirm chính sách sửa sau submit. POST /leave-requests, POST /leave-requests/{id}/approve. Rules: approver có quyền, không tự duyệt, chỉ SUBMITTED được approve; overlapping leave tùy policy. Tests: self-approval → 403; two approvals simultaneously → không có hai transitions/audit sai. I would verify the approver's role and ensure employees cannot approve their own requests.
Qua LAB A nếu: Bạn tự chỉ được actor/entity/state/rule/API cho một yêu cầu hoàn toàn mới trong 6–8 phút. Nếu chưa, làm lại A2/A3 trước khi vào Registration.
🎙️ SPEAKING LAB V5.2 — A. Entities → Rules → APIs
Thứ tự sử dụng: PRETEST → WATCH & DO ngay trong phần kiến thức phía trên → LISTEN/SHADOW → FREE SPEAK → FOLLOW-UP → feedback. Không mở đáp án trước lượt nói đầu.
Những ý kỹ thuật phải hiểu trước khi nói: Actor; entity; state; invariant; endpoint; authorization; concurrency test.
Từ đơn → cụm nói được (chỉ chọn 3–5 cụm để ôn hôm nay):
| Useful chunk | Nghĩa |
|---|---|
the main entity is... |
thực thể chính là... |
move from ... to ... |
chuyển trạng thái từ ... sang ... |
enforce the rule |
buộc tuân thủ quy tắc |
check ownership |
kiểm tra chủ sở hữu |
1. PRETEST + WATCH + DO
Hoàn thành ít nhất một bài COMPLETE/DO ở phía trên (hoặc giải thích một ví dụ mới). Nếu chưa giải thích được cơ chế bằng tiếng Việt, quay lại bài kỹ thuật trước khi bắt đầu nói.
2. LISTEN → SHADOW
A — LISTEN & SHADOW (3–4 phút): Ẩn chữ; dùng TTS/Voice đọc lần lượt các câu sau. Lượt 1 nghe và tóm tắt ý; lượt 2–3 bắt chước nhịp nói, rồi nói lại không nhìn.
- The main entity is an enrollment with a student, a course, and a status.
- I would protect the last available seat with database concurrency control.
3. COMPLETE ORALLY
B — COMPLETE ORALLY (1–2 phút): Điền bằng giọng nói, không cần viết câu hoàn chỉnh trước.
The actor is . The main entities are . A key invariant is ___.
4. FREE SPEAK — định nghĩa / cơ chế (không nhìn script)
Chọn 3–5 câu/lượt trong 3 câu sau. Đáp án được thu gọn dưới từng câu; chỉ mở sau khi đã nói.
Q015 · FOUNDATION · BASE V4
TTS 029 · Q: Design a small course enrollment feature. What are the entities?
Mở đáp án mẫu Q015 — sau khi tự trả lời
TTS 030 · A: I would create Student, Course, and Enrollment entities. Enrollment connects a student to a course and stores its status. The main rule is that active enrollments must not exceed the course capacity.
Q016 · FOUNDATION · BASE V4
TTS 031 · Q: Should the same student be allowed to enroll twice?
Mở đáp án mẫu Q016 — sau khi tự trả lời
TTS 032 · A: Usually, I would prevent duplicate active enrollments for the same student and course. I could enforce this with an appropriate database constraint and test two concurrent enrollment requests.
Q017 · MECHANISM / WHY · ADD V5
TTS 033 · Q: What is the difference between an entity and a service?
Mở đáp án mẫu Q017 — sau khi tự trả lời
TTS 034 · A: An entity represents important domain data and may contain domain behavior. A service coordinates a use case or business operation. For example, a BookingService creates a Booking while enforcing its rules.
5. UNEXPECTED FOLLOW-UP — thay giả định và suy luận
Chọn ít nhất một câu dưới đây, tự trả lời trước; sau đó yêu cầu người luyện thay một điều kiện mới.
Q018 · SCENARIO / FOLLOW-UP · BASE V4
TTS 035 · Q: Two students take the last seat. How do you keep the capacity rule?
Mở đáp án mẫu Q018 — sau khi tự trả lời
TTS 036 · A: I would protect the last seat inside the database using a suitable lock or atomic update. Two requests must not both reserve the same seat. I would verify this with a concurrent test.
Q019 · SCENARIO / FOLLOW-UP · BASE V4
TTS 037 · Q: How would you test unauthorized approval of a leave request?
Mở đáp án mẫu Q019 — sau khi tự trả lời
TTS 038 · A: I would log in as a normal employee and call the approval API. I would expect a forbidden response and no status change. Then I would repeat the test with an authorized team lead.
Q020 · SCENARIO / FOLLOW-UP · BASE V4
TTS 039 · Q: What if a student drops a course?
Mở đáp án mẫu Q020 — sau khi tự trả lời
TTS 040 · A: I would define a drop action and change the enrollment status. If the course uses reserved seats, dropping should release one. I would test that the available capacity is updated correctly.
Q021 · SCENARIO / FOLLOW-UP · ADD V5
TTS 041 · Q: How would you represent the lifecycle of a leave request?
Mở đáp án mẫu Q021 — sau khi tự trả lời
TTS 042 · A: I would define states such as DRAFT, SUBMITTED, APPROVED, and REJECTED. Then I would list allowed transitions and who can perform them. I would test invalid transitions and self-approval.
6. REPEAT + FEEDBACK — checkpoint
E — REPEAT + FEEDBACK: Chọn câu khó nhất ở phần FREE SPEAK, nói 3 lượt (45–60 giây → 30–45 giây → 20–30 giây ở L1; tăng thời lượng ở L2), giữ ý chính và một test/example. Mở câu trả lời ngay dưới câu hỏi sau lượt 1; mỗi lượt chỉ sửa tối đa 2 lỗi.
- Thời lượng mục tiêu: L1: tên entities/rules bằng 3 câu; L2: 60 giây actor → entities → rule → endpoint → test.
- Điều kiện qua bài: Tách được entity, enum/state và service, đưa ra giải pháp bảo vệ invariant ở DB.
- Điểm dễ nói sai / hiểu sai: Chỉ kiểm tra count rồi insert không đảm bảo giới hạn khi request concurrent.
| Self-check (đánh dấu sau khi nói) | Yes/No |
|---|---|
| Tôi giải đúng kiến thức và nêu được ví dụ / failure / test cần thiết | [ ] |
| Tôi hiểu câu hỏi khi nghe, hoặc hỏi lại đúng chỗ | [ ] |
| Tôi tự nói không nhìn script; có mở đầu và kết luận rõ | [ ] |
| Tôi xử lý được ít nhất 1 follow-up mới | [ ] |
Mẫu trả lời dài V4 (tùy chọn; xem sau khi tự nói)
Show sample only after speaking
One possible answer (~40–90 words):
I would model Student, Course, and Enrollment. Each enrollment records the student, course, and status. A key invariant is that active enrollments cannot exceed the course capacity. The enrollment API should check permission and protect the last seat with suitable database concurrency control. I would test two students enrolling for the last seat at the same time.
Knowledge guardrail: Chỉ kiểm tra count rồi insert không đảm bảo giới hạn khi request concurrent.
Reverse recall: Che sample; nói lại bằng từ của mình rồi trả lời follow-up số 2 trong Speaking Lab A.
MÔ-ĐUN 03 [CORE] — LLD bước 1: yêu cầu → entities, classes, API
Mục tiêu: sau bài này, được giao “thiết kế đăng ký tài khoản”, bạn không còn đứng hình vì không biết bắt đầu từ đâu.
03.1. LLD khác code Spring sẵn có ở đâu?
Bạn đã biết Controller → Service → Repository. LLD yêu cầu bạn quyết định vì sao có những lớp đó, mỗi lớp chịu trách nhiệm gì, cấu trúc dữ liệu ra sao, rồi giải thích được khi thay đổi yêu cầu.
Quy tắc bắt đầu đơn giản — không phải phép màu:
1. Tìm danh từ trong yêu cầu → ứng viên entity/object (User, Booking, Room).
2. Tìm động từ → hành vi (register, approve, cancel).
3. Tìm business rules → invariants (email unique, room not overbooked).
4. Tìm vai trò → permissions.
5. Tìm sự kiện thay đổi trạng thái → lifecycle / state transitions.
03.2. Worked example đầy đủ: User Registration
Đề: Users can register with email and password. The email must be unique. After registration, a verification email is sent.
Bước 1 — hỏi trước khi design: - Email verification là bắt buộc trước khi login? - Chính sách mật khẩu thế nào? - Trùng email trả lỗi gì, có cần tránh user enumeration? - Gửi email thất bại có hủy việc đăng ký không?
Giả định cho MVP: tài khoản ở PENDING_VERIFICATION đến khi verify; email unique case-insensitive theo quy tắc đã thống nhất; việc gửi email có thể bất đồng bộ và retry được.
Bước 2 — data model:
User
- id: UUID PK
- email: String UNIQUE theo normalized_email / quy tắc DB
- passwordHash: String
- status: UserStatus PENDING_VERIFICATION / ACTIVE
- createdAt: Instant
VerificationToken
- id: UUID
- userId: UUID FK → User.id
- tokenHash: String
- expiresAt: Instant
- consumedAt: Instant?
Bước 3 — chia responsibilities:
RegistrationController : HTTP request + validation boundary + response
RegistrationService : use case register user, phối hợp các thành phần
UserRepository : lưu/truy xuất User, kiểm tra uniqueness qua DB constraint
PasswordHasher : tạo password hash
VerificationService : quản lý token và verification policy
EmailSender : gửi email qua abstraction
Đừng đặt mọi logic vào Controller; cũng đừng tạo 20 interfaces cho một MVP nhỏ. High cohesion / low coupling: một module có trách nhiệm liên quan, phụ thuộc ngoài càng ít càng tốt.
Bước 4 — API:
POST /api/users/register
Content-Type: application/json
{"email":"an@example.com","password":"..."}
HTTP/1.1 201 Created
{"userId":"...","status":"PENDING_VERIFICATION"}
Status code và response cụ thể do API contract lựa chọn, không có một đáp án tuyệt đối. Với hệ thống public, cân nhắc thông báo chung để hạn chế tiết lộ email nào đã đăng ký.
Bước 5 — sequence diagram dạng text:
Client Controller RegistrationService Database Email
| POST register | | | |
|---------------->| validate | | |
| |------------------->| normalize/hash | |
| | | INSERT User+token | |
| | |------------------->| |
| | | <--- commit result | |
| | | request delivery ----------------->|
| |<-------------------| result | |
|<-- 201 + status | | | |
Production nuance: gọi email trực tiếp sau DB commit có thể bị mất nếu process crash giữa commit và gửi. Một cách xử lý đáng học ở bước sau là outbox pattern; không bắt buộc thiết kế ngay trong bài LLD đầu tiên.
Bước 6 — edge cases / tests: invalid email; weak password; duplicate registration; email provider timeout; expired token; reused token; two concurrent registrations of same email (DB unique constraint là điểm bảo vệ cuối cùng).
03.3. UML căn bản — nhớ ý, đừng học quá nhiều ký hiệu
- ERD mô tả bảng và cardinality.
- Class diagram mô tả classes, fields, methods, relationships.
- Sequence diagram mô tả thứ tự message giữa components.
- State diagram mô tả trạng thái/chuyển trạng thái.
- Use-case diagram mô tả actors và chức năng từ góc người dùng.
| Quan hệ | Ý nghĩa trực giác |
|---|---|
| Association | hai đối tượng có liên hệ |
| Aggregation (hollow diamond) | quan hệ whole–part yếu |
| Composition (filled diamond) | whole–part với ownership/lifecycle mạnh |
| Inheritance / generalization | is-a relationship |
| Interface implementation / realization | class thực hiện contract |
03.4. SOLID từ ứng dụng chứ không phải 5 định nghĩa trừu tượng
| Nguyên lý | Áp dụng vào Registration |
|---|---|
| S — Single Responsibility | EmailSender không quyết định user status |
| O — Open/Closed | thêm EmailSender implementation khác mà hạn chế sửa registration logic |
| L — Liskov Substitution | thay implementation của EmailSender vẫn phải giữ contract hứa hẹn |
| I — Interface Segregation | đừng bắt EmailSender implement 20 methods không dùng |
| D — Dependency Inversion | Service phụ thuộc EmailSender contract thay vì SDK cụ thể |
Không lạm dụng: nguyên lý là hướng dẫn thiết kế, không phải yêu cầu tạo interface cho mọi class.
03.5. Design patterns chỉ cần biết tình huống
- Strategy: nhiều cách tính giá/discount thay đổi được.
- Factory: chọn cách tạo một object phức tạp, che chi tiết khởi tạo.
- Observer / pub-sub: sự kiện booking confirmed → nhiều subscribers xử lý.
- Adapter: biến API của vendor A thành interface thống nhất bên trong hệ thống.
- Singleton: quản lý một instance theo scope xác định; không mặc định thread-safe.
- Decorator [PLUS]: bọc thêm behavior mà không sửa object gốc.
Tự làm — bản có gợi ý: Thiết kế PasswordReset.
- Gợi ý 1: tìm entities
User,PasswordResetToken. - Gợi ý 2: states / expiration / one-time use.
- Gợi ý 3: API
request-resetvàconfirm-reset.
Đáp án mẫu PasswordReset
- Entities: User, ResetToken(hashed token, expiration, consumed flag).
- APIs:
POST /password-resets(khởi tạo) vàPOST /password-resets/confirm(token + mật khẩu mới). - Service: kiểm tra token còn hiệu lực, cập nhật password hash, đánh dấu đã sử dụng trong transaction phù hợp.
- Safety: không tiết lộ email đã tồn tại hay chưa qua thông báo khác biệt; rate limit; token có entropy cao và thời hạn; không log plaintext token/password.
- Tests: expired/replayed token, concurrent uses, invalid password, provider failure.
Câu tiếng Anh: I would separate HTTP handling from business logic and data access. The registration service coordinates validation, persistence, and verification. A database uniqueness constraint protects against concurrent duplicate registrations.
🎙️ SPEAKING LAB V5.2 — 03. Registration LLD
Thứ tự sử dụng: PRETEST → WATCH & DO ngay trong phần kiến thức phía trên → LISTEN/SHADOW → FREE SPEAK → FOLLOW-UP → feedback. Không mở đáp án trước lượt nói đầu.
Những ý kỹ thuật phải hiểu trước khi nói: Unique normalized email; hashed password; verification token; responsibilities; email failure.
Từ đơn → cụm nói được (chỉ chọn 3–5 cụm để ôn hôm nay):
| Useful chunk | Nghĩa |
|---|---|
separate responsibilities |
tách trách nhiệm |
enforce uniqueness |
đảm bảo tính duy nhất |
hash the password |
băm mật khẩu |
send a verification email |
gửi email xác minh |
1. PRETEST + WATCH + DO
Hoàn thành ít nhất một bài COMPLETE/DO ở phía trên (hoặc giải thích một ví dụ mới). Nếu chưa giải thích được cơ chế bằng tiếng Việt, quay lại bài kỹ thuật trước khi bắt đầu nói.
2. LISTEN → SHADOW
A — LISTEN & SHADOW (3–4 phút): Ẩn chữ; dùng TTS/Voice đọc lần lượt các câu sau. Lượt 1 nghe và tóm tắt ý; lượt 2–3 bắt chước nhịp nói, rồi nói lại không nhìn.
- The registration service coordinates validation and persistence.
- A database uniqueness constraint helps prevent duplicate registrations.
3. COMPLETE ORALLY
B — COMPLETE ORALLY (1–2 phút): Điền bằng giọng nói, không cần viết câu hoàn chỉnh trước.
I would model ___ and ___. The ___ handles HTTP, while the ___ handles business logic.
4. FREE SPEAK — định nghĩa / cơ chế (không nhìn script)
Chọn 3–5 câu/lượt trong 4 câu sau. Đáp án được thu gọn dưới từng câu; chỉ mở sau khi đã nói.
Q022 · MECHANISM / WHY · BASE V4
TTS 043 · Q: Explain the responsibilities of a registration controller and service.
Mở đáp án mẫu Q022 — sau khi tự trả lời
TTS 044 · A: The controller receives the HTTP request, validates its structure, and returns a response. The service applies registration rules, hashes the password, and coordinates saving the user and verification token.
Q023 · MECHANISM / WHY · BASE V4
TTS 045 · Q: Why should the email comparison policy be defined explicitly?
Mở đáp án mẫu Q023 — sau khi tự trả lời
TTS 046 · A: Different rules for uppercase letters or spaces can create duplicate accounts or unexpected login behavior. I would define normalization and comparison clearly, then enforce the same rule in the database.
Q024 · MECHANISM / WHY · ADD V5
TTS 047 · Q: Why should passwords be hashed instead of encrypted for storage?
Mở đáp án mẫu Q024 — sau khi tự trả lời
TTS 048 · A: For password verification, I would store a salted, slow password hash rather than a recoverable password. The server can verify a candidate password without storing plaintext. A suitable password-hashing algorithm also makes offline guessing harder.
Q025 · MECHANISM / WHY · ADD V5
TTS 049 · Q: What is the difference between validation and authorization in registration?
Mở đáp án mẫu Q025 — sau khi tự trả lời
TTS 050 · A: Validation checks that the input satisfies format and business constraints. Authorization checks whether a caller may perform an action. Public registration may not require an existing account, but later account changes require access checks.
5. UNEXPECTED FOLLOW-UP — thay giả định và suy luận
Chọn ít nhất một câu dưới đây, tự trả lời trước; sau đó yêu cầu người luyện thay một điều kiện mới.
Q026 · SCENARIO / FOLLOW-UP · BASE V4
TTS 051 · Q: How do you prevent two concurrent registrations with the same email?
Mở đáp án mẫu Q026 — sau khi tự trả lời
TTS 052 · A: I would normalize the email according to a clear policy and enforce uniqueness in the database. A pre-check improves the message, but the unique constraint handles concurrent inserts.
Q027 · SCENARIO / FOLLOW-UP · BASE V4
TTS 053 · Q: What happens if the email provider fails after the user is saved?
Mở đáp án mẫu Q027 — sau khi tự trả lời
TTS 054 · A: The user may already be saved, even if the email could not be delivered. I would record the delivery task and retry it safely. A database rollback cannot automatically undo an external email failure.
Q028 · SCENARIO / FOLLOW-UP · BASE V4
TTS 055 · Q: How would you protect password-reset tokens?
Mở đáp án mẫu Q028 — sau khi tự trả lời
TTS 056 · A: I would store a hash of a strong random token and give it an expiration time. The token should be single-use. I would test expired, reused, and concurrent token requests.
Q029 · SCENARIO / FOLLOW-UP · ADD V5
TTS 057 · Q: How would you handle verification-email delivery reliably?
Mở đáp án mẫu Q029 — sau khi tự trả lời
TTS 058 · A: I would save the user and a durable email-delivery task in one local transaction. A worker can send the email and retry failures. I would also make delivery processing safe when messages are duplicated.
6. REPEAT + FEEDBACK — checkpoint
E — REPEAT + FEEDBACK: Chọn câu khó nhất ở phần FREE SPEAK, nói 3 lượt (45–60 giây → 30–45 giây → 20–30 giây ở L1; tăng thời lượng ở L2), giữ ý chính và một test/example. Mở câu trả lời ngay dưới câu hỏi sau lượt 1; mỗi lượt chỉ sửa tối đa 2 lỗi.
- Thời lượng mục tiêu: L1: explain Controller/Service/Repository; L2: 60–90 giây kèm race và email failure.
- Điều kiện qua bài: Tách HTTP, domain, persistence và external side effect; không coi “check tồn tại trước insert” là bảo vệ duy nhất.
- Điểm dễ nói sai / hiểu sai: Email failure không nên được giải thích như được DB transaction bảo đảm rollback tự động.
| Self-check (đánh dấu sau khi nói) | Yes/No |
|---|---|
| Tôi giải đúng kiến thức và nêu được ví dụ / failure / test cần thiết | [ ] |
| Tôi hiểu câu hỏi khi nghe, hoặc hỏi lại đúng chỗ | [ ] |
| Tôi tự nói không nhìn script; có mở đầu và kết luận rõ | [ ] |
| Tôi xử lý được ít nhất 1 follow-up mới | [ ] |
Mẫu trả lời dài V4 (tùy chọn; xem sau khi tự nói)
Show sample only after speaking
One possible answer (~40–90 words):
I would use a User entity and a VerificationToken entity. The controller handles HTTP input and response, while the service coordinates validation, password hashing, and persistence. The database should enforce email uniqueness to handle concurrent requests. I would send verification through a separate component and plan for delivery failures after the database commit.
Knowledge guardrail: Email failure không nên được giải thích như được DB transaction bảo đảm rollback tự động.
Reverse recall: Che sample; nói lại bằng từ của mình rồi trả lời follow-up số 2 trong Speaking Lab 03.
CHẶNG III — CS CẦN ĐÚNG LÚC (KHÔNG NHỒI TOÀN BỘ)
MÔ-ĐUN 04 [CORE] — Database / SQL: từ bảng dữ liệu đến transaction và index
04.1. Khởi đầu thật đơn giản: entity → table
Giả sử có:
Customer(customer_id, email)
Room(room_id, room_type)
Booking(booking_id, customer_id, room_id, check_in, check_out, status)
- Primary key (PK): phân biệt duy nhất từng dòng.
- Foreign key (FK): tham chiếu đến một dòng ở bảng khác.
- 1:N: một Customer có nhiều Booking; mỗi Booking thuộc một Customer.
- N:M: cần bảng liên kết (ví dụ
student_course) nếu nhiều student học nhiều course. - Constraint: dữ liệu phải thoả rule ở tầng DB khi rule có thể biểu diễn tại đó.
MICRO SPEAK V5.2 — sau mục 04.1 · 2 Q&A. Chỉ làm khi đã hiểu ví dụ/code ở ngay phía trên. Mỗi lượt chọn tối đa 4–6 câu; nếu nhiều hơn, chia 2 lượt.
SHADOW: A primary key uniquely identifies each row in a table. (nghe và nhại 2 lần). Sau đó che đáp án, tự trả lời bằng tiếng Anh rồi mới mở mẫu.
FREE SPEAK — định nghĩa / cơ chế (2 câu)
Q030 · FOUNDATION · ADD V5
TTS 059 · Q: What is a primary key?
Mở đáp án mẫu Q030 — sau khi tự trả lời
TTS 060 · A: A primary key uniquely identifies each row in a table. Its value must not be null, and the database enforces uniqueness.
Q031 · FOUNDATION · ADD V5
TTS 061 · Q: What is a foreign key?
Mở đáp án mẫu Q031 — sau khi tự trả lời
TTS 062 · A: A foreign key links a row to a key in another table. It helps the database enforce referential integrity between related records.
DO → TRANSFER: quay lại bài thực hành ngay phía trên; đổi một dữ kiện và giải thích hệ quả bằng tiếng Anh. Ghi một lỗi kiến thức và một lỗi nói.
04.2. SQL từ dễ đến vừa
Dữ liệu ví dụ:
Customers
id | name
1 | An
2 | Binh
3 | Chi
Bookings
id | customer_id | amount | status
10 | 1 | 500 | CONFIRMED
11 | 1 | 700 | CANCELLED
12 | 2 | 400 | CONFIRMED
Bước 1 — lọc: SELECT * FROM bookings WHERE status = 'CONFIRMED';
Bước 2 — JOIN:
SELECT c.name, b.id, b.amount
FROM customers c
JOIN bookings b ON b.customer_id = c.id
WHERE b.status = 'CONFIRMED';
Bước 3 — GROUP BY/HAVING:
SELECT c.id, c.name, SUM(b.amount) AS total_confirmed
FROM customers c
JOIN bookings b ON b.customer_id = c.id
WHERE b.status = 'CONFIRMED'
GROUP BY c.id, c.name
HAVING SUM(b.amount) >= 400;
Thấy gì? WHERE lọc rows trước grouping; HAVING lọc nhóm sau aggregate. LEFT JOIN giữ cả customer không booking; cần hiểu vì sao filter ở WHERE có thể vô tình làm mất những rows NULL phía phải.
5 điều SQL dễ nhầm:
- COUNT(*) đếm rows; COUNT(column) bỏ NULL trong column đó.
- IS NULL thay vì = NULL (SQL three-valued logic).
- UNION loại duplicate; UNION ALL giữ lại.
- INNER JOIN chỉ match; LEFT JOIN giữ tất cả phía trái.
- LIMIT / OFFSET thường đi sau ORDER BY; muốn kết quả ổn định cần sort key xác định.
MICRO SPEAK V5.2 — sau mục 04.2 · 4 Q&A. Chỉ làm khi đã hiểu ví dụ/code ở ngay phía trên. Mỗi lượt chọn tối đa 4–6 câu; nếu nhiều hơn, chia 2 lượt.
SHADOW: An INNER JOIN returns only customers with matching bookings. (nghe và nhại 2 lần). Sau đó che đáp án, tự trả lời bằng tiếng Anh rồi mới mở mẫu.
FREE SPEAK — định nghĩa / cơ chế (4 câu)
Q032 · MECHANISM / WHY · BASE V4
TTS 063 · Q: Explain INNER JOIN versus LEFT JOIN with customer bookings.
Mở đáp án mẫu Q032 — sau khi tự trả lời
TTS 064 · A: An INNER JOIN returns only customers with matching bookings. A LEFT JOIN keeps every customer, even when no booking exists. The booking fields are null for customers without a match.
Q033 · MECHANISM / WHY · ADD V5
TTS 065 · Q: What is the difference between WHERE and HAVING?
Mở đáp án mẫu Q033 — sau khi tự trả lời
TTS 066 · A: WHERE filters rows before grouping. HAVING filters groups after aggregation. For example, I would use HAVING to keep customers whose total spending exceeds a threshold.
Q034 · MECHANISM / WHY · ADD V5
TTS 067 · Q: What is the difference between COUNT(*) and COUNT(column)?
Mở đáp án mẫu Q034 — sau khi tự trả lời
TTS 068 · A: COUNT(*) counts rows, including rows with null values. COUNT(column) counts only rows where that column is not null.
Q035 · MECHANISM / WHY · ADD V5
TTS 069 · Q: What is the difference between UNION and UNION ALL?
Mở đáp án mẫu Q035 — sau khi tự trả lời
TTS 070 · A: UNION removes duplicate rows from the combined result. UNION ALL keeps duplicates and usually avoids the cost of removing them.
DO → TRANSFER: quay lại bài thực hành ngay phía trên; đổi một dữ kiện và giải thích hệ quả bằng tiếng Anh. Ghi một lỗi kiến thức và một lỗi nói.
04.3. Index — vì sao giúp đọc nhưng có thể làm ghi chậm?
Tưởng tượng một cuốn từ điển: index giúp nhảy gần vị trí cần tìm thay vì đọc tuần tự. Nhưng mỗi lần thêm/sửa dữ liệu, cấu trúc index có thể phải cập nhật theo.
Ví dụ truy vấn:
SELECT * FROM bookings WHERE customer_id = 7 ORDER BY created_at DESC;
Có thể xem xét index (customer_id, created_at DESC) tùy workload, query plan và DBMS. Không phải cứ có index là query dùng index. Với bảng nhỏ hoặc filter chọn phần lớn bảng, sequential scan có thể tốt hơn.
Interview answer: An index can speed up eligible reads by reducing unnecessary scanning, but it costs storage and write maintenance. I'd check the query plan and actual workload before adding one.
MICRO SPEAK V5.2 — sau mục 04.3 · 4 Q&A. Chỉ làm khi đã hiểu ví dụ/code ở ngay phía trên. Mỗi lượt chọn tối đa 4–6 câu; nếu nhiều hơn, chia 2 lượt.
SHADOW: Not automatically. (nghe và nhại 2 lần). Sau đó che đáp án, tự trả lời bằng tiếng Anh rồi mới mở mẫu.
FREE SPEAK — định nghĩa / cơ chế (2 câu)
Q036 · FOUNDATION · ADD V5
TTS 071 · Q: What is a database index?
Mở đáp án mẫu Q036 — sau khi tự trả lời
TTS 072 · A: An index is a data structure that helps the database find matching rows efficiently. It can improve reads, but it uses storage and requires maintenance during writes.
Q037 · MECHANISM / WHY · ADD V5
TTS 073 · Q: Why can an index slow down INSERT and UPDATE operations?
Mở đáp án mẫu Q037 — sau khi tự trả lời
TTS 074 · A: The database may need to update one or more indexes when a row changes. That extra work can increase the cost of writes. I would add indexes based on measured query needs.
FOLLOW-UP — case / phản biện (2 câu)
Q038 · SCENARIO / FOLLOW-UP · BASE V4
TTS 075 · Q: Would you add an index on a low-selectivity status column?
Mở đáp án mẫu Q038 — sau khi tự trả lời
TTS 076 · A: Not automatically. If the status column has only a few common values, the index may not help much. I would inspect the execution plan and real query workload first.
Q039 · SCENARIO / FOLLOW-UP · ADD V5
TTS 077 · Q: How would you investigate a slow SQL query that already has an index?
Mở đáp án mẫu Q039 — sau khi tự trả lời
TTS 078 · A: I would inspect the execution plan and measure how many rows the query reads. Then I would check selectivity, join conditions, sorting, and whether the index is actually used.
DO → TRANSFER: quay lại bài thực hành ngay phía trên; đổi một dữ kiện và giải thích hệ quả bằng tiếng Anh. Ghi một lỗi kiến thức và một lỗi nói.
04.4. Transactions / ACID — hình dung trước khi học chữ
Ví dụ chuyển tiền từ tài khoản A sang B: không thể trừ A thành công mà cộng B thất bại rồi dừng mãi. Database transaction giúp quản lý nhiều thao tác thành một đơn vị theo các bảo đảm cụ thể.
- A — Atomicity: all-or-nothing đối với transaction.
- C — Consistency: các ràng buộc/điều kiện đúng được duy trì qua transaction hợp lệ.
- I — Isolation: các transaction concurrent tương tác trong giới hạn isolation level.
- D — Durability: committed data bền theo bảo đảm DB.
Không nhầm: Atomicity không đồng nghĩa Isolation. Transaction không tự bảo vệ mọi business invariant nếu isolation/locking không phù hợp.
04.5. Những bất thường do concurrent transactions
| Hiện tượng | Ví dụ |
|---|---|
| Dirty read | đọc dữ liệu bên khác chưa commit |
| Non-repeatable read | đọc cùng row hai lần, thấy giá trị mới đã commit |
| Phantom | chạy lại query điều kiện, tập rows khác |
| Lost update | hai bên đọc cùng giá trị, ghi đè lẫn nhau |
| Write skew | hai transaction cùng dựa vào một snapshot, cập nhật các rows khác nhau làm hỏng rule chung |
Các isolation levels chuẩn hay gặp: Read Uncommitted → Read Committed → Repeatable Read → Serializable (không coi đây là lời hứa hành vi đồng nhất giữa mọi DBMS; PostgreSQL và MySQL có chi tiết triển khai khác nhau).
Optimistic locking: thường dùng version, cập nhật có điều kiện WHERE id=? AND version=?, phát hiện conflict và xử lý/retry có kiểm soát.
Pessimistic locking: lấy khóa trước khi đọc/sửa critical data, có thể làm tăng contention.
MICRO SPEAK V5.2 — sau mục 04.5 · 4 Q&A. Chỉ làm khi đã hiểu ví dụ/code ở ngay phía trên. Mỗi lượt chọn tối đa 4–6 câu; nếu nhiều hơn, chia 2 lượt.
SHADOW: Atomicity means a transaction succeeds or fails as one unit. (nghe và nhại 2 lần). Sau đó che đáp án, tự trả lời bằng tiếng Anh rồi mới mở mẫu.
FREE SPEAK — định nghĩa / cơ chế (4 câu)
Q040 · MECHANISM / WHY · BASE V4
TTS 079 · Q: What is the difference between atomicity and isolation?
Mở đáp án mẫu Q040 — sau khi tự trả lời
TTS 080 · A: Atomicity means a transaction succeeds or fails as one unit. Isolation describes how concurrent transactions see and affect each other. Both matter, but they solve different problems.
Q041 · FOUNDATION · ADD V5
TTS 081 · Q: What does ACID stand for?
Mở đáp án mẫu Q041 — sau khi tự trả lời
TTS 082 · A: ACID stands for atomicity, consistency, isolation, and durability. These properties describe important guarantees and boundaries of database transactions.
Q042 · MECHANISM / WHY · ADD V5
TTS 083 · Q: What is the difference between a dirty read and a non-repeatable read?
Mở đáp án mẫu Q042 — sau khi tự trả lời
TTS 084 · A: A dirty read sees changes that another transaction has not committed. A non-repeatable read happens when the same row is read twice and its committed value changes between reads.
Q043 · FOUNDATION · ADD V5
TTS 085 · Q: What is a phantom read?
Mở đáp án mẫu Q043 — sau khi tự trả lời
TTS 086 · A: A phantom read happens when repeating a query with the same condition returns a different set of rows because another transaction changed matching rows. The available protections depend on the database and isolation level.
DO → TRANSFER: quay lại bài thực hành ngay phía trên; đổi một dữ kiện và giải thích hệ quả bằng tiếng Anh. Ghi một lỗi kiến thức và một lỗi nói.
04.6. Worked example — hai người cùng đặt một phòng
- Rule: chỉ có một booking hiệu lực cho cùng
room_idvàstay_date. - Data model đơn giản:
booking_nights(room_id, stay_date, booking_id)và ràng buộc unique(room_id, stay_date)cho các nights đã giữ theo mô hình này; trạng thái hủy/giải phóng phải được thiết kế đồng bộ. - Khi tạo booking: xác thực → cố gắng giữ toàn bộ nights trong transaction thích hợp → nếu conflict thì từ chối → commit.
- Nếu nối với nhà cung cấp phòng bên ngoài: local transaction không bao trùm external API; cần điều chỉnh workflow, reconciliation/idempotency và trạng thái pending theo contract của bên ngoài.
- Test: hai requests đồng thời cho cùng room/date → không bao giờ có hai booking active hợp lệ cho cùng đêm.
Đây là một mô hình minh họa, không phải mô hình booking duy nhất hay giải pháp sẵn sàng production.
MICRO SPEAK V5.2 — sau mục 04.6 · 3 Q&A. Chỉ làm khi đã hiểu ví dụ/code ở ngay phía trên. Mỗi lượt chọn tối đa 4–6 câu; nếu nhiều hơn, chia 2 lượt.
SHADOW: A transaction gives atomic behavior, but two transactions can still pass the same availability check. (nghe và nhại 2 lần). Sau đó che đáp án, tự trả lời bằng tiếng Anh rồi mới mở mẫu.
FREE SPEAK — định nghĩa / cơ chế (2 câu)
Q044 · MECHANISM / WHY · BASE V4
TTS 087 · Q: Why is a transaction not always enough to prevent overselling?
Mở đáp án mẫu Q044 — sau khi tự trả lời
TTS 088 · A: A transaction gives atomic behavior, but two transactions can still pass the same availability check. I would use suitable locking, an atomic update, or a database constraint to protect inventory.
Q045 · MECHANISM / WHY · ADD V5
TTS 089 · Q: What is the difference between optimistic and pessimistic locking?
Mở đáp án mẫu Q045 — sau khi tự trả lời
TTS 090 · A: Optimistic locking detects conflicts when updating, often by checking a version value. Pessimistic locking locks data before a conflicting operation can proceed. I would choose based on contention and the cost of retries.
FOLLOW-UP — case / phản biện (1 câu)
Q046 · SCENARIO / FOLLOW-UP · BASE V4
TTS 091 · Q: How would you test a lost update with two requests?
Mở đáp án mẫu Q046 — sau khi tự trả lời
TTS 092 · A: I would run two requests that read and update the same record at nearly the same time. Then I would compare the final value with the expected result and verify that no update was lost.
DO → TRANSFER: quay lại bài thực hành ngay phía trên; đổi một dữ kiện và giải thích hệ quả bằng tiếng Anh. Ghi một lỗi kiến thức và một lỗi nói.
04.7. Tự làm 3 câu SQL ngắn
- Viết SQL lấy mọi customer, kể cả customer chưa booking, cùng tổng số booking.
- Viết SQL lấy customer có tổng confirmed amount > 450.
- Tại sao thêm index lên
status(cột chỉ có 2 giá trị) có thể không giúp query nhanh hơn?
Đáp án SQL
-- 1
SELECT c.id, c.name, COUNT(b.id) AS booking_count
FROM customers c
LEFT JOIN bookings b ON b.customer_id = c.id
GROUP BY c.id, c.name;
-- 2
SELECT c.id, c.name, SUM(b.amount) AS total
FROM customers c
JOIN bookings b ON b.customer_id = c.id
WHERE b.status = 'CONFIRMED'
GROUP BY c.id, c.name
HAVING SUM(b.amount) > 450;
Dữ liệu mẫu: câu 2 chỉ có An (500), vì Binh có 400.
3. Nếu status rất ít giá trị và phần lớn rows match, scan có thể rẻ hơn index lookup + row access. Cần xem thực tế query plan và thống kê.
Checkpoint Mô-đun 04: Giải thích được JOIN vs LEFT JOIN, WHERE vs HAVING, atomicity vs isolation, why index, và xử lý một lost update.
🎙️ SPEAKING LAB V5.2 — 04. SQL, indexes, ACID và locking
Thứ tự sử dụng: PRETEST → WATCH & DO ngay trong phần kiến thức phía trên → LISTEN/SHADOW → FREE SPEAK → FOLLOW-UP → feedback. Không mở đáp án trước lượt nói đầu.
Những ý kỹ thuật phải hiểu trước khi nói: JOIN vs LEFT JOIN; WHERE vs HAVING; index trade-offs; atomicity vs isolation; concurrent updates.
Từ đơn → cụm nói được (chỉ chọn 3–5 cụm để ôn hôm nay):
| Useful chunk | Nghĩa |
|---|---|
filter rows |
lọc các hàng |
group the results |
nhóm kết quả |
inspect the query plan |
xem kế hoạch thực thi |
prevent lost updates |
ngăn cập nhật bị ghi đè |
1. PRETEST + WATCH + DO
Đã được chia nhỏ: 17 cặp Q&A của mô-đun này được đặt sau từng mục lý thuyết ở phía trên (MICRO SPEAK V5.2). Không đọc lại toàn bộ câu hỏi ở đây; chọn 3 câu khó nhất để làm lại không nhìn.
2. LISTEN → SHADOW
A — LISTEN & SHADOW (3–4 phút): Ẩn chữ; dùng TTS/Voice đọc lần lượt các câu sau. Lượt 1 nghe và tóm tắt ý; lượt 2–3 bắt chước nhịp nói, rồi nói lại không nhìn.
- A left join keeps rows from the left table even when there is no match.
- An index can improve reads, but it also adds storage and write costs.
3. COMPLETE ORALLY
B — COMPLETE ORALLY (1–2 phút): Điền bằng giọng nói, không cần viết câu hoàn chỉnh trước.
I would use ___ because . The downside is . To verify it, I would ___.
4. FREE SPEAK + FOLLOW-UP — ôn các micro-lab
Lấy ngẫu nhiên 2 câu cơ chế + 1 câu tình huống đã làm trong các MICRO SPEAK phía trên. Không đọc script; câu nào sai phải sửa kèm một ví dụ/code/test.
Mã câu trong mô-đun: Q032, Q044, Q038, Q040, Q046, Q030, Q031, Q033, Q034, Q035, Q036, Q037, Q039, Q041, Q042, Q043, Q045.
6. REPEAT + FEEDBACK — checkpoint
E — REPEAT + FEEDBACK: Chọn câu khó nhất ở phần FREE SPEAK, nói 3 lượt (45–60 giây → 30–45 giây → 20–30 giây ở L1; tăng thời lượng ở L2), giữ ý chính và một test/example. Mở câu trả lời ngay dưới câu hỏi sau lượt 1; mỗi lượt chỉ sửa tối đa 2 lỗi.
- Thời lượng mục tiêu: L1: 3 câu cho JOIN hoặc index; L2: 60–90 giây về một race/lock/test.
- Điều kiện qua bài: Nêu một query/constraint cụ thể, giải thích trade-off và không tuyệt đối hóa index hay isolation.
- Điểm dễ nói sai / hiểu sai: @Transactional hay ACID không tự động biến một logic check-then-act thành an toàn ở mọi isolation level.
| Self-check (đánh dấu sau khi nói) | Yes/No |
|---|---|
| Tôi giải đúng kiến thức và nêu được ví dụ / failure / test cần thiết | [ ] |
| Tôi hiểu câu hỏi khi nghe, hoặc hỏi lại đúng chỗ | [ ] |
| Tôi tự nói không nhìn script; có mở đầu và kết luận rõ | [ ] |
| Tôi xử lý được ít nhất 1 follow-up mới | [ ] |
Mẫu trả lời dài V4 (tùy chọn; xem sau khi tự nói)
Show sample only after speaking
One possible answer (~40–90 words):
An inner join returns matching rows, while a left join keeps all customers, including those without bookings. For concurrency, a transaction provides atomicity, but we still need appropriate isolation or locking to protect the inventory rule. I would use a database constraint or an atomic conditional update, and test two concurrent booking requests against the last room.
Knowledge guardrail: @Transactional hay ACID không tự động biến một logic check-then-act thành an toàn ở mọi isolation level.
Reverse recall: Che sample; nói lại bằng từ của mình rồi trả lời follow-up số 2 trong Speaking Lab 04.
MÔ-ĐUN 05 [CORE] — Network / HTTP: một request chạy từ trình duyệt đến backend thế nào?
05.1. Luồng thực tế
User enters https://example.com
↓
DNS lookup (tìm thông tin IP của hostname, có thể qua cache)
↓
Connect (thường TCP; HTTP/3 dùng QUIC/UDP)
↓
TLS handshake (nếu HTTPS)
↓
HTTP request → reverse proxy / backend
↓
Application xử lý → DB / external APIs
↓
HTTP response → browser render
Mấu chốt: DNS khác HTTP; TCP cung cấp luồng byte có độ tin cậy/thứ tự; TLS bảo vệ kết nối; HTTPS là HTTP qua TLS. HTTP là stateless theo ngữ nghĩa giao thức, nhưng ứng dụng có thể quản lý session/cookies/tokens.
05.2. HTTP methods và response codes
| Cần làm | Cách thường dùng | Ghi chú |
|---|---|---|
| Lấy booking | GET /bookings/{id} |
GET safe/idempotent theo HTTP semantics |
| Tạo booking | POST /bookings |
POST không mặc định idempotent; có thể thêm idempotency key |
| Thay toàn bộ resource | PUT /bookings/{id} |
PUT idempotent về hiệu ứng mong đợi |
| Sửa một phần | PATCH /bookings/{id} |
không mặc định idempotent |
| Xoá / hủy theo API contract | DELETE /bookings/{id} |
DELETE idempotent theo HTTP semantics; business cancellation có thể dùng action riêng |
| Code | Dùng khi |
|---|---|
200 OK |
thành công và thường có body |
201 Created |
tạo resource |
204 No Content |
thành công, không có body |
400 Bad Request |
request sai cú pháp/validation theo API |
401 Unauthorized |
thiếu/xác thực không hợp lệ |
403 Forbidden |
có thể xác thực nhưng không đủ quyền |
404 Not Found |
không tìm thấy resource |
409 Conflict |
mâu thuẫn trạng thái (ví dụ phòng đã hết) |
429 Too Many Requests |
vượt rate limit |
500 Internal Server Error |
lỗi backend không xử lý được |
502/503/504 |
gateway error / service unavailable / gateway timeout (tùy vai trò) |
05.3. Timeout và retry: câu hỏi hay gặp
- Connection timeout: không kết nối được trong giới hạn thời gian.
- Read/response timeout: đã kết nối nhưng không nhận được phản hồi kịp lúc.
- Retry: thử lại, không mặc định an toàn cho yêu cầu tạo booking/thanh toán.
- Idempotency key: client dùng cùng key khi retry; server lưu kết quả/operation và ngăn thực thi lặp ngoài ý muốn.
- Exponential backoff: tăng thời gian chờ giữa các lần retry, nên kèm jitter trong hệ phân tán thực tế.
Bẫy quan trọng: khi client timeout, ta không biết chắc server đã hoàn thành thao tác hay chưa. Không được suy luận “timeout ⇒ booking chưa được tạo”.
05.4. Mạng nền tảng — chỉ ghi nhớ vừa đủ
- IP: địa chỉ tầng mạng; MAC: địa chỉ ở link-local network.
- Switch / router: chuyển frame trong LAN / định tuyến giữa các mạng (mô hình đơn giản).
- TCP / UDP: TCP có cơ chế reliable ordered stream; UDP là datagram không tự bảo đảm các tính chất đó.
- OSI 7 tầng: Physical → Data Link → Network → Transport → Session → Presentation → Application.
- NAT: chuyển đổi địa chỉ; CORS là cơ chế trình duyệt điều tiết truy cập cross-origin, không thay cho authorization.
- Serialization / deserialization: chuyển object thành dạng truyền/lưu trữ như JSON và ngược lại.
Tự trả lời: A customer clicks Book. The browser times out. Should we retry automatically?
Đáp án mẫu
We should not blindly retry a non-idempotent booking operation. The server may have created the booking even if the response was lost. I'd use an idempotency key and provide a way to retrieve the existing booking status before creating a duplicate.
🎙️ SPEAKING LAB V5.2 — 05. HTTP request, timeout và retry
Thứ tự sử dụng: PRETEST → WATCH & DO ngay trong phần kiến thức phía trên → LISTEN/SHADOW → FREE SPEAK → FOLLOW-UP → feedback. Không mở đáp án trước lượt nói đầu.
Những ý kỹ thuật phải hiểu trước khi nói: DNS, connection, TLS, request/response; HTTP semantics; timeout uncertainty; idempotency.
Từ đơn → cụm nói được (chỉ chọn 3–5 cụm để ôn hôm nay):
| Useful chunk | Nghĩa |
|---|---|
resolve the hostname |
phân giải tên miền |
send an HTTP request |
gửi yêu cầu HTTP |
time out |
hết thời gian chờ |
retry safely |
thử lại an toàn |
1. PRETEST + WATCH + DO
Hoàn thành ít nhất một bài COMPLETE/DO ở phía trên (hoặc giải thích một ví dụ mới). Nếu chưa giải thích được cơ chế bằng tiếng Việt, quay lại bài kỹ thuật trước khi bắt đầu nói.
2. LISTEN → SHADOW
A — LISTEN & SHADOW (3–4 phút): Ẩn chữ; dùng TTS/Voice đọc lần lượt các câu sau. Lượt 1 nghe và tóm tắt ý; lượt 2–3 bắt chước nhịp nói, rồi nói lại không nhìn.
- A response timeout does not prove that the server failed.
- The client should reuse an idempotency key when retrying the operation.
3. COMPLETE ORALLY
B — COMPLETE ORALLY (1–2 phút): Điền bằng giọng nói, không cần viết câu hoàn chỉnh trước.
First, the browser . Then the backend . If the request times out, ___.
4. FREE SPEAK — định nghĩa / cơ chế (không nhìn script)
Chọn 3–5 câu/lượt trong 9 câu sau. Đáp án được thu gọn dưới từng câu; chỉ mở sau khi đã nói.
Q047 · MECHANISM / WHY · BASE V4
TTS 093 · Q: Walk me through an HTTPS request from browser to backend.
Mở đáp án mẫu Q047 — sau khi tự trả lời
TTS 094 · A: First, the browser resolves the domain name and establishes a secure connection. Then it sends an HTTPS request. The backend processes it and returns an HTTP response.
Q048 · MECHANISM / WHY · BASE V4
TTS 095 · Q: What is the difference between HTTP 401 and 403?
Mở đáp án mẫu Q048 — sau khi tự trả lời
TTS 096 · A: HTTP 401 means the request does not have valid authentication. HTTP 403 means the server understands the request but refuses access, even when the user may be authenticated.
Q049 · FOUNDATION · BASE V4
TTS 097 · Q: Should a client automatically retry a booking POST after a timeout?
Mở đáp án mẫu Q049 — sau khi tự trả lời
TTS 098 · A: Not blindly. A timeout does not prove that the operation failed. I would retry only with a safe strategy, such as an idempotency key, and check the booking status.
Q050 · MECHANISM / WHY · ADD V5
TTS 099 · Q: What is the difference between GET and POST?
Mở đáp án mẫu Q050 — sau khi tự trả lời
TTS 100 · A: GET is intended to retrieve a representation without causing requested business side effects. POST submits data for processing and can create or change server state. A POST is not automatically safe to retry.
Q051 · MECHANISM / WHY · ADD V5
TTS 101 · Q: What is the difference between PUT and PATCH?
Mở đáp án mẫu Q051 — sau khi tự trả lời
TTS 102 · A: PUT generally replaces the target resource representation according to the API contract. PATCH applies a partial change. I would check the API's documented semantics instead of assuming every update is idempotent.
Q052 · FOUNDATION · ADD V5
TTS 103 · Q: What do HTTP 200, 201, and 204 mean?
Mở đáp án mẫu Q052 — sau khi tự trả lời
TTS 104 · A: 200 means the request succeeded and usually includes a response representation. 201 indicates a resource was created. 204 means the request succeeded without response content.
Q053 · FOUNDATION · ADD V5
TTS 105 · Q: What do HTTP 400, 404, 409, and 500 mean?
Mở đáp án mẫu Q053 — sau khi tự trả lời
TTS 106 · A: 400 means the request is invalid, and 404 means the resource was not found. 409 indicates a conflict with the current resource state. 500 indicates an unexpected server-side error.
Q054 · MECHANISM / WHY · ADD V5
TTS 107 · Q: What is the difference between a timeout and a connection refusal?
Mở đáp án mẫu Q054 — sau khi tự trả lời
TTS 108 · A: A timeout means the expected operation or response did not complete within the allowed time. A connection refusal means the connection attempt was actively rejected. Neither result alone proves whether an earlier request committed.
Q055 · MECHANISM / WHY · ADD V5
TTS 109 · Q: Why is an idempotency key useful for a payment or booking API?
Mở đáp án mẫu Q055 — sau khi tự trả lời
TTS 110 · A: A client can reuse the same key when retrying one logical operation. The server can recognize the request and return its earlier result without repeating the side effect. This requires a reliable server-side implementation.
5. UNEXPECTED FOLLOW-UP — thay giả định và suy luận
Chọn ít nhất một câu dưới đây, tự trả lời trước; sau đó yêu cầu người luyện thay một điều kiện mới.
Q056 · SCENARIO / FOLLOW-UP · BASE V4
TTS 111 · Q: What if the first response is lost after a successful commit?
Mở đáp án mẫu Q056 — sau khi tự trả lời
TTS 112 · A: The server may have committed the booking even though the client saw a timeout. I would use the same idempotency key or operation ID to retrieve the earlier result and avoid duplicates.
Q057 · SCENARIO / FOLLOW-UP · BASE V4
TTS 113 · Q: How would you expose the status of an uncertain operation?
Mở đáp án mẫu Q057 — sau khi tự trả lời
TTS 114 · A: I would return a stable operation ID and expose a status endpoint. The client could check whether the operation is pending, successful, failed, or still unknown.
6. REPEAT + FEEDBACK — checkpoint
E — REPEAT + FEEDBACK: Chọn câu khó nhất ở phần FREE SPEAK, nói 3 lượt (45–60 giây → 30–45 giây → 20–30 giây ở L1; tăng thời lượng ở L2), giữ ý chính và một test/example. Mở câu trả lời ngay dưới câu hỏi sau lượt 1; mỗi lượt chỉ sửa tối đa 2 lỗi.
- Thời lượng mục tiêu: L1: 30 giây request flow; L2: 60–90 giây timeout → duplicate risk → mitigation.
- Điều kiện qua bài: Biết phân biệt network timeout với kết quả nghiệp vụ; có phương án idempotency/status lookup.
- Điểm dễ nói sai / hiểu sai: Timeout không suy ra “server failed”; POST không tự động idempotent.
| Self-check (đánh dấu sau khi nói) | Yes/No |
|---|---|
| Tôi giải đúng kiến thức và nêu được ví dụ / failure / test cần thiết | [ ] |
| Tôi hiểu câu hỏi khi nghe, hoặc hỏi lại đúng chỗ | [ ] |
| Tôi tự nói không nhìn script; có mở đầu và kết luận rõ | [ ] |
| Tôi xử lý được ít nhất 1 follow-up mới | [ ] |
Mẫu trả lời dài V4 (tùy chọn; xem sau khi tự nói)
Show sample only after speaking
One possible answer (~40–90 words):
The browser resolves the hostname, establishes a secure connection, and sends an HTTP request. The backend processes the request and returns a response. If a booking request times out, the operation may still have succeeded. I would avoid a blind retry. Instead, I would reuse an idempotency key and let the client check the booking status.
Knowledge guardrail: Timeout không suy ra “server failed”; POST không tự động idempotent.
Reverse recall: Che sample; nói lại bằng từ của mình rồi trả lời follow-up số 2 trong Speaking Lab 05.
MÔ-ĐUN 06 [CORE] — OS + JVM + concurrency: vì sao hệ thống có thể sai khi nhiều request cùng đến?
06.1. Process, thread và bộ nhớ — giải thích bằng mô hình
- Process: một chương trình đang chạy, thường có không gian địa chỉ ảo được cách ly với process khác.
- Thread: luồng thực thi bên trong process; các threads cùng process dùng chung nhiều vùng dữ liệu, nhưng mỗi thread có call stack riêng.
- Concurrency: nhiều công việc tiến triển chồng lấn về thời gian.
- Parallelism: các công việc thực sự chạy đồng thời trên nhiều đơn vị xử lý.
Java process / JVM
├─ Heap: objects được các threads cùng truy cập
├─ Thread A → call stack A
└─ Thread B → call stack B
Ví dụ: hai HTTP requests cùng gọi reserveLastRoom(). Nếu logic chỉ “đọc số phòng = 1 → cả hai cùng ghi lại = 0”, có thể xác nhận hai booking khi chỉ còn một phòng. Đây là vấn đề read–modify–write / race condition.
06.2. Race condition, atomicity và bảo vệ invariant
Invariant = điều luôn phải đúng, ví dụ: availableRooms >= 0, hoặc “cùng một phòng không được bán hai lần cho cùng một đêm”.
Sai (mô hình giả):
Request A: READ available=1
Request B: READ available=1
Request A: WRITE available=0 → success
Request B: WRITE available=0 → success
Ý tưởng đúng: thao tác dành phòng phải được kiểm soát tại nguồn dữ liệu có thẩm quyền, ví dụ:
UPDATE room_inventory
SET available = available - 1
WHERE room_type_id = :id AND stay_date = :date AND available > 0;
Chỉ coi bước giữ chỗ thành công khi số dòng cập nhật đúng kỳ vọng. Với booking nhiều đêm, phải xử lý tất cả các đêm như một đơn vị giao dịch phù hợp, không chỉ một dòng; kiểm tra điều kiện, transaction, và ranh giới giữa DB nội bộ / hệ thống bên ngoài phải được thiết kế cụ thể. Không khẳng định chỉ một câu SQL là đủ cho mọi booking system.
Phân biệt: Java synchronized bảo vệ truy cập trong một JVM; không đủ nếu chạy nhiều instances hoặc dữ liệu nằm ở external service. Database constraints, transactions/locks hoặc concurrency control phù hợp thường cần thiết.
06.3. Deadlock là gì?
- Race condition: kết quả sai vì thứ tự thực thi không kiểm soát.
- Deadlock: A giữ tài nguyên X chờ Y, B giữ Y chờ X, không bên nào tiến được.
- Starvation: một task liên tục bị trì hoãn do thiếu công bằng.
- Livelock: các task vẫn thay đổi trạng thái nhưng không tiến bộ.
Bốn điều kiện Coffman thường được nhắc trong OS deadlock: mutual exclusion, hold-and-wait, no preemption, circular wait. Không cần học thuật toán Banker nâng cao ở giai đoạn này.
06.4. CPU scheduling: chỉ phần đủ đọc MCQ
| Thuật ngữ | Trực giác | Nhớ nhanh |
|---|---|---|
| FCFS | ai đến trước chạy trước | order of arrival |
| SJF | việc ngắn trước | có thể khiến job dài chờ lâu |
| Round Robin | mỗi job một lát CPU | time quantum |
| Priority | ưu tiên cao được chọn | starvation nếu không điều tiết |
| Preemptive | có thể ngắt để chuyển CPU | khác non-preemptive |
| Turnaround time | từ lúc đến đến lúc hoàn tất | completion − arrival |
| Waiting time | thời gian chờ trong ready queue | không giống turnaround |
| Context switch | CPU đổi context thực thi | có overhead |
06.5. Java Memory / GC ở mức entry-level
- JDK: bộ công cụ phát triển Java; JVM: môi trường thực thi bytecode; JRE: runtime terminology (trong hệ Java hiện đại không nhất thiết được phân phối riêng).
- Stack theo lời gọi method; heap chứa objects (mô hình JVM điển hình); local variable có thể chứa reference dẫn tới object trên heap.
- GC dọn objects không còn reachable, không có nghĩa Java không thể memory leak.
OutOfMemoryErrorkhácStackOverflowError: không đủ bộ nhớ cho yêu cầu cấp phát vs stack của luồng bị tràn (ví dụ recursion không dừng).volatilechủ yếu liên quan visibility/order, không làmcounter++thành atomic.synchronized/ locks: điều phối truy cập shared state trong JVM; transaction DB: bảo vệ dữ liệu và rules ở database với phạm vi bảo đảm do DB quyết định.
Câu hỏi phỏng vấn: What is the difference between a process and a thread?
A process has its own virtual address space, while threads within one process share many resources, including heap objects. Each thread has its own execution stack. Shared state requires care because concurrent access can cause race conditions.
Bài biến thể — không xem gợi ý: Hai requests tăng viewCount bằng count = count + 1. Vì sao kết quả đôi khi tăng chỉ 1?
Gợi ý và đáp án
Cả hai có thể đọc cùng giá trị cũ rồi cùng ghi giá trị mới. Đây là lost update. Có thể dùng atomic update ở DB (SET count = count + 1) hoặc các cơ chế đồng bộ/locking phù hợp nơi state được quản lý. Không dùng volatile int đơn thuần để bảo đảm increment atomic.
🎙️ SPEAKING LAB V5.2 — 06. Threads, shared state và race conditions
Thứ tự sử dụng: PRETEST → WATCH & DO ngay trong phần kiến thức phía trên → LISTEN/SHADOW → FREE SPEAK → FOLLOW-UP → feedback. Không mở đáp án trước lượt nói đầu.
Những ý kỹ thuật phải hiểu trước khi nói: Process vs thread; heap/stack; concurrency vs parallelism; race; deadlock; synchronized vs DB.
Từ đơn → cụm nói được (chỉ chọn 3–5 cụm để ôn hôm nay):
| Useful chunk | Nghĩa |
|---|---|
share mutable state |
dùng chung dữ liệu có thể thay đổi |
read the same value |
đọc cùng một giá trị |
overwrite an update |
ghi đè một cập nhật |
coordinate concurrent access |
điều phối truy cập đồng thời |
1. PRETEST + WATCH + DO
Hoàn thành ít nhất một bài COMPLETE/DO ở phía trên (hoặc giải thích một ví dụ mới). Nếu chưa giải thích được cơ chế bằng tiếng Việt, quay lại bài kỹ thuật trước khi bắt đầu nói.
2. LISTEN → SHADOW
A — LISTEN & SHADOW (3–4 phút): Ẩn chữ; dùng TTS/Voice đọc lần lượt các câu sau. Lượt 1 nghe và tóm tắt ý; lượt 2–3 bắt chước nhịp nói, rồi nói lại không nhìn.
- Two threads may read the same counter value before either one writes.
- A Java lock does not protect shared database state across multiple application instances.
3. COMPLETE ORALLY
B — COMPLETE ORALLY (1–2 phút): Điền bằng giọng nói, không cần viết câu hoàn chỉnh trước.
A race condition can happen when . Both requests . I would protect ___.
4. FREE SPEAK — định nghĩa / cơ chế (không nhìn script)
Chọn 3–5 câu/lượt trong 10 câu sau. Đáp án được thu gọn dưới từng câu; chỉ mở sau khi đã nói.
Q058 · MECHANISM / WHY · BASE V4
TTS 115 · Q: What is the difference between a process and a thread?
Mở đáp án mẫu Q058 — sau khi tự trả lời
TTS 116 · A: A process has its own address space and resources. Threads within one process share heap objects, but each thread has its own execution stack. This makes communication easier but creates shared-state risks.
Q059 · MECHANISM / WHY · BASE V4
TTS 117 · Q: Why can count++ lose increments under concurrent requests?
Mở đáp án mẫu Q059 — sau khi tự trả lời
TTS 118 · A: The increment is a read, an addition, and a write. Two threads may read the same old value and write the same new value. This can lose one increment.
Q060 · MECHANISM / WHY · BASE V4
TTS 119 · Q: Why might synchronized be insufficient in a multi-instance backend?
Mở đáp án mẫu Q060 — sau khi tự trả lời
TTS 120 · A: Synchronized protects threads sharing the same lock inside one application instance. Two backend instances do not share that Java lock. I would protect shared database state at the database level.
Q061 · FOUNDATION · BASE V4
TTS 121 · Q: Does volatile make count++ atomic?
Mở đáp án mẫu Q061 — sau khi tự trả lời
TTS 122 · A: No. Volatile helps with visibility, but count plus plus is still a compound operation. I would use an atomic counter or proper synchronization for an in-memory value.
Q062 · FOUNDATION · ADD V5
TTS 123 · Q: What is a race condition?
Mở đáp án mẫu Q062 — sau khi tự trả lời
TTS 124 · A: A race condition happens when the result depends on the timing of concurrent operations. For example, two threads may read the same stock value and both attempt to sell the last item.
Q063 · FOUNDATION · ADD V5
TTS 125 · Q: What is a deadlock?
Mở đáp án mẫu Q063 — sau khi tự trả lời
TTS 126 · A: A deadlock happens when operations wait for resources held by one another and none can progress. I would reduce inconsistent lock ordering and use suitable timeouts or deadlock detection.
Q064 · MECHANISM / WHY · ADD V5
TTS 127 · Q: What is the difference between concurrency and parallelism?
Mở đáp án mẫu Q064 — sau khi tự trả lời
TTS 128 · A: Concurrency means several tasks make progress during overlapping periods. Parallelism means tasks execute at the same time on different processing resources.
Q065 · MECHANISM / WHY · ADD V5
TTS 129 · Q: What is the difference between a thread's stack and the JVM heap?
Mở đáp án mẫu Q065 — sau khi tự trả lời
TTS 130 · A: Each Java thread has its own execution stack for frames and local execution state. Objects are generally allocated on the heap, which threads may share. Shared mutable objects need careful coordination.
Q066 · MECHANISM / WHY · ADD V5
TTS 131 · Q: What is the difference between synchronized and ReentrantLock?
Mở đáp án mẫu Q066 — sau khi tự trả lời
TTS 132 · A: Both can protect critical sections inside one JVM. ReentrantLock offers features such as timed lock attempts and interruptible lock acquisition. Neither automatically coordinates separate backend instances.
Q067 · FOUNDATION · ADD V5
TTS 133 · Q: What can cause memory leaks in a Java application even with garbage collection?
Mở đáp án mẫu Q067 — sau khi tự trả lời
TTS 134 · A: An application can keep references to objects that are no longer needed. For example, an unbounded cache or a static collection may keep growing. Garbage collection cannot reclaim objects that remain reachable.
5. UNEXPECTED FOLLOW-UP — thay giả định và suy luận
Chọn ít nhất một câu dưới đây, tự trả lời trước; sau đó yêu cầu người luyện thay một điều kiện mới.
Q068 · SCENARIO / FOLLOW-UP · BASE V4
TTS 135 · Q: When would you choose an atomic SQL update over an in-memory lock?
Mở đáp án mẫu Q068 — sau khi tự trả lời
TTS 136 · A: I would choose an atomic SQL update when multiple application instances change the same database record. A local Java lock cannot coordinate all those instances.
6. REPEAT + FEEDBACK — checkpoint
E — REPEAT + FEEDBACK: Chọn câu khó nhất ở phần FREE SPEAK, nói 3 lượt (45–60 giây → 30–45 giây → 20–30 giây ở L1; tăng thời lượng ở L2), giữ ý chính và một test/example. Mở câu trả lời ngay dưới câu hỏi sau lượt 1; mỗi lượt chỉ sửa tối đa 2 lỗi.
- Thời lượng mục tiêu: L1: process/thread 30 giây; L2: 60–90 giây diễn giải race từng bước và cách bảo vệ.
- Điều kiện qua bài: Không nhầm visibility với atomicity, và hiểu phạm vi lock trong JVM so với DB.
- Điểm dễ nói sai / hiểu sai: Concurrency không nhất thiết là parallelism; volatile không thay thế atomic operation.
| Self-check (đánh dấu sau khi nói) | Yes/No |
|---|---|
| Tôi giải đúng kiến thức và nêu được ví dụ / failure / test cần thiết | [ ] |
| Tôi hiểu câu hỏi khi nghe, hoặc hỏi lại đúng chỗ | [ ] |
| Tôi tự nói không nhìn script; có mở đầu và kết luận rõ | [ ] |
| Tôi xử lý được ít nhất 1 follow-up mới | [ ] |
Mẫu trả lời dài V4 (tùy chọn; xem sau khi tự nói)
Show sample only after speaking
One possible answer (~40–90 words):
Threads in one process share many resources, including heap objects, but each thread has its own execution stack. With count++, two threads can read the same value and overwrite each other, so one increment is lost. Volatile does not make that compound operation atomic. For data shared across multiple backend instances, I would consider an authoritative database update or suitable database locking.
Knowledge guardrail: Concurrency không nhất thiết là parallelism; volatile không thay thế atomic operation.
Reverse recall: Che sample; nói lại bằng từ của mình rồi trả lời follow-up số 2 trong Speaking Lab 06.
CHẶNG IV — GHÉP LLD, TESTING VÀ THIẾT KẾ HỆ THỐNG
MÔ-ĐUN 07 [CORE] — LLD bước 2: Hotel Booking + states + concurrency
Mục tiêu: ghép những khối ở Mô-đun 03 thành một design có tính “interview-ready”.
07.1. Đề bài và cách khoanh phạm vi
Design a hotel booking module. Customers can request a room, staff can approve it, and customers can cancel before check-in.
Hỏi interviewer 4 điều trước: booking có thanh toán không? xác định theo phòng vật lý hay loại phòng? inventory lấy local DB hay external provider? quy tắc cancel cụ thể?
Giả định để học: 1 booking = 1 phòng vật lý cho nhiều đêm; xác nhận cần staff approval; payment chưa nằm trong MVP; inventory chỉ quản lý local DB. Khi đề thay đổi, nói lại assumption.
07.2. Các entities bắt buộc trước khi nghĩ tới class code
| Entity | Field quan trọng | Tại sao cần |
|---|---|---|
| Customer | id, email | chủ booking |
| Room | id, roomType, active | phòng được đặt |
| Booking | id, customerId, roomId, checkIn, checkOut, status | yêu cầu và vòng đời |
| BookingNight / InventoryHold | roomId, date, bookingId, holdState | chống giữ trùng một đêm tùy mô hình |
| BookingAudit | bookingId, action, actorId, occurredAt | truy nguyên thay đổi [PLUS] |
Rule: dùng khoảng ngày [checkIn, checkOut), tức check-out date không tính là một đêm lưu trú; muốn đặt 20→22 thì giữ đêm 20 và 21.
07.3. State machine
PENDING --staff approves--> CONFIRMED
| |
| staff rejects | customer cancels (if allowed)
v v
REJECTED CANCELLED
CONFIRMED --stay completed--> COMPLETED
Một số nghiệp vụ yêu cầu hold inventory ngay khi PENDING, một số chỉ giữ khi CONFIRMED; đây là trade-off cần làm rõ, không đoán. Nếu PENDING giữ phòng, phải có chính sách hết hạn hold.
Đề kiểm tra: CANCELLED → CONFIRMED có hợp lệ? Không trong state machine đang giả định; muốn cho phép khôi phục phải thiết kế thêm rule riêng.
07.4. API contract cho MVP
POST /api/bookings tạo request
GET /api/bookings/{id} xem trạng thái
POST /api/bookings/{id}/approve staff approval
POST /api/bookings/{id}/reject staff rejection
POST /api/bookings/{id}/cancel cancel theo chính sách
Vì approve là một state transition có side effect, nên endpoint hành động có thể được chọn rõ ràng thay vì ép tất cả thành PUT/DELETE. Status codes: 201 mới tạo; 200/204 hành động thành công; 400 input sai; 401/403 auth; 404 không tìm thấy; 409 trạng thái không hợp lệ hoặc inventory conflict.
07.5. Các classes và đường đi request
BookingController
↓
BookingService
├─ BookingPolicy (state transitions, cancellation rules)
├─ InventoryReservationService (atomic allocation)
├─ BookingRepository
└─ NotificationPort (không để email failure tự quyết định DB transaction)
Phỏng vấn viên hỏi: “Why do you need BookingPolicy?”
It keeps business rules separate from HTTP handling and persistence. For example, it checks whether cancellation is allowed based on the booking status and check-in date.
07.6. Worked sequence — booking phòng cuối
Customer → API: POST booking with room/date + idempotency key
API → Service: validate input, identity, date range
Service → DB transaction: check/allocate every required night with conflict protection
DB → Service: success OR conflict
Service → DB: create Booking + status; commit
Service → API: created booking ID/status
API → Customer: 201
Nếu client timeout rồi retry bằng cùng idempotency key, service nên trả/tra lại kết quả phù hợp mà không tạo booking thứ hai. Key phải có scope, request fingerprint/expiry và chính sách concurrent duplicate requests rõ ràng.
Lỗi hay mắc: “Tôi check available=true rồi insert booking” nhưng quên rằng hai request có thể cùng đọc available=true. Kiểm tra logic trên Java trước insert không đủ khi concurrent operations.
07.7. Bài tập biến thể, giảm gợi ý
Đề: Add a waiting list when rooms are fully booked. If a reservation is cancelled, notify the next eligible customer.
Hãy tự điền: 1. Entity mới? ___ 2. State mới? ___ 3. Ai được vào waitlist? ___ 4. Nếu email notification fails? ___ 5. Nếu hai phòng cùng trống? ___ 6. Một test concurrent? ___
Đáp án tham khảo (không có một design duy nhất)
WaitlistEntry(id, customerId, roomType, dateRange, createdAt, status).WAITING → OFFERED → ACCEPTED / EXPIRED / DECLINED.- Rule về quyền, chính sách trùng danh sách và thứ tự ưu tiên phải xác nhận.
- Ghi nhận trạng thái và retry delivery; không phụ thuộc email được gửi đúng một lần.
- Quyết định allocation dưới transaction/constraint tránh cấp hai offers không hợp lệ; quy tắc ưu tiên do khách hàng quy định.
- Hai workers cùng xử lý một waitlist entry, chỉ một chuyển
WAITING → OFFEREDthành công.
07.8. Checklist LLD khi đi phỏng vấn
- [ ] Hỏi lại requirement; nêu assumptions.
- [ ] Actor và use cases rõ.
- [ ] Entities, PK/FK, relationships.
- [ ] State transitions và business invariants.
- [ ] API contract + validation/status codes.
- [ ] Controller/Service/Repository responsibilities.
- [ ] Happy path + 2 failures + 1 concurrent case.
- [ ] Vì sao chọn design, có thể đơn giản hơn không?
- [ ] Trình bày ít nhất 60 giây bằng tiếng Anh.
🎙️ SPEAKING LAB V5.2 — 07. Hotel Booking LLD + state machine
Thứ tự sử dụng: PRETEST → WATCH & DO ngay trong phần kiến thức phía trên → LISTEN/SHADOW → FREE SPEAK → FOLLOW-UP → feedback. Không mở đáp án trước lượt nói đầu.
Những ý kỹ thuật phải hiểu trước khi nói: Actors; booking nights; PENDING/CONFIRMED/CANCELLED; atomic allocation; idempotent retries.
Từ đơn → cụm nói được (chỉ chọn 3–5 cụm để ôn hôm nay):
| Useful chunk | Nghĩa |
|---|---|
reserve each night |
giữ chỗ cho từng đêm |
approve a pending booking |
duyệt booking chờ |
invalid state transition |
chuyển trạng thái không hợp lệ |
avoid double booking |
tránh đặt trùng phòng |
1. PRETEST + WATCH + DO
Hoàn thành ít nhất một bài COMPLETE/DO ở phía trên (hoặc giải thích một ví dụ mới). Nếu chưa giải thích được cơ chế bằng tiếng Việt, quay lại bài kỹ thuật trước khi bắt đầu nói.
2. LISTEN → SHADOW
A — LISTEN & SHADOW (3–4 phút): Ẩn chữ; dùng TTS/Voice đọc lần lượt các câu sau. Lượt 1 nghe và tóm tắt ý; lượt 2–3 bắt chước nhịp nói, rồi nói lại không nhìn.
- I would model booking states explicitly and validate each transition.
- Inventory allocation must protect every required night from concurrent conflicts.
3. COMPLETE ORALLY
B — COMPLETE ORALLY (1–2 phút): Điền bằng giọng nói, không cần viết câu hoàn chỉnh trước.
I assume ___ and . The booking starts in . I would prevent double booking by ___.
4. FREE SPEAK — định nghĩa / cơ chế (không nhìn script)
Chọn 3–5 câu/lượt trong 3 câu sau. Đáp án được thu gọn dưới từng câu; chỉ mở sau khi đã nói.
Q069 · FOUNDATION · BASE V4
TTS 137 · Q: Design a booking module where staff must approve requests.
Mở đáp án mẫu Q069 — sau khi tự trả lời
TTS 138 · A: I would model Customer, Room, Booking, and nightly inventory. A new booking can start in PENDING and move to CONFIRMED after staff approval. I would validate permissions and state transitions.
Q070 · MECHANISM / WHY · BASE V4
TTS 139 · Q: Should pending bookings hold inventory? What is the trade-off?
Mở đáp án mẫu Q070 — sau khi tự trả lời
TTS 140 · A: It depends on the business policy. Holding inventory protects pending requests but can block other customers. Not holding it improves availability but means approval may fail later.
Q071 · FOUNDATION · ADD V5
TTS 141 · Q: What is a state transition in a booking system?
Mở đáp án mẫu Q071 — sau khi tự trả lời
TTS 142 · A: A state transition changes a booking from one allowed state to another. For example, staff approval may move PENDING to CONFIRMED. I would reject transitions that violate the agreed business policy.
5. UNEXPECTED FOLLOW-UP — thay giả định và suy luận
Chọn ít nhất một câu dưới đây, tự trả lời trước; sau đó yêu cầu người luyện thay một điều kiện mới.
Q072 · SCENARIO / FOLLOW-UP · BASE V4
TTS 143 · Q: How do you handle two requests for the same room and night?
Mở đáp án mẫu Q072 — sau khi tự trả lời
TTS 144 · A: I would protect room-night allocation in the database, not just with an application pre-check. A constraint or suitable transaction and lock should prevent overlapping allocations. I would test concurrent requests.
Q073 · SCENARIO / FOLLOW-UP · BASE V4
TTS 145 · Q: What changes if a customer can cancel before check-in?
Mở đáp án mẫu Q073 — sau khi tự trả lời
TTS 146 · A: I would clarify the cancellation deadline and refund policy. Then I would allow valid state transitions and release reserved nights when the business rules require it.
Q074 · SCENARIO / FOLLOW-UP · BASE V4
TTS 147 · Q: What if a booking contains multiple nights and allocation fails halfway through?
Mở đáp án mẫu Q074 — sau khi tự trả lời
TTS 148 · A: I would keep allocation for all required nights in one suitable database transaction when possible. If any night fails, I would roll back the local allocation and return a conflict.
Q075 · SCENARIO / FOLLOW-UP · ADD V5
TTS 149 · Q: How would you prevent double booking for overlapping date ranges?
Mở đáp án mẫu Q075 — sau khi tự trả lời
TTS 150 · A: I would define precisely which bookings reserve inventory and which dates are included. Then I would use a database allocation model and suitable constraints or locking. I would test overlapping and adjacent date ranges concurrently.
Q076 · SCENARIO / FOLLOW-UP · ADD V5
TTS 151 · Q: What happens if an external hotel provider confirms a room but our database update fails?
Mở đáp án mẫu Q076 — sau khi tự trả lời
TTS 152 · A: I would treat the operation as inconsistent until its status is reconciled. A local transaction cannot undo the provider's confirmation automatically. I would record operation identifiers and use an agreed compensation or support workflow.
6. REPEAT + FEEDBACK — checkpoint
E — REPEAT + FEEDBACK: Chọn câu khó nhất ở phần FREE SPEAK, nói 3 lượt (45–60 giây → 30–45 giây → 20–30 giây ở L1; tăng thời lượng ở L2), giữ ý chính và một test/example. Mở câu trả lời ngay dưới câu hỏi sau lượt 1; mỗi lượt chỉ sửa tối đa 2 lỗi.
- Thời lượng mục tiêu: L1: nêu entities/states; L2: design 90 giây; L3: phản ứng khi interviewer thay chính sách hold.
- Điều kiện qua bài: Nêu rõ assumption, status transitions, inventory invariant, failure và một concurrent test.
- Điểm dễ nói sai / hiểu sai: Không tự giả định PENDING có giữ chỗ hay không; phải thống nhất chính sách.
| Self-check (đánh dấu sau khi nói) | Yes/No |
|---|---|
| Tôi giải đúng kiến thức và nêu được ví dụ / failure / test cần thiết | [ ] |
| Tôi hiểu câu hỏi khi nghe, hoặc hỏi lại đúng chỗ | [ ] |
| Tôi tự nói không nhìn script; có mở đầu và kết luận rõ | [ ] |
| Tôi xử lý được ít nhất 1 follow-up mới | [ ] |
Mẫu trả lời dài V4 (tùy chọn; xem sau khi tự nói)
Show sample only after speaking
One possible answer (~40–90 words):
For a small booking system, I would model Customer, Room, Booking, and a way to reserve individual nights. A booking can move from pending to confirmed after staff approval. I would clarify whether pending bookings hold inventory, because that affects availability. To prevent double booking, allocation must be protected by suitable database constraints or concurrency control. I would test overlapping requests and failed multi-night reservations.
Knowledge guardrail: Không tự giả định PENDING có giữ chỗ hay không; phải thống nhất chính sách.
Reverse recall: Che sample; nói lại bằng từ của mình rồi trả lời follow-up số 2 trong Speaking Lab 07.
MÔ-ĐUN 08 [CORE] — Testing, Cloud, Security, Java & DSA: những gì cần để đọc đề và bảo vệ giải pháp
Mục tiêu: không học chứng chỉ. Chỉ học “tôi đã triển khai tính năng, vậy làm sao biết nó đúng, an toàn, vận hành được?”.
08.1. Testing từ trực giác đến lựa chọn
| Loại test | Câu hỏi trả lời | Ví dụ booking |
|---|---|---|
| Unit test | Một hàm/quy tắc có đúng? | Check-out phải sau check-in |
| Integration test | Các thành phần thực sự phối hợp đúng? | Service + PostgreSQL transaction |
| End-to-end (E2E) | Luồng từ UI/API đến hệ thống hoạt động? | User đặt phòng rồi nhận mã |
| Regression test | Sửa lỗi này có phá thứ khác? | Hủy booking không làm lỗi giữ phòng |
| Smoke test | Bản build có chạy chức năng trọng yếu? | API booking health và thao tác đơn giản |
| Load test | Khi nhiều request hệ thống có đáp ứng mục tiêu? | concurrent availability reads |
- Boundary value: thử input tại biên và sát biên, ví dụ
guestCount = 0,1,max,max+1. - Equivalence partitioning: chia input thành nhóm được xử lý giống nhau, test một vài đại diện.
- Verification vs validation: build đúng theo đặc tả hay build đúng thứ người dùng thực sự cần?
- Statement vs branch coverage: bao nhiêu câu lệnh vs bao nhiêu nhánh đã được test; coverage cao không bảo đảm hết bug.
- Mock vs stub: đều thay dependency trong test; “mock” thường xác minh tương tác, “stub” trả dữ liệu được chuẩn bị trước (cách dùng phụ thuộc framework).
Bài thực hành: Ngày 20/10 không còn phòng, nhưng API vẫn trả 201. Hãy viết 3 tests: happy path, validation/boundary, concurrency/conflict.
Đáp án mẫu
- Có phòng, ngày hợp lệ → tạo booking và trả ID/expected status.
- Ngày checkout <= checkin hoặc guestCount=0 → trả 400, không tạo booking.
- Hai concurrent requests cho phòng cuối → chỉ một được xác nhận; request còn lại nhận conflict hoặc trạng thái từ chối thích hợp; assert DB invariant.
08.2. Cloud và triển khai: định nghĩa + ứng dụng
| Thuật ngữ | Cần hiểu thực tế |
|---|---|
| On-premises | hệ thống đặt tại hạ tầng do đơn vị trực tiếp quản lý |
| Public/private/hybrid cloud | mô hình tổ chức và triển khai cloud, không phải cấp độ dịch vụ |
| IaaS/PaaS/SaaS | nhà cung cấp quản lý đến tầng nào |
| VM vs container | VM có guest OS riêng; container thường chia sẻ kernel host và cô lập processes |
| Hypervisor Type 1/2 | chạy trực tiếp trên phần cứng / trên host OS |
| Scalability vs elasticity | có thể tăng năng lực / tự tăng giảm năng lực theo nhu cầu |
| Horizontal vs vertical scaling | thêm instances / tăng tài nguyên của instance |
| CI / CD | tích hợp & kiểm thử tự động / sẵn sàng phát hành hoặc tự triển khai |
| Logging / metrics / tracing | sự kiện văn bản / số đo / theo dấu request qua components |
| SLA / SLO / SLI | cam kết dịch vụ / mục tiêu / số đo chất lượng |
| P95 vs throughput | 95% requests nhanh hơn ngưỡng đo được / số request hoàn tất mỗi đơn vị thời gian |
| RTO / RPO [PLUS] | thời gian hồi phục tối đa mục tiêu / mức mất dữ liệu cho phép |
Ví dụ: ứng dụng chậm khi lượng người dùng tăng. Trước khi hô “microservices”, kiểm tra query plan, app logs, latency distribution, CPU/memory, connection pool, external dependency. Có thể vấn đề là SQL index chứ không phải số lượng servers.
08.3. Security cơ bản — nhìn theo rủi ro
- Authentication: bạn là ai? Authorization: bạn được làm gì?
- Least privilege: chỉ cấp quyền cần thiết; đừng dùng admin DB credentials cho mọi service.
- Hash vs encryption: password nên dùng password hashing có salt với thuật toán phù hợp; không lưu password kiểu reversible encryption thông thường.
- SQL injection: query không parameterized; XSS: dữ liệu không tin cậy chạy script trong browser; CSRF: browser bị lợi dụng gửi request với phiên đã xác thực.
- JWT: chữ ký không đồng nghĩa payload được mã hóa; kiểm tra issuer/audience/expiry và quyền theo contract.
- CIA: Confidentiality / Integrity / Availability.
- Defense in depth: không chỉ dựa vào một tầng kiểm tra.
- Shared responsibility: ranh giới trách nhiệm nhà cung cấp cloud / người triển khai thay đổi theo dịch vụ.
08.4. Java Core và OOP — đối chiếu theo lỗi hay hỏi
| Cặp dễ nhầm | Trả lời đủ dùng |
|---|---|
| Overloading / overriding | khác parameter list / subtype thay implementation phù hợp |
== / equals() |
object identity / logical equality |
equals() / hashCode() |
objects bằng nhau phải có hash code bằng nhau; chiều ngược không cần |
| Interface / abstract class | contract và nhiều inheritance of type / base class có thể chứa state + implementation |
| Checked / unchecked exceptions | compiler yêu cầu handle/declare vs RuntimeException và subclasses |
final / finally / finalize |
keyword hạn chế thay đổi / cleanup block / cơ chế cũ deprecated-for-removal, không dựa vào |
| Comparable / Comparator | natural ordering / external comparison rule |
| Shallow / deep copy | object con có thể share references / tạo độc lập theo chiều sâu cần thiết |
| DI / dependency inversion | cách truyền dependency / nguyên lý phụ thuộc abstractions |
List / Set / Map |
danh sách có thứ tự / tập duy nhất / key-value |
HashMap / ConcurrentHashMap |
map thông thường không thread-safe / hỗ trợ concurrent access theo contract |
Stream / collection |
stream là pipeline thao tác, không phải nơi lưu dữ liệu |
| Optional | biểu diễn giá trị có thể vắng mặt; không dùng tùy tiện mọi field/entity |
Java ví dụ tối thiểu:
List<String> names = List.of("An", "Binh", "Chi");
List<String> filtered = names.stream()
.filter(name -> name.length() > 2)
.map(String::toUpperCase)
.toList();
// [BINH, CHI] (toList() có từ Java 16)
Tự giải thích bằng tiếng Anh: The stream filters names with more than two characters, converts the remaining names to uppercase, and collects them into a list.
08.5. DSA vocabulary và complexity — đủ dùng cho lời giải
- Time/space complexity: tăng input thì thời gian/bộ nhớ tăng thế nào.
- O(1), O(log n), O(n), O(n log n), O(n²) — biết thứ tự tăng trưởng.
- Worst/average/amortized: xấu nhất / trung bình theo input assumption / chi phí trung bình trên chuỗi thao tác.
- Array O(1) index access; linked list O(n) cho truy cập vị trí bất kỳ; hash map expected O(1), không bảo đảm worst case mọi tình huống.
- Stack LIFO / Queue FIFO / PriorityQueue theo ưu tiên.
- BFS dùng queue / DFS stack hoặc recursion; traversal adjacency list thường O(V+E).
- Binary search trên một điều kiện đơn điệu.
- Prefix sum / sliding window / two pointers / greedy — nhận diện pattern trước khi tối ưu.
| Sorting | Best* | Average* | Worst* | Nhớ gì |
|---|---|---|---|---|
| Bubble (early-stop) | O(n) | O(n²) | O(n²) | stable bản phổ biến |
| Selection | O(n²) | O(n²) | O(n²) | O(1) extra, không stable bản phổ biến |
| Insertion | O(n) | O(n²) | O(n²) | tốt với nearly sorted |
| Merge | O(n log n) | O(n log n) | O(n log n) | extra O(n) cho arrays |
| Quick | O(n log n) | O(n log n) | O(n²) | pivot lệch gây worst |
| Heap | O(n log n) | O(n log n) | O(n log n) | heap property |
Các giá trị theo implementation thường được dạy; không đánh đồng toàn bộ biến thể.
Câu tự nói: My solution uses a hash map to count occurrences in O(n) expected time, with O(k) extra space for k distinct keys.
08.6. Glossary nén để không bỏ mất nội dung hai file cũ [PLUS]
| Nhóm | Thuật ngữ cần nhận ra | Chỉ cần hiểu |
|---|---|---|
| Hardware | CPU, ALU, RAM, ROM, SSD, cache, binary/hex, bit/byte | xử lý / bộ nhớ / biểu diễn dữ liệu |
| Numeric | signed/unsigned, overflow, precision/scale, truncation/rounding | giới hạn giá trị / độ chính xác |
| OS | virtual memory, paging, page fault, fragmentation, user/kernel mode | ánh xạ RAM và quyền thực thi |
| DB theory | 1NF/2NF/3NF, candidate/super/composite key, functional dependency | giảm bất thường dữ liệu; định danh rows |
| DB performance | index scan/seek, query plan, N+1, replication, partitioning | hiểu chi phí truy xuất |
| Network | MAC, IP, NAT, router, switch, OSI, TLS | yêu cầu đi qua network thế nào |
| Delivery | SDLC, Agile, Scrum, sprint, backlog, user story | cách tổ chức công việc |
| Java | type erasure, GC, upcasting/downcasting, static/dynamic binding | cơ chế runtime/compile time |
| SQL Server [PLUS] | money, bit, real là numeric; image là legacy binary |
nếu bài MCQ SQL Server hỏi loại data type |
| Reliability [PLUS] | failover, redundancy, backpressure, circuit breaker | chống lỗi và kiểm soát tải |
Checkpoint CS (tự nói không nhìn file): “A user times out when booking the last room. What problems could occur from the browser to the database? How would you verify the behavior?” Nếu bạn tách được network timeout, duplicate retry, DB concurrency, logging/test, bạn đã liên kết được phần nền tảng thay vì học rời rạc.
🎙️ SPEAKING LAB V5.2 — 08. Testing, Cloud, Security và DSA recap
Thứ tự sử dụng: PRETEST → WATCH & DO ngay trong phần kiến thức phía trên → LISTEN/SHADOW → FREE SPEAK → FOLLOW-UP → feedback. Không mở đáp án trước lượt nói đầu.
Những ý kỹ thuật phải hiểu trước khi nói: Unit/integration/E2E; boundary/regression; authn/authz; logs/metrics/traces; cloud/scaling.
Từ đơn → cụm nói được (chỉ chọn 3–5 cụm để ôn hôm nay):
| Useful chunk | Nghĩa |
|---|---|
write a regression test |
viết test chống tái phát lỗi |
check authorization |
kiểm tra phân quyền |
measure latency |
đo độ trễ |
identify the bottleneck |
tìm điểm nghẽn |
1. PRETEST + WATCH + DO
Hoàn thành ít nhất một bài COMPLETE/DO ở phía trên (hoặc giải thích một ví dụ mới). Nếu chưa giải thích được cơ chế bằng tiếng Việt, quay lại bài kỹ thuật trước khi bắt đầu nói.
2. LISTEN → SHADOW
A — LISTEN & SHADOW (3–4 phút): Ẩn chữ; dùng TTS/Voice đọc lần lượt các câu sau. Lượt 1 nghe và tóm tắt ý; lượt 2–3 bắt chước nhịp nói, rồi nói lại không nhìn.
- An integration test checks whether components work together with a real database.
- Before scaling the application, I would inspect latency, logs, and database queries.
3. COMPLETE ORALLY
B — COMPLETE ORALLY (1–2 phút): Điền bằng giọng nói, không cần viết câu hoàn chỉnh trước.
I would start with a ___ test. It should verify . If the system is slow, I would .
4. FREE SPEAK — định nghĩa / cơ chế (không nhìn script)
Chọn 3–5 câu/lượt trong 12 câu sau. Đáp án được thu gọn dưới từng câu; chỉ mở sau khi đã nói.
Q077 · MECHANISM / WHY · BASE V4
TTS 153 · Q: How do unit tests differ from integration tests?
Mở đáp án mẫu Q077 — sau khi tự trả lời
TTS 154 · A: A unit test checks a small piece of logic in isolation. An integration test checks how real components work together. For example, it can verify a service using a real test database.
Q078 · FOUNDATION · BASE V4
TTS 155 · Q: Does high test coverage guarantee there are no bugs?
Mở đáp án mẫu Q078 — sau khi tự trả lời
TTS 156 · A: No. High coverage means many lines or branches were executed. It does not prove that the assertions are correct or that all important edge cases were tested.
Q079 · MECHANISM / WHY · BASE V4
TTS 157 · Q: What is the difference between authentication and authorization?
Mở đáp án mẫu Q079 — sau khi tự trả lời
TTS 158 · A: Authentication checks who the user is. Authorization checks what that user can do. For example, a customer may be logged in but still cannot approve a booking.
Q080 · FOUNDATION · ADD V5
TTS 159 · Q: What is mocking in unit testing?
Mở đáp án mẫu Q080 — sau khi tự trả lời
TTS 160 · A: Mocking replaces a dependency with a controlled test double. It can verify interactions or simulate failures. I would still use integration tests to check real database behavior.
Q081 · MECHANISM / WHY · ADD V5
TTS 161 · Q: What is the difference between authentication and role-based authorization?
Mở đáp án mẫu Q081 — sau khi tự trả lời
TTS 162 · A: Authentication establishes who the caller is. Role-based authorization uses roles or permissions to decide what actions that caller may perform. Object ownership can require extra checks beyond the role.
Q082 · MECHANISM / WHY · ADD V5
TTS 163 · Q: What is the difference between symmetric and asymmetric encryption?
Mở đáp án mẫu Q082 — sau khi tự trả lời
TTS 164 · A: Symmetric encryption uses a shared secret key for encryption and decryption. Asymmetric encryption uses a related public and private key pair. The right choice depends on the protocol and security goal.
Q083 · MECHANISM / WHY · ADD V5
TTS 165 · Q: What is the difference between a virtual machine and a container?
Mở đáp án mẫu Q083 — sau khi tự trả lời
TTS 166 · A: A virtual machine runs its own guest operating system on virtualized hardware. A container normally shares the host kernel while isolating application processes. Containers are often lighter, but isolation and security still need configuration.
Q084 · FOUNDATION · ADD V5
TTS 167 · Q: What does Big O notation describe?
Mở đáp án mẫu Q084 — sau khi tự trả lời
TTS 168 · A: Big O describes how an algorithm’s resource usage grows as the input size increases. I use it to compare growth rates, such as O(n) and O(n²), while stating the assumptions.
Q085 · MECHANISM / WHY · ADD V5
TTS 169 · Q: What is the difference between a stack and a queue?
Mở đáp án mẫu Q085 — sau khi tự trả lời
TTS 170 · A: A stack uses last in, first out order. A queue uses first in, first out order. For example, DFS can use a stack, while BFS commonly uses a queue.
Q086 · MECHANISM / WHY · ADD V5
TTS 171 · Q: What is the difference between BFS and DFS?
Mở đáp án mẫu Q086 — sau khi tự trả lời
TTS 172 · A: Breadth-first search explores nodes level by level, commonly using a queue. Depth-first search explores a path deeply before backtracking, using a stack or recursion. With an adjacency list, both run in O(V + E) time.
Q087 · MECHANISM / WHY · ADD V5
TTS 173 · Q: Why can Quick Sort be O(n²) in the worst case while Merge Sort stays O(n log n)?
Mở đáp án mẫu Q087 — sau khi tự trả lời
TTS 174 · A: Quick Sort can create very unbalanced partitions, leading to quadratic work. Merge Sort repeatedly splits the input and merges sorted halves, giving O(n log n) time in the usual implementation. Their memory trade-offs are different.
Q088 · FOUNDATION · ADD V5
TTS 175 · Q: How can you prevent SQL injection in a Java backend?
Mở đáp án mẫu Q088 — sau khi tự trả lời
TTS 176 · A: I would use parameterized queries or safely bound ORM parameters, not build SQL by concatenating untrusted input. I would also validate inputs and limit database permissions. Validation alone is not a replacement for parameter binding.
5. UNEXPECTED FOLLOW-UP — thay giả định và suy luận
Chọn ít nhất một câu dưới đây, tự trả lời trước; sau đó yêu cầu người luyện thay một điều kiện mới.
Q089 · SCENARIO / FOLLOW-UP · BASE V4
TTS 177 · Q: How would you test that only staff can approve a booking?
Mở đáp án mẫu Q089 — sau khi tự trả lời
TTS 178 · A: I would test the approval API with a staff account and expect success. Then I would use a customer account and expect a forbidden response with no booking state change.
Q090 · SCENARIO / FOLLOW-UP · BASE V4
TTS 179 · Q: An application is slow. Would you add more servers immediately?
Mở đáp án mẫu Q090 — sau khi tự trả lời
TTS 180 · A: No. I would first measure latency and check logs, slow SQL queries, and resource usage. More servers will not necessarily fix a slow database query.
Q091 · SCENARIO / FOLLOW-UP · ADD V5
TTS 181 · Q: How would you explain the time complexity of binary search?
Mở đáp án mẫu Q091 — sau khi tự trả lời
TTS 182 · A: Binary search repeatedly halves a sorted search range. Its time complexity is O(log n), and an iterative implementation can use O(1) extra space. The input must satisfy the sorted-order assumption.
6. REPEAT + FEEDBACK — checkpoint
E — REPEAT + FEEDBACK: Chọn câu khó nhất ở phần FREE SPEAK, nói 3 lượt (45–60 giây → 30–45 giây → 20–30 giây ở L1; tăng thời lượng ở L2), giữ ý chính và một test/example. Mở câu trả lời ngay dưới câu hỏi sau lượt 1; mỗi lượt chỉ sửa tối đa 2 lỗi.
- Thời lượng mục tiêu: L1: định nghĩa + ví dụ test; L2: 60 giây symptom → measurement → fix → regression.
- Điều kiện qua bài: Chọn đúng loại test cho rule, DB hoặc end-to-end; không nhầm authn và authz.
- Điểm dễ nói sai / hiểu sai: Coverage chỉ là chỉ số phạm vi chạy code, không chứng minh không có lỗi.
| Self-check (đánh dấu sau khi nói) | Yes/No |
|---|---|
| Tôi giải đúng kiến thức và nêu được ví dụ / failure / test cần thiết | [ ] |
| Tôi hiểu câu hỏi khi nghe, hoặc hỏi lại đúng chỗ | [ ] |
| Tôi tự nói không nhìn script; có mở đầu và kết luận rõ | [ ] |
| Tôi xử lý được ít nhất 1 follow-up mới | [ ] |
Mẫu trả lời dài V4 (tùy chọn; xem sau khi tự nói)
Show sample only after speaking
One possible answer (~40–90 words):
A unit test checks a small rule in isolation, while an integration test verifies how real components work together, such as a service and PostgreSQL. For staff approval, I would test valid access and a forbidden request from a normal customer. If the application is slow, I would inspect logs, latency metrics, and SQL queries before deciding whether more servers are needed.
Knowledge guardrail: Coverage chỉ là chỉ số phạm vi chạy code, không chứng minh không có lỗi.
Reverse recall: Che sample; nói lại bằng từ của mình rồi trả lời follow-up số 2 trong Speaking Lab 08.
MÔ-ĐUN 08A [CORE][JAVA BACKEND] — Java Core + OOP: từ biết dùng đến giải thích được cơ chế
Vì sao bổ sung? Mục 08.4 phía trên chỉ là bảng ôn nhanh. Mô-đun này dành cho ứng viên đã code Java cơ bản nhưng dễ bí khi interviewer hỏi why / what if / show me. Mục tiêu Intern/Fresher/Junior 0–1 năm: không học JVM nội bộ đến mức senior, không học thuộc câu trả lời dài.
Thứ tự mỗi cụm:
PRETEST → WATCH → COMPLETE → DO → EXPLAINtheo cách học ở START HERE. Có thể bỏ qua WATCH nếu tự giải được DO và giải thích rõ.
08A.0. PRETEST — 8 câu (6 phút, chưa xem phần dưới)
- Hai
Counterobjects cóstatic int totalvàint ownCount: gọiincrement()trên object A thì B nhìn thấy trường nào đổi? - Vì sao
static void print()không thể trực tiếp dùng một instance field mà không có object? - Vì sao hai object có
equals()trảtruephải có cùnghashCode()? - Với
List<String> xs = new ArrayList<>(), khác gìSet<String>khi thêm trùng? change(name)nhậnString namerồi gánname = "new": biến bên ngoài có đổi không?- Một
HashMapdùng làm shared state giữa nhiều threads có an toàn không? - Khác nhau thế nào giữa overloading và overriding? Static method có override không?
count++trênstatic int countcó đảm bảo chính xác khi hai threads cùng gọi không?
Phân luồng: sai (1–2) → 08A.1; (3–5) → 08A.2–3; (6–8) → 08A.4–5. Nếu đúng hết, làm ngay DO/MOCK ở 08A.6.
08A.1. static / instance / final: một ví dụ từ đơn giản đến tình huống
WATCH — code có thể chạy bằng Java 21:
class Counter {
static int total = 0; // Một field gắn với lớp Counter (trong một class-loader context)
int ownCount = 0; // Mỗi object có field riêng
void increment() {
total++;
ownCount++;
}
static int totalSoFar() { return total; }
}
class Demo {
public static void main(String[] args) {
Counter a = new Counter();
Counter b = new Counter();
a.increment();
a.increment();
b.increment();
System.out.println(Counter.totalSoFar()); // 3
System.out.println(a.ownCount); // 2
System.out.println(b.ownCount); // 1
}
}
staticfield thuộc lớp, các instances của lớp dùng chung giá trị đó (trong cùng JVM/class-loader tương ứng); thường gọiCounter.total, không gọi qua instance dù Java cho phép một số trường hợp truy cập như thế.staticmethod không cóthis; muốn đọcownCount, phải có reference đến object cụ thể (hoặc tạo object).staticmethod ở subclass có thể hide static method cùng signature của superclass, không phải override động như instance method.finalvới biến/reference: không gán lại reference; không làm object được tham chiếu thành immutable.static finalthường dùng hằng số; immutable/thread-safe còn tùy loại dữ liệu.statickhông có nghĩa thread-safe.total++vẫn là read–modify–write, có thể mất increment.
COMPLETE — điền trước khi mở đáp án:
class Config {
static final int MAX_RETRIES = 3;
private String environment;
Config(String environment) { this.environment = environment; }
// Viết static method trả MAX_RETRIES và instance method trả environment.
}
Đáp án COMPLETE
static int maxRetries() { return MAX_RETRIES; }
String environment() { return environment; }
Nếu muốn environment truy cập từ static method, cần truyền Config config vào hoặc xác định object cụ thể. Không nên biến field thành static chỉ để tránh truyền object.
DO — đề biến thể (5 phút): Cart chứa static double discountPercent và double subtotal. Bạn muốn mỗi giỏ có chính sách giảm giá khác nhau. Thiết kế hiện tại có rủi ro gì? Sửa field nào? Nếu nhiều luồng cùng cập nhật tổng doanh thu của cửa hàng thì sao?
Gợi ý / đáp án DO
discountPercent hiện dùng chung cho mọi Cart, cập nhật một giỏ có thể ảnh hưởng giỏ khác. Nếu mỗi giỏ có discount riêng, chuyển nó thành instance field (hoặc object policy được truyền vào). Tổng doanh thu là shared mutable state: static không bảo đảm atomicity; nếu quản lý tiền thật cần quy tắc update ở authoritative store/database, không dựa đơn thuần vào counter RAM.
EXPLAIN: “A static field belongs to the class and is shared across instances, while an instance field belongs to each object. Static alone does not make updates thread-safe.” Nói thêm một ví dụ.
MICRO SPEAK V5.2 — sau mục 08A.1 · 4 Q&A. Chỉ làm khi đã hiểu ví dụ/code ở ngay phía trên. Mỗi lượt chọn tối đa 4–6 câu; nếu nhiều hơn, chia 2 lượt.
SHADOW: No. (nghe và nhại 2 lần). Sau đó che đáp án, tự trả lời bằng tiếng Anh rồi mới mở mẫu.
FREE SPEAK — định nghĩa / cơ chế (4 câu)
Q092 · MECHANISM / WHY · BASE V4
TTS 183 · Q: Does static imply thread safety? Why not?
Mở đáp án mẫu Q092 — sau khi tự trả lời
TTS 184 · A: No. Static means a field or method belongs to the class rather than one object. Multiple threads can still access a shared static field and cause a race condition.
Q093 · FOUNDATION · ADD V5
TTS 185 · Q: What does static mean, and does it imply thread safety?
Mở đáp án mẫu Q093 — sau khi tự trả lời
TTS 186 · A: Static means a member belongs to a class rather than a particular object. A static mutable field can still be accessed by multiple threads. It does not guarantee atomic or thread-safe updates.
Q094 · MECHANISM / WHY · ADD V5
TTS 187 · Q: What happens when you invoke a static method through a superclass reference to a subclass object?
Mở đáp án mẫu Q094 — sau khi tự trả lời
TTS 188 · A: Static methods are hidden, not overridden polymorphically. The method selected depends on the compile-time reference type, not the runtime object type. I prefer calling static methods through the class name.
Q095 · MECHANISM / WHY · ADD V5
TTS 189 · Q: What is the difference between final, finally, and finalize?
Mở đáp án mẫu Q095 — sau khi tự trả lời
TTS 190 · A: Final restricts reassignment, overriding, or inheritance depending on where it is used. Finally is a block that normally runs when a try statement completes. Finalize is an obsolete cleanup mechanism that should not be relied on.
DO → TRANSFER: quay lại bài thực hành ngay phía trên; đổi một dữ kiện và giải thích hệ quả bằng tiếng Anh. Ghi một lỗi kiến thức và một lỗi nói.
08A.2. Reference, pass-by-value, String, equality và hashCode()
WATCH — mô hình cần nhớ: Java luôn truyền arguments by value. Với object, giá trị được truyền là bản sao của reference. Method có thể sửa object thông qua reference đó, nhưng gán biến parameter sang object khác không đổi biến của caller.
import java.util.*;
class Demo {
static void append(List<String> items) { items.add("B"); }
static void replace(List<String> items) { items = new ArrayList<>(); items.add("C"); }
public static void main(String[] args) {
List<String> xs = new ArrayList<>(List.of("A"));
append(xs);
replace(xs);
System.out.println(xs); // [A, B]
}
}
==so identity của hai references (với primitives là so giá trị);.equals()là logical equality theo implementation của class.Stringimmutable:s.toUpperCase()tạo/trả một giá trị mới, không sửa object cũ; so chuỗi theo nội dung dùngequals().- Contract:
a.equals(b)đúng ⇒a.hashCode() == b.hashCode(); hash bằng nhau không đảm bảo equals đúng. - HashMap/HashSet dựa vào hash và equality. Nếu dùng object làm key, key nên có equality/hash ổn định trong thời gian đang được lưu.
recordthường tiện cho value objects vì cung cấp equality/hash theo components.
COMPLETE: Kết quả đoạn sau là gì? Vì sao?
String x = new String("java");
String y = new String("java");
System.out.println(x == y); // ?
System.out.println(x.equals(y)); // ?
String z = x.toUpperCase();
System.out.println(x); // ?
Đáp án COMPLETE
false, true, java; biến z chứa JAVA. Hai lần new String tạo hai object khác nhau; equals so nội dung; String immutable.
DO — hai bug rất hay gặp:
- Một
HashSet<Customer>chứa hai objects khác nhau có cùngcustomerId, nhưng vẫn giữ cả hai. Có thể sai ở đâu? - Dùng object
OrderKey(id, status)mutable làm key choHashMap, sau đó đổistatus; tại saomap.get(key)có thể thất bại?
Gợi ý / đáp án DO
- Nếu muốn equality theo
customerId, phải định nghĩaequalsvàhashCodenhất quán; mặc định Object so identity. Không mặc định mọi entity phải so theo ID khi ID chưa được cấp hoặc đổi. - Nếu các field dùng tính hash/equality thay đổi, key có thể nằm ở bucket cũ và lookup theo hash mới không tìm đúng. Dùng immutable key, chẳng hạn
record OrderKey(UUID id, String status) {}nếu các components thực sự hợp business semantics, hoặc chỉ dùng ID ổn định.
MICRO SPEAK V5.2 — sau mục 08A.2 · 8 Q&A. Chỉ làm khi đã hiểu ví dụ/code ở ngay phía trên. Mỗi lượt chọn tối đa 4–6 câu; nếu nhiều hơn, chia 2 lượt.
SHADOW: For object references, double equals compares whether they point to the same object. (nghe và nhại 2 lần). Sau đó che đáp án, tự trả lời bằng tiếng Anh rồi mới mở mẫu.
FREE SPEAK — định nghĩa / cơ chế (8 câu)
Q096 · MECHANISM / WHY · BASE V4
TTS 191 · Q: What is the difference between == and equals for objects?
Mở đáp án mẫu Q096 — sau khi tự trả lời
TTS 192 · A: For object references, double equals compares whether they point to the same object. The equals method can compare logical values. For example, two different String objects may have equal text.
Q097 · MECHANISM / WHY · BASE V4
TTS 193 · Q: Why can mutable HashMap keys cause problems?
Mở đáp án mẫu Q097 — sau khi tự trả lời
TTS 194 · A: A mutable key may change its hash code after insertion. Then HashMap may search the wrong bucket and fail to find the key. I would prefer immutable keys.
Q098 · MECHANISM / WHY · BASE V4
TTS 195 · Q: What does Java pass when you pass an object to a method?
Mở đáp án mẫu Q098 — sau khi tự trả lời
TTS 196 · A: Java is always pass-by-value. When I pass an object, the method receives a copy of the reference value. It can change the object, but reassigning the parameter does not replace the caller’s reference.
Q099 · MECHANISM / WHY · ADD V5
TTS 197 · Q: Why do HashMap keys need a stable hashCode and equals contract?
Mở đáp án mẫu Q099 — sau khi tự trả lời
TTS 198 · A: HashMap uses hash codes to locate candidate entries and equals to identify a matching key. Equal keys must have equal hash codes. Changing a key's equality-related fields after insertion can break lookup.
Q100 · MECHANISM / WHY · ADD V5
TTS 199 · Q: Why doesn't changing a method's object parameter reference replace the caller's reference?
Mở đáp án mẫu Q100 — sau khi tự trả lời
TTS 200 · A: Java passes a copy of the reference value to the method. Reassigning that local copy does not change the caller's variable. Mutating the referenced object can still be visible to the caller.
Q101 · MECHANISM / WHY · ADD V5
TTS 201 · Q: What is the difference between String, StringBuilder, and StringBuffer?
Mở đáp án mẫu Q101 — sau khi tự trả lời
TTS 202 · A: String is immutable. StringBuilder is a mutable text builder without synchronized methods. StringBuffer synchronizes many operations, but that does not automatically make a multi-step workflow atomic.
Q102 · MECHANISM / WHY · ADD V5
TTS 203 · Q: What is the difference between stack memory and heap memory in Java?
Mở đáp án mẫu Q102 — sau khi tự trả lời
TTS 204 · A: A thread's stack stores call frames and execution state. The heap typically stores objects shared by reference across code and threads. The precise runtime optimizations are managed by the JVM.
Q103 · MECHANISM / WHY · ADD V5
TTS 205 · Q: What is the difference between equals and hashCode contracts?
Mở đáp án mẫu Q103 — sau khi tự trả lời
TTS 206 · A: Equals determines whether two objects are logically equal according to a class's implementation. If two objects are equal, their hash codes must match. The reverse is not guaranteed because hash collisions are possible.
DO → TRANSFER: quay lại bài thực hành ngay phía trên; đổi một dữ kiện và giải thích hệ quả bằng tiếng Anh. Ghi một lỗi kiến thức và một lỗi nói.
08A.3. OOP, access modifiers và polymorphism — khi nào dùng interface?
WATCH:
| Chủ đề | Cần nắm để trả lời phỏng vấn |
|---|---|
| Encapsulation | Che state, kiểm soát cách thay đổi qua methods; không phải “mọi field có getter/setter” |
| Inheritance | Quan hệ is-a và kế thừa behavior; không thay thế composition một cách vô điều kiện |
| Polymorphism | Reference kiểu cha/interface có thể gọi implementation của object thực tế (instance methods overridden) |
| Abstraction | Công khai contract quan trọng, ẩn chi tiết implementation |
| Overload | Cùng tên method, parameter list khác; chọn overload chủ yếu tại compile time |
| Override | Subclass implement lại instance method phù hợp; runtime dynamic dispatch |
private / package-private / protected / public |
Trong class / cùng package / package & subclass theo quy tắc access / truy cập công khai |
| Interface / abstract class | Interface cho contract và nhiều implementation; abstract class có thể có state/constructor và logic chia sẻ |
| Composition | CheckoutService has a PricingPolicy; thường dễ thay đổi logic hơn lạm dụng inheritance |
WATCH — code ví dụ:
interface DiscountPolicy {
int discount(int subtotal);
}
class NoDiscount implements DiscountPolicy {
public int discount(int subtotal) { return 0; }
}
class TenPercent implements DiscountPolicy {
public int discount(int subtotal) { return subtotal / 10; }
}
class CheckoutService {
private final DiscountPolicy policy;
CheckoutService(DiscountPolicy policy) { this.policy = policy; }
int finalPrice(int subtotal) { return subtotal - policy.discount(subtotal); }
}
Đây là Strategy + constructor injection bằng Java thuần. Bạn có thể thay policy mà không viết nhiều if bên trong CheckoutService. Không cần tạo interface cho mọi class; chỉ tạo abstraction khi giải quyết được nhu cầu thực tế.
COMPLETE: Đổi từ NoDiscount sang TenPercent mà không sửa CheckoutService như thế nào? Vì sao ví dụ này thể hiện polymorphism?
Đáp án COMPLETE
CheckoutService service = new CheckoutService(new TenPercent());
System.out.println(service.finalPrice(100)); // 90
CheckoutService biết contract DiscountPolicy, implementation thực tế quyết định kết quả tại runtime.
DO — follow-up: Interviewer yêu cầu “thêm discount VIP”. Bạn sẽ thêm subclass của CheckoutService hay thêm implementation DiscountPolicy? Khi nào một interface trở nên không cần thiết?
Gợi ý / đáp án DO
Thêm policy implementation thường hợp lý hơn vì yêu cầu chỉ thay đổi thuật toán tính giảm giá. Nếu chỉ có một policy và không có nhu cầu thay đổi/test seam, một class đơn giản có thể đủ; tránh overengineering.
MICRO SPEAK V5.2 — sau mục 08A.3 · 7 Q&A. Chỉ làm khi đã hiểu ví dụ/code ở ngay phía trên. Mỗi lượt chọn tối đa 4–6 câu; nếu nhiều hơn, chia 2 lượt.
SHADOW: I would use an interface to define a contract that different classes can implement. (nghe và nhại 2 lần). Sau đó che đáp án, tự trả lời bằng tiếng Anh rồi mới mở mẫu.
FREE SPEAK — định nghĩa / cơ chế (6 câu)
Q104 · MECHANISM / WHY · ADD V5
TTS 207 · Q: What's the difference between interface and abstract class?
Mở đáp án mẫu Q104 — sau khi tự trả lời
TTS 208 · A: An interface defines a contract that classes can implement. An abstract class can provide shared state, constructors, and common implementation. I would choose based on the relationship and design needs.
Q105 · MECHANISM / WHY · ADD V5
TTS 209 · Q: What's the difference between an overloaded and an overridden method?
Mở đáp án mẫu Q105 — sau khi tự trả lời
TTS 210 · A: Overloading uses the same method name with different parameter lists, and selection is based mainly on compile-time types. Overriding provides a new implementation of an inherited instance method, selected by runtime dispatch.
Q106 · FOUNDATION · ADD V5
TTS 211 · Q: What is encapsulation in object-oriented programming?
Mở đáp án mẫu Q106 — sau khi tự trả lời
TTS 212 · A: Encapsulation groups data with behavior and controls access to internal state. For example, a Booking object can expose an approve method instead of allowing arbitrary status changes.
Q107 · MECHANISM / WHY · ADD V5
TTS 213 · Q: What is inheritance, and when could composition be better?
Mở đáp án mẫu Q107 — sau khi tự trả lời
TTS 214 · A: Inheritance models an is-a relationship between types. Composition builds behavior by combining objects. I prefer composition when I need to change policies without creating a fragile class hierarchy.
Q108 · FOUNDATION · ADD V5
TTS 215 · Q: What is polymorphism in Java?
Mở đáp án mẫu Q108 — sau khi tự trả lời
TTS 216 · A: Polymorphism lets code use a common type while different implementations provide different behavior. For example, a CheckoutService can call a DiscountPolicy interface without knowing the specific discount algorithm.
Q109 · FOUNDATION · ADD V5
TTS 217 · Q: What is abstraction in OOP?
Mở đáp án mẫu Q109 — sau khi tự trả lời
TTS 218 · A: Abstraction exposes the important contract while hiding implementation details. For example, a PaymentGateway interface can describe a charge operation without exposing the provider's HTTP calls.
FOLLOW-UP — case / phản biện (1 câu)
Q110 · SCENARIO / FOLLOW-UP · BASE V4
TTS 219 · Q: When would you use an interface rather than an abstract class?
Mở đáp án mẫu Q110 — sau khi tự trả lời
TTS 220 · A: I would use an interface to define a contract that different classes can implement. I would use an abstract class when related classes need shared state or common implementation.
DO → TRANSFER: quay lại bài thực hành ngay phía trên; đổi một dữ kiện và giải thích hệ quả bằng tiếng Anh. Ghi một lỗi kiến thức và một lỗi nói.
08A.4. Collections, generics, Optional, Stream và exceptions
WATCH — phân biệt đủ dùng:
| Công cụ | Ý nghĩa và lỗi hay gặp |
|---|---|
ArrayList |
Index O(1), thêm cuối amortized O(1); chèn giữa/dồn phần tử O(n) |
LinkedList |
Truy cập theo index O(n); chèn tại vị trí đã biết có thể O(1), nhưng tìm vị trí vẫn tốn chi phí |
HashSet / HashMap |
Lookup average/expected O(1) giả định hash phân bố phù hợp; phụ thuộc equals/hashCode; không tự thread-safe |
TreeMap |
Keys sắp thứ tự; thông thường operations O(log n) |
PriorityQueue |
Heap, offer/poll O(log n), peek O(1); không phải danh sách sorted hoàn toàn |
| Generics | Kiểm tra kiểu tại compile time, Java dùng type erasure cho nhiều generic type information |
Optional<T> |
Biểu diễn có/không có kết quả, hay ở API trả về; tránh get() mù và không áp dụng mọi entity field |
| Stream | Pipeline map/filter/collect; thường lazy cho intermediate operations, chạy khi terminal operation được gọi |
| Checked exception | IOException phải catch/declare; unchecked RuntimeException không bị compiler bắt buộc catch |
| Try-with-resources | Tự đóng tài nguyên AutoCloseable kể cả khi có exception, khác với GC |
WATCH — hai idiom ngắn:
Map<String, Integer> freq = new HashMap<>();
for (String s : List.of("A", "B", "A")) {
freq.merge(s, 1, Integer::sum);
}
// {A=2, B=1} (thứ tự duyệt HashMap không được đảm bảo)
Optional<String> name = Optional.empty();
System.out.println(name.orElse("Unknown")); // Unknown
COMPLETE — dự đoán:
List<Integer> nums = new ArrayList<>(List.of(1, 2, 3, 4));
long count = nums.stream().filter(n -> n % 2 == 0).count();
// count = ? ; nums sau khi đếm = ?
Đáp án COMPLETE
count = 2; nums không đổi. Stream không tự sửa list ban đầu; các thao tác có side-effect trong stream cần cẩn trọng.
DO — Java interview nhỏ (8 phút): Viết Map<String,Integer> countByCategory(List<String> categories); bỏ qua null và chuỗi blank, trim khoảng trắng, gộp category không phân biệt hoa/thường. Viết hai test cases.
Đáp án tham khảo DO
static Map<String, Integer> countByCategory(List<String> categories) {
Map<String, Integer> ans = new HashMap<>();
for (String raw : categories) {
if (raw == null || raw.isBlank()) continue;
String key = raw.trim().toLowerCase(Locale.ROOT);
ans.merge(key, 1, Integer::sum);
}
return ans;
}
Test: [" Food ", "food", "", null] → food=2; [] → empty map. Nếu parameter categories bản thân có thể null, cần định nghĩa contract và bổ sung xử lý, không âm thầm đoán.
MICRO SPEAK V5.2 — sau mục 08A.4 · 10 Q&A. Chỉ làm khi đã hiểu ví dụ/code ở ngay phía trên. Mỗi lượt chọn tối đa 4–6 câu; nếu nhiều hơn, chia 2 lượt.
SHADOW: I usually choose ArrayList for indexed access and efficient iteration. (nghe và nhại 2 lần). Sau đó che đáp án, tự trả lời bằng tiếng Anh rồi mới mở mẫu.
FREE SPEAK — định nghĩa / cơ chế (8 câu)
Q111 · FOUNDATION · ADD V5
TTS 221 · Q: Can garbage collection replace closing a database connection?
Mở đáp án mẫu Q111 — sau khi tự trả lời
TTS 222 · A: No. Garbage collection manages reclaimable Java objects, not timely release of every external resource. I would close connections and streams appropriately, often with try-with-resources or a managed framework.
Q112 · MECHANISM / WHY · ADD V5
TTS 223 · Q: What is the difference between checked and unchecked exceptions?
Mở đáp án mẫu Q112 — sau khi tự trả lời
TTS 224 · A: Checked exceptions generally must be caught or declared by the compiler. Unchecked exceptions are RuntimeException types and their subclasses. I choose handling based on whether callers can meaningfully recover.
Q113 · MECHANISM / WHY · ADD V5
TTS 225 · Q: What is the difference between List, Set, and Map?
Mở đáp án mẫu Q113 — sau khi tự trả lời
TTS 226 · A: List is an ordered collection that can contain duplicates. Set stores unique elements according to its equality rules. Map associates keys with values and requires unique keys.
Q114 · MECHANISM / WHY · ADD V5
TTS 227 · Q: What is the difference between HashMap and ConcurrentHashMap?
Mở đáp án mẫu Q114 — sau khi tự trả lời
TTS 228 · A: HashMap is not safe for unsynchronized concurrent modifications. ConcurrentHashMap supports concurrent access with its own concurrency guarantees. For compound operations, I would still choose the appropriate atomic map method.
Q115 · MECHANISM / WHY · ADD V5
TTS 229 · Q: What is the difference between HashSet and TreeSet?
Mở đáp án mẫu Q115 — sau khi tự trả lời
TTS 230 · A: HashSet uses hashing and does not guarantee sorted iteration order. TreeSet maintains a sorted order using natural ordering or a comparator. Their performance and element requirements differ.
Q116 · FOUNDATION · ADD V5
TTS 231 · Q: What is a generic type in Java?
Mở đáp án mẫu Q116 — sau khi tự trả lời
TTS 232 · A: Generics let me express type constraints, such as List
Q117 · MECHANISM / WHY · ADD V5
TTS 233 · Q: What is the difference between Comparable and Comparator?
Mở đáp án mẫu Q117 — sau khi tự trả lời
TTS 234 · A: Comparable defines an object's natural ordering. Comparator defines an external ordering strategy. I can use different comparators to sort the same objects in different ways.
Q118 · MECHANISM / WHY · ADD V5
TTS 235 · Q: What is the difference between map and filter in Java Streams?
Mở đáp án mẫu Q118 — sau khi tự trả lời
TTS 236 · A: Map transforms each element into another value. Filter keeps only elements that satisfy a predicate. Neither operation changes the original collection by itself.
FOLLOW-UP — case / phản biện (2 câu)
Q119 · SCENARIO / FOLLOW-UP · ADD V5
TTS 237 · Q: When would you choose ArrayList instead of LinkedList?
Mở đáp án mẫu Q119 — sau khi tự trả lời
TTS 238 · A: I usually choose ArrayList for indexed access and efficient iteration. LinkedList may help with some insertions when I already hold the node position, but searching and memory overhead matter. I would measure before switching.
Q120 · SCENARIO / FOLLOW-UP · ADD V5
TTS 239 · Q: When would you use Optional rather than returning null?
Mở đáp án mẫu Q120 — sau khi tự trả lời
TTS 240 · A: Optional can make the possible absence of a result explicit in a return type. For example, a repository lookup may return Optional
DO → TRANSFER: quay lại bài thực hành ngay phía trên; đổi một dữ kiện và giải thích hệ quả bằng tiếng Anh. Ghi một lỗi kiến thức và một lỗi nói.
08A.5. Thread safety và dữ liệu: kết nối Java với Backend
WATCH:
class Counter {
private int value;
synchronized void increment() { value++; }
synchronized int get() { return value; }
}
Trong một Counter object, hai synchronized instance methods dùng chung intrinsic lock của object đó. Nhưng nếu có hai Counter objects / hai JVM instances / hai backend pods, chúng không chia sẻ lock với nhau. volatile giúp visibility/order, không làm value++ atomic.
Khi data thật nằm ở PostgreSQL, hãy xét transaction + database locking/constraint/atomic conditional update thay vì tin rằng synchronized ở một application instance đã bảo vệ dữ liệu chung.
DO — tình huống: Hai người cùng mua sản phẩm còn 1 món. Vì sao synchronized method trong Spring service vẫn có thể không giải quyết được nếu chạy nhiều replicas? Thiết kế một test đồng thời và điều kiện sau test.
Đáp án DO
Mỗi replica có memory/lock riêng, cả hai có thể đọc tồn = 1 và đặt hàng. Dùng row lock (SELECT ... FOR UPDATE) hoặc atomic conditional update / constraint phù hợp trong DB; test hai requests bắt đầu chồng lấn, assert tối đa một đơn thành công và stock không âm. Isolation và transaction boundary phải phù hợp schema.
MICRO SPEAK V5.2 — sau mục 08A.5 · 1 Q&A. Chỉ làm khi đã hiểu ví dụ/code ở ngay phía trên. Mỗi lượt chọn tối đa 4–6 câu; nếu nhiều hơn, chia 2 lượt.
SHADOW: Both requests may read the same old value and overwrite each other's update. (nghe và nhại 2 lần). Sau đó che đáp án, tự trả lời bằng tiếng Anh rồi mới mở mẫu.
FOLLOW-UP — case / phản biện (1 câu)
Q121 · SCENARIO / FOLLOW-UP · ADD V5
TTS 241 · Q: Two requests increment a shared counter. What can go wrong?
Mở đáp án mẫu Q121 — sau khi tự trả lời
TTS 242 · A: Both requests may read the same old value and overwrite each other's update. This is a lost-update race. I would use an atomic operation or suitable synchronization for in-memory state.
DO → TRANSFER: quay lại bài thực hành ngay phía trên; đổi một dữ kiện và giải thích hệ quả bằng tiếng Anh. Ghi một lỗi kiến thức và một lỗi nói.
08A.6. MOCK mới (12 phút): trả lời rồi mới mở đáp án
- What does static mean, and does it imply thread safety?
- Why do HashMap keys need a stable hashCode and equals contract?
- What's the difference between interface and abstract class?
- When would you choose ArrayList instead of LinkedList?
- What's the difference between an overloaded and an overridden method?
- Why doesn't changing a method's object parameter reference replace the caller's reference?
- When would you use Optional rather than returning null?
- Can garbage collection replace closing a database connection?
- What happens when you invoke a static method through a superclass reference to a subclass object?
- Two requests increment a shared counter. What can go wrong?
Rubric / câu trả lời tối thiểu (chỉ xem sau khi tự làm)
- Class-level membership; shared does not mean atomic/thread-safe.
- Hash lookup depends on consistent equality/hash, mutable keys can break lookup.
- Interface expresses contract; abstract class can share state/constructor/implementation; choose based on problem.
- Usually ArrayList for efficient random access and iteration; LinkedList only with a demonstrated need, account for search/memory costs.
- Overload changes parameter list, mainly compile-time selection; override replaces compatible instance method at runtime.
- Java passes a copy of reference value; reassigning that copy doesn't change caller variable.
- Optional on APIs where absence is expected; avoid blind
get(). - No; connections are resources to close deterministically (try-with-resources or pool lifecycle).
- Static methods hide and selection depends on reference/class context; no dynamic overriding.
- Read–modify–write race / lost increments;
synchronized,AtomicInteger, or authoritative DB operation depending on scope.
Chấm: 0 = không biết; 1 = đúng định nghĩa, thiếu ví dụ/giới hạn; 2 = đúng + ví dụ/giới hạn. Mục tiêu thực dụng: ≥16/20, trong đó câu (1), (2), (5), (10) không được 0.
Checkpoint 08A: tự làm 08A.4 và trả lời 10 câu mock đạt chuẩn, giải thích bằng 2–4 câu tiếng Anh ngắn với ít nhất 4 câu bất kỳ. Khi đã đạt, không đọc lại toàn module; chỉ flashcard lỗi.
🎙️ SPEAKING LAB V5.2 — 08A. Java Core + OOP
Thứ tự sử dụng: PRETEST → WATCH & DO ngay trong phần kiến thức phía trên → LISTEN/SHADOW → FREE SPEAK → FOLLOW-UP → feedback. Không mở đáp án trước lượt nói đầu.
Những ý kỹ thuật phải hiểu trước khi nói: static/instance; Java pass-by-value; equals/hashCode; polymorphism; Collections; thread safety.
Từ đơn → cụm nói được (chỉ chọn 3–5 cụm để ôn hôm nay):
| Useful chunk | Nghĩa |
|---|---|
belong to the class |
thuộc về class |
compare object identity |
so sánh định danh object |
override an instance method |
ghi đè instance method |
preserve the equality contract |
giữ đúng quy ước equality |
1. PRETEST + WATCH + DO
Đã được chia nhỏ: 30 cặp Q&A của mô-đun này được đặt sau từng mục lý thuyết ở phía trên (MICRO SPEAK V5.2). Không đọc lại toàn bộ câu hỏi ở đây; chọn 3 câu khó nhất để làm lại không nhìn.
2. LISTEN → SHADOW
A — LISTEN & SHADOW (3–4 phút): Ẩn chữ; dùng TTS/Voice đọc lần lượt các câu sau. Lượt 1 nghe và tóm tắt ý; lượt 2–3 bắt chước nhịp nói, rồi nói lại không nhìn.
- Static fields belong to the class rather than one object, but that does not make them thread-safe.
- Equal objects must return the same hash code under the equals and hashCode contract.
3. COMPLETE ORALLY
B — COMPLETE ORALLY (1–2 phút): Điền bằng giọng nói, không cần viết câu hoàn chỉnh trước.
In Java, ___ means . For example, . However, it does not guarantee ___.
4. FREE SPEAK + FOLLOW-UP — ôn các micro-lab
Lấy ngẫu nhiên 2 câu cơ chế + 1 câu tình huống đã làm trong các MICRO SPEAK phía trên. Không đọc script; câu nào sai phải sửa kèm một ví dụ/code/test.
Mã câu trong mô-đun: Q096, Q092, Q110, Q097, Q098, Q093, Q099, Q104, Q119, Q105, Q100, Q120, Q111, Q094, Q121, Q106, Q107, Q108, Q109, Q095, Q112, Q101, Q113, Q114, Q115, Q116, Q117, Q118, Q102, Q103.
6. REPEAT + FEEDBACK — checkpoint
E — REPEAT + FEEDBACK: Chọn câu khó nhất ở phần FREE SPEAK, nói 3 lượt (45–60 giây → 30–45 giây → 20–30 giây ở L1; tăng thời lượng ở L2), giữ ý chính và một test/example. Mở câu trả lời ngay dưới câu hỏi sau lượt 1; mỗi lượt chỉ sửa tối đa 2 lỗi.
- Thời lượng mục tiêu: L1: 2–4 câu/cặp khái niệm; L2: 90 giây với ví dụ code và lỗi hay gặp.
- Điều kiện qua bài: Nói đúng static/equals/hashCode, override/overload, Java pass-by-value; không nói static = thread-safe.
- Điểm dễ nói sai / hiểu sai: Java luôn pass-by-value, kể cả khi value được copy là reference tới object.
| Self-check (đánh dấu sau khi nói) | Yes/No |
|---|---|
| Tôi giải đúng kiến thức và nêu được ví dụ / failure / test cần thiết | [ ] |
| Tôi hiểu câu hỏi khi nghe, hoặc hỏi lại đúng chỗ | [ ] |
| Tôi tự nói không nhìn script; có mở đầu và kết luận rõ | [ ] |
| Tôi xử lý được ít nhất 1 follow-up mới | [ ] |
Mẫu trả lời dài V4 (tùy chọn; xem sau khi tự nói)
Show sample only after speaking
One possible answer (~40–90 words):
In Java, == checks whether two object references point to the same object, while equals can express logical equality. When overriding equals, we must keep the hashCode contract, so equal objects have the same hash code. Static fields belong to the class, but they are not automatically thread-safe. If multiple threads modify a shared counter, we still need appropriate synchronization or an atomic operation.
Knowledge guardrail: Java luôn pass-by-value, kể cả khi value được copy là reference tới object.
Reverse recall: Che sample; nói lại bằng từ của mình rồi trả lời follow-up số 2 trong Speaking Lab 08A.
MÔ-ĐUN 08B [CORE][JAVA BACKEND] — Spring Boot + JPA/Hibernate: từ HTTP request đến database
Vị trí: học sau 08A và Mô-đun 04 (SQL/transaction). Không cần biết microservices/Kafka/Kubernetes để hoàn thành. Mục tiêu là giải thích và sửa được một luồng Spring Boot đơn giản, sau đó phát hiện những lỗi ORM/transaction phổ biến.
08B.0. PRETEST — 7 câu (6 phút)
@Servicevà@Repositorytự tạo object khác gì vớinew UserService(...)?- Bean là gì? Vì sao có hai beans cùng type thì constructor injection có thể không rõ chọn bean nào?
@Validở Controller có thay thế được check “email đã tồn tại trong DB” không?JpaRepository.findById(id)trả về gì? Vì sao không nên tự gọi.get()mù?- Vì sao có
@Transactionalmà hai requests vẫn có thể cùng mua món hàng cuối cùng? - Vì sao vòng lặp
for (Order o : orders) o.getCustomer().getName()có thể tạo N+1 queries? flush()đồng nghĩa vớicommit()chưa?@Transactionalcó rollback với mọi checked exception theo mặc định không?
Nếu sai nhiều: học 08B.1 → 08B.4 theo thứ tự; nếu đúng gần hết: làm LAB 08C và MOCK 08B.7 trước.
08B.1. Spring Container, IoC, DI, Beans — ví dụ đơn giản
WATCH — lần theo nguồn tạo object:
@Service
public class BookingService {
private final BookingRepository repository;
public BookingService(BookingRepository repository) {
this.repository = repository;
}
}
@Repository
public class BookingRepository {
// Data access methods
}
- IoC: quyền điều phối việc khởi tạo/wiring đối tượng chuyển sang framework/container.
- Dependency Injection: dependency được cung cấp cho object (ở đây qua constructor), thay vì tự
newbên trong business class. - Bean: object được Spring IoC container quản lý theo bean definition/scope; stereotype
@Component,@Service,@Repository,@Controllergiúp đăng ký bean qua component scanning khi thuộc phạm vi quét.@SpringBootApplicationcó cơ chế component scan mặc định từ package cấu hình. - Constructor injection giúp dependency bắt buộc rõ ràng, dễ test với fake/mock; với class chỉ có một constructor, Spring hiện đại không đòi
@Autowiredtrên constructor đó. @Bean+@Configuration: đăng ký object từ factory method, hữu ích với class của thư viện hoặc khi cần cấu hình cụ thể.- Scope: singleton mặc định là một bean instance trên một Spring container (không phải singleton toàn hệ phân tán). Singleton bean có mutable shared fields phải quan tâm concurrency.
@Repositorycó vai trò mô tả persistence layer và tham gia exception translation trong các điều kiện tích hợp phù hợp; annotation không tự làm một class thường thành CRUD repository.
WATCH — một bean từ thư viện Java:
@Configuration
class TimeConfig {
@Bean
Clock applicationClock() { return Clock.systemUTC(); }
}
@Service
class DeadlineService {
private final Clock clock;
DeadlineService(Clock clock) { this.clock = clock; }
boolean expired(Instant until) { return Instant.now(clock).isAfter(until); }
}
COMPLETE: Có Clock.systemUTC() và Clock.systemDefaultZone() đều đăng ký với tên khác nhau, cùng type Clock. Spring biết inject cái nào thế nào?
Đáp án COMPLETE
Dùng @Qualifier("beanName") trên injection point hoặc @Primary trên bean mặc định; xác nhận bean name/qualifier thật trong config. Không nên nói Spring tự chọn ngẫu nhiên. Trong các cấu hình cụ thể, tên parameter và cấu hình autowiring có thể tham gia resolution, nhưng tốt nhất explicit khi học.
DO: Viết một @Service nhận Clock qua constructor và có String nowIso() trả UTC instant. Nói một lợi ích khi unit test.
Đáp án DO
@Service
class TimeService {
private final Clock clock;
TimeService(Clock clock) { this.clock = clock; }
String nowIso() { return Instant.now(clock).toString(); }
}
Test có thể inject Clock.fixed(...) để kết quả thời gian deterministic. Cần import từ java.time và Spring context phù hợp.
MICRO SPEAK V5.2 — sau mục 08B.1 · 7 Q&A. Chỉ làm khi đã hiểu ví dụ/code ở ngay phía trên. Mỗi lượt chọn tối đa 4–6 câu; nếu nhiều hơn, chia 2 lượt.
SHADOW: Spring is a framework and ecosystem for building applications. (nghe và nhại 2 lần). Sau đó che đáp án, tự trả lời bằng tiếng Anh rồi mới mở mẫu.
FREE SPEAK — định nghĩa / cơ chế (6 câu)
Q122 · MECHANISM / WHY · ADD V5
TTS 243 · Q: What is the difference between Spring and Spring Boot?
Mở đáp án mẫu Q122 — sau khi tự trả lời
TTS 244 · A: Spring is a framework and ecosystem for building applications. Spring Boot provides conventions, auto-configuration, and starter dependencies to simplify setup and deployment.
Q123 · MECHANISM / WHY · ADD V5
TTS 245 · Q: What is a bean, and how does constructor injection work?
Mở đáp án mẫu Q123 — sau khi tự trả lời
TTS 246 · A: A bean is an object managed by the Spring container. With constructor injection, Spring supplies the required dependencies when the object is created. It makes required dependencies explicit.
Q124 · MECHANISM / WHY · ADD V5
TTS 247 · Q: What's the difference between @Component, @Service, and @Repository?
Mở đáp án mẫu Q124 — sau khi tự trả lời
TTS 248 · A: All three can identify components for Spring to manage. Service communicates a business-layer role, while Repository communicates a persistence-layer role and can enable persistence exception translation. Component is a general stereotype.
Q125 · FOUNDATION · ADD V5
TTS 249 · Q: What is inversion of control in Spring?
Mở đáp án mẫu Q125 — sau khi tự trả lời
TTS 250 · A: Inversion of control means the framework manages object creation and wiring rather than application code creating every dependency. Dependency injection is a common way to implement it.
Q126 · MECHANISM / WHY · ADD V5
TTS 251 · Q: Why is constructor injection often preferred over field injection?
Mở đáp án mẫu Q126 — sau khi tự trả lời
TTS 252 · A: Constructor injection exposes required dependencies and makes them easier to provide in tests. It also supports immutable dependency fields. I would avoid injecting a long list of unrelated services into one class.
Q127 · FOUNDATION · ADD V5
TTS 253 · Q: What is Spring Boot auto-configuration?
Mở đáp án mẫu Q127 — sau khi tự trả lời
TTS 254 · A: Auto-configuration registers useful beans based on the dependencies, properties, and other beans available. It reduces manual configuration while still allowing explicit customization.
FOLLOW-UP — case / phản biện (1 câu)
Q128 · SCENARIO / FOLLOW-UP · ADD V5
TTS 255 · Q: What happens if two beans have the same type?
Mở đáp án mẫu Q128 — sau khi tự trả lời
TTS 256 · A: Injection by type may be ambiguous when several beans qualify. I can use a qualifier or select a primary bean to make the dependency clear.
DO → TRANSFER: quay lại bài thực hành ngay phía trên; đổi một dữ kiện và giải thích hệ quả bằng tiếng Anh. Ghi một lỗi kiến thức và một lỗi nói.
08B.2. Request flow, DTO, validation và status codes
WATCH — một luồng cơ bản:
HTTP POST /api/products
→ @RestController (JSON body → request DTO)
→ Bean Validation @Valid (shape/range)
→ @Service (business rules, authorization, DB checks)
→ repository/JPA/SQL
→ transaction commit
→ response DTO + HTTP 201 hoặc lỗi theo API contract
Ví dụ code học concept (bỏ qua imports và exception handler; chưa phải API hoàn chỉnh):
record CreateProductRequest(
@NotBlank String sku,
@NotNull @Positive BigDecimal price
) {}
record ProductResponse(Long id, String sku, BigDecimal price) {}
@RestController
@RequestMapping("/api/products")
class ProductController {
private final ProductService service;
ProductController(ProductService service) { this.service = service; }
@PostMapping
ResponseEntity<ProductResponse> create(@Valid @RequestBody CreateProductRequest req) {
ProductResponse saved = service.create(req);
return ResponseEntity.status(HttpStatus.CREATED).body(saved);
}
}
@RestControllerthường serialize return value thành response body;@RequestMappingtrên class là base path,@PostMappinggắn HTTP POST.@RequestBodydeserializes JSON sang DTO;@Validkích hoạt Bean Validation khi dependency/provider validation đã cấu hình.@NotBlank,@NotNull,@Positivelà Jakarta Bean Validation constraints trong Spring Boot 3.- Validation trên DTO không đảm bảo SKU unique khi hai requests đồng thời; dùng rule/constraint ở DB và xử lý constraint violation phù hợp.
- Không trả trực tiếp JPA Entity một cách máy móc: có thể leak dữ liệu, gặp lazy loading, recursive JSON và ràng buộc API với persistence model. Dùng response DTO.
@RestControllerAdvice+@ExceptionHandlerđể chuyển các lỗi ứng dụng thành error response thống nhất; không bắt mọi exception rồi trả 200.
COMPLETE: JSON { "sku":"", "price":-5 } gửi vào API trên: có nên tạo product? Lỗi thuộc DTO validation hay business rule trong DB?
Đáp án COMPLETE
Không; @NotBlank và @Positive vi phạm validation boundary, thường Spring trả 400 khi validation lỗi với setup MVC/validation chuẩn. Riêng “SKU đã tồn tại” cần kiểm tra nghiệp vụ và unique DB constraint: kiểm tra trước không đủ chống race.
DO: Thiết kế POST /api/tasks với title không blank, priority 1–5, chỉ người có role MEMBER được tạo; nêu ít nhất 3 HTTP responses và 3 tests. Không cần viết Spring Security hoàn chỉnh.
Đáp án DO
DTO có @NotBlank title, @NotNull @Min(1) @Max(5) priority; security context/service kiểm role. Thành công 201; malformed/invalid 400; chưa đăng nhập 401; đã đăng nhập không có quyền 403. Tests: title blank → 400; priority 6 → 400; user không có role → 403; member hợp lệ → 201 và kiểm tra DB. Cách lấy identity/role tùy kiến trúc, không tin client gửi role=MEMBER như chứng cứ.
MICRO SPEAK V5.2 — sau mục 08B.2 · 7 Q&A. Chỉ làm khi đã hiểu ví dụ/code ở ngay phía trên. Mỗi lượt chọn tối đa 4–6 câu; nếu nhiều hơn, chia 2 lượt.
SHADOW: The controller handles the HTTP request and input validation. (nghe và nhại 2 lần). Sau đó che đáp án, tự trả lời bằng tiếng Anh rồi mới mở mẫu.
FREE SPEAK — định nghĩa / cơ chế (6 câu)
Q129 · MECHANISM / WHY · BASE V4
TTS 257 · Q: Walk me through Controller → Service → Repository in Spring Boot.
Mở đáp án mẫu Q129 — sau khi tự trả lời
TTS 258 · A: The controller handles the HTTP request and input validation. The service applies business rules. The repository reads and writes data. Spring manages these components and injects their dependencies.
Q130 · FOUNDATION · BASE V4
TTS 259 · Q: Can @Valid enforce uniqueness across concurrent requests?
Mở đáp án mẫu Q130 — sau khi tự trả lời
TTS 260 · A: No. Validation annotations do not reliably enforce uniqueness across concurrent requests. I would use a database unique constraint and handle its violation.
Q131 · FOUNDATION · ADD V5
TTS 261 · Q: Can @Valid prevent two users from registering the same email concurrently?
Mở đáp án mẫu Q131 — sau khi tự trả lời
TTS 262 · A: No. Validation can check request data, but it cannot reliably protect against a race between two inserts. I would enforce email uniqueness in the database and handle constraint violations.
Q132 · FOUNDATION · ADD V5
TTS 263 · Q: What does @RestController do?
Mở đáp án mẫu Q132 — sau khi tự trả lời
TTS 264 · A: RestController combines controller behavior with response-body serialization for request handlers. Its methods commonly return objects that Spring converts to JSON according to the configured converters.
Q133 · MECHANISM / WHY · ADD V5
TTS 265 · Q: What is the difference between @RequestParam, @PathVariable, and @RequestBody?
Mở đáp án mẫu Q133 — sau khi tự trả lời
TTS 266 · A: RequestParam reads values from request parameters. PathVariable binds values from the URL path. RequestBody reads and converts the HTTP request body.
Q134 · MECHANISM / WHY · ADD V5
TTS 267 · Q: How does validation work with @Valid in a Spring controller?
Mở đáp án mẫu Q134 — sau khi tự trả lời
TTS 268 · A: Spring can validate a request DTO when it is bound to a validated method parameter. I would define constraints such as not blank and positive values. Business invariants still need service and database protection.
FOLLOW-UP — case / phản biện (1 câu)
Q135 · SCENARIO / FOLLOW-UP · ADD V5
TTS 269 · Q: How would you secure a Spring REST endpoint?
Mở đáp án mẫu Q135 — sau khi tự trả lời
TTS 270 · A: I would authenticate the caller and then enforce the required permission or resource ownership. I would also validate inputs and test both authorized and forbidden requests. Authentication alone is not enough.
DO → TRANSFER: quay lại bài thực hành ngay phía trên; đổi một dữ kiện và giải thích hệ quả bằng tiếng Anh. Ghi một lỗi kiến thức và một lỗi nói.
08B.3. JPA/Hibernate, Repository và entity lifecycle
WATCH — phân biệt:
- JPA (Jakarta Persistence): specification/API cho object–relational persistence; Hibernate là một implementation phổ biến. Spring Data JPA cung cấp repository abstraction trên JPA.
- Entity: class mapping table/rows;
@Entity,@Id,@GeneratedValue; object references/collections có thể mapping relationships. - Persistence context quản lý managed entities; thay đổi của managed entity có thể được dirty-checking và đồng bộ xuống DB khi flush, trong transaction phù hợp.
save()không đồng nghĩa ngay lập tức commit.flush()đồng bộ SQL cần thiết với DB trong transaction nhưng không commit; rollback vẫn có thể hủy thay đổi chưa commit.findById()thường trảOptional<T>;findBy...theo naming convention được Spring Data suy ra từ property names, không phải JPA core tự tạo.@ManyToOnemặc định JPA là EAGER;@OneToManymặc định LAZY. Với API backend, thường khai báo fetch rõ ràng và thiết kế query theo use case thay vì dựa máy móc vào defaults.
WATCH — entity giản lược để học:
@Entity
class Task {
@Id @GeneratedValue(strategy = GenerationType.IDENTITY)
private Long id;
@Column(nullable = false)
private String title;
@ManyToOne(fetch = FetchType.LAZY, optional = false)
private Workspace workspace;
protected Task() {} // cho JPA
Task(String title, Workspace workspace) {
this.title = title;
this.workspace = workspace;
}
void rename(String title) { this.title = title; }
}
interface TaskRepository extends JpaRepository<Task, Long> {
List<Task> findByWorkspaceId(Long workspaceId);
}
Đây chỉ là ví dụ chưa đủ code để chạy độc lập: cần Workspace entity, imports, config, dependencies, schema và API. Dùng nó để giải thích mapping/relationship/repository, không nhận là production-ready.
COMPLETE: Service @Transactional tìm Task với findById, gọi task.rename("X") rồi return, không thấy save(task). Khi nào DB vẫn được update?
Đáp án COMPLETE
Khi Task là managed entity trong persistence context và transaction flush changes phù hợp (dirty checking), có thể update dù không gọi save lần hai. Nếu object detached, không có transaction thích hợp, hoặc transaction rollback thì không thể kết luận update sẽ commit.
DO: Vì sao API GET /tasks có thể bị lỗi hoặc chậm nếu trả thẳng List<Task> rồi serializer truy cập task.workspace.name? Nêu hai cách sửa.
Đáp án DO
Có thể phát sinh lazy initialization ngoài persistence context (tùy OSIV) hoặc N+1 queries khi serializer chạm lazy association từng row; thêm rủi ro serialization cycle/data exposure. Chọn projection/DTO query lấy đúng fields, hoặc fetch join/@EntityGraph có kiểm soát rồi map sang DTO trong service transaction. Không mặc định EAGER tất cả; fetch join collection + pagination cần cân nhắc riêng.
MICRO SPEAK V5.2 — sau mục 08B.3 · 10 Q&A. Chỉ làm khi đã hiểu ví dụ/code ở ngay phía trên. Mỗi lượt chọn tối đa 4–6 câu; nếu nhiều hơn, chia 2 lượt.
SHADOW: Flush sends pending SQL changes to the database, but the transaction may still be open. (nghe và nhại 2 lần). Sau đó che đáp án, tự trả lời bằng tiếng Anh rồi mới mở mẫu.
FREE SPEAK — định nghĩa / cơ chế (9 câu)
Q136 · MECHANISM / WHY · BASE V4
TTS 271 · Q: What is the difference between flush and commit in JPA?
Mở đáp án mẫu Q136 — sau khi tự trả lời
TTS 272 · A: Flush sends pending SQL changes to the database, but the transaction may still be open. Commit makes the transaction complete and its changes durable according to the database guarantees.
Q137 · MECHANISM / WHY · BASE V4
TTS 273 · Q: Why can an ORM loop cause an N+1 query problem?
Mở đáp án mẫu Q137 — sau khi tự trả lời
TTS 274 · A: An N plus one problem happens when one query loads a list and extra queries load related data for each item. I would inspect SQL logs and use a suitable fetch plan or projection.
Q138 · MECHANISM / WHY · ADD V5
TTS 275 · Q: What is the difference between JPA and Hibernate?
Mở đáp án mẫu Q138 — sau khi tự trả lời
TTS 276 · A: JPA, now under Jakarta Persistence, defines an API and specification for persistence. Hibernate is an implementation of that specification and provides additional features.
Q139 · MECHANISM / WHY · ADD V5
TTS 277 · Q: What happens when you modify a managed JPA entity inside a transaction?
Mở đáp án mẫu Q139 — sau khi tự trả lời
TTS 278 · A: The persistence provider can detect changes to a managed entity and write them during flush. If the transaction commits successfully, those database changes can persist without an explicit save call for every field change.
Q140 · MECHANISM / WHY · ADD V5
TTS 279 · Q: What is lazy loading, and when can it fail?
Mở đáp án mẫu Q140 — sau khi tự trả lời
TTS 280 · A: Lazy loading fetches related data when the application accesses it. It can fail when the required persistence context is no longer available. I would plan the fetch strategy for each use case.
Q141 · MECHANISM / WHY · ADD V5
TTS 281 · Q: What is the difference between a JPA entity and a DTO?
Mở đáp án mẫu Q141 — sau khi tự trả lời
TTS 282 · A: An entity represents a persistence-managed domain object. A DTO is shaped for transferring data between boundaries. I usually avoid returning entities directly when it could expose fields or trigger unwanted lazy loading.
Q142 · FOUNDATION · ADD V5
TTS 283 · Q: What is the persistence context in JPA?
Mở đáp án mẫu Q142 — sau khi tự trả lời
TTS 284 · A: The persistence context tracks managed entities and their identities within a unit of work. It can reuse already managed objects and detect changes before a flush.
Q143 · MECHANISM / WHY · ADD V5
TTS 285 · Q: What is the difference between persist and merge in JPA?
Mở đáp án mẫu Q143 — sau khi tự trả lời
TTS 286 · A: Persist makes a new entity managed so it can be inserted. Merge copies state from a detached entity into a managed instance and returns that managed instance. I would not assume merge reattaches the original object.
Q144 · MECHANISM / WHY · ADD V5
TTS 287 · Q: What is the difference between LAZY and EAGER fetching?
Mở đáp án mẫu Q144 — sau khi tự trả lời
TTS 288 · A: Lazy fetching defers loading an association until needed. Eager fetching requires the association to be available, but it does not promise one SQL query. I would choose fetch plans based on the use case.
FOLLOW-UP — case / phản biện (1 câu)
Q145 · SCENARIO / FOLLOW-UP · ADD V5
TTS 289 · Q: When would you use a fetch join or an EntityGraph?
Mở đáp án mẫu Q145 — sau khi tự trả lời
TTS 290 · A: I would use them when one query needs selected related entities and extra lazy loads are costly. I would be careful with paging queries that join large collections. A DTO projection may be simpler for list views.
DO → TRANSFER: quay lại bài thực hành ngay phía trên; đổi một dữ kiện và giải thích hệ quả bằng tiếng Anh. Ghi một lỗi kiến thức và một lỗi nói.
08B.4. @Transactional: rollback, concurrency và self-invocation
WATCH — những điều phải nói chính xác:
| Câu hỏi | Cần trả lời |
|---|---|
| Transaction boundary nằm đâu? | Thường ở service/use-case cho nhóm DB operations cần nhất quán |
@Transactional có rollback tất cả lỗi? |
Mặc định rollback với RuntimeException và Error; checked exception cần cấu hình như rollbackFor nếu phù hợp |
Method trong cùng class gọi method @Transactional? |
Với proxy-based transaction mặc định, self-invocation thường không đi qua proxy nên annotation ở method được gọi có thể không có tác dụng như kỳ vọng |
flush() có phải commit? |
Không. Flush có thể gửi SQL, commit vẫn chưa xảy ra |
@Transactional có khóa tất cả records? |
Không; isolation, SQL statements, DB locks và constraints quyết định concurrency guarantees |
| Có thể rollback email/HTTP call bên ngoài? | Không phải nhờ transaction DB; cần workflow/outbox/idempotency/reconciliation tùy contract |
readOnly=true? |
Hint/optimization tùy transaction manager/ORM, không được coi là bảo đảm bảo mật hoặc cấm mọi write |
WATCH — ví dụ self-invocation:
@Service
class ImportService {
public void importAll() {
applyOneBatch(); // call nội bộ, không đi qua transactional proxy mặc định
}
@Transactional(propagation = Propagation.REQUIRES_NEW)
public void applyOneBatch() { /* DB writes */ }
}
Không nên tự kết luận mỗi applyOneBatch có một transaction riêng. Có thể tách BatchWorker thành Spring bean riêng và gọi qua injected bean, dùng TransactionTemplate hoặc thiết kế transaction boundary phù hợp. Khi giải thích, luôn nhắc proxy mode đang dùng.
COMPLETE: Một service @Transactional đọc stock=1, kiểm stock > 0, trừ 1 và ghi. Hai requests cùng chạy, đều commit được trong cấu hình READ COMMITTED và không khóa/điều kiện bảo vệ. Vì sao?
Đáp án COMPLETE
@Transactional bảo đảm transaction boundary nhưng không tự làm read-check-write thành atomic business condition dưới READ COMMITTED. Hai transactions có thể cùng đọc giá trị cũ (lost update/oversell tùy update strategy). Giải pháp: UPDATE ... WHERE stock >= qty kiểm affected rows, hoặc SELECT FOR UPDATE rồi kiểm lại, unique constraints khi phù hợp, cộng concurrency test.
DO — tình huống thật: createBooking() trong transaction ghi Booking, rồi gọi provider external và gặp timeout. Nếu transaction rollback, có chắc provider chưa tạo booking không? Bạn sẽ cải tiến như thế nào?
Đáp án DO
Không thể kết luận điều gì về provider từ local DB rollback. External side effects không nằm trong cùng ACID transaction. Hướng giải tùy API contract: dùng provider idempotency key, trạng thái PENDING/UNKNOWN, status lookup/reconciliation; tránh giữ DB transaction dài qua network nếu không cần; outbox/asynchronous flow nếu hợp nghiệp vụ. Không retry mù khi outcome unknown.
MICRO SPEAK V5.2 — sau mục 08B.4 · 4 Q&A. Chỉ làm khi đã hiểu ví dụ/code ở ngay phía trên. Mỗi lượt chọn tối đa 4–6 câu; nếu nhiều hơn, chia 2 lượt.
SHADOW: No. (nghe và nhại 2 lần). Sau đó che đáp án, tự trả lời bằng tiếng Anh rồi mới mở mẫu.
FREE SPEAK — định nghĩa / cơ chế (2 câu)
Q146 · FOUNDATION · BASE V4
TTS 291 · Q: Does @Transactional automatically prevent all inventory races?
Mở đáp án mẫu Q146 — sau khi tự trả lời
TTS 292 · A: No. Transactional does not automatically protect every check-then-insert race. I would choose a suitable isolation level, lock, constraint, or atomic update and test concurrent requests.
Q147 · FOUNDATION · ADD V5
TTS 293 · Q: What is the default rollback behavior of @Transactional?
Mở đáp án mẫu Q147 — sau khi tự trả lời
TTS 294 · A: By default, Spring rolls back for RuntimeException and Error. Checked exceptions do not trigger rollback by default. I can configure rollback rules when business behavior requires it.
FOLLOW-UP — case / phản biện (2 câu)
Q148 · SCENARIO / FOLLOW-UP · ADD V5
TTS 295 · Q: Does @Transactional guarantee that two requests won't oversell inventory?
Mở đáp án mẫu Q148 — sau khi tự trả lời
TTS 296 · A: No. Transaction boundaries alone do not prevent every read-check-write race. I would use appropriate database protection, such as an atomic update, lock, or constraint, and verify the outcome with a concurrent test.
Q149 · SCENARIO / FOLLOW-UP · ADD V5
TTS 297 · Q: Why might @Transactional not work on a method called from within the same class?
Mở đáp án mẫu Q149 — sau khi tự trả lời
TTS 298 · A: In common proxy-based Spring transaction management, a call within the same object bypasses the transactional proxy. The expected transaction advice may not run. I would restructure the boundary or use the appropriate configuration.
DO → TRANSFER: quay lại bài thực hành ngay phía trên; đổi một dữ kiện và giải thích hệ quả bằng tiếng Anh. Ghi một lỗi kiến thức và một lỗi nói.
08B.5. N+1, query tuning, authorization và tests
WATCH — N+1: query lấy N orders, sau đó N lần lazy-load customer: 1 query danh sách + N query association. Không phải mọi lần truy cập @ManyToOne đều gây N+1; phụ thuộc fetch plan, persistence context, dữ liệu được lấy và implementation.
Giải pháp phải chọn theo nhu cầu: DTO projection cho list endpoints; fetch join hoặc EntityGraph khi muốn association; kiểm Hibernate SQL logs / query count / actual query plan; tránh mặc định fetch tất cả collection trong page query.
Authorization không giống authentication: biết người dùng là ai chưa có nghĩa được sửa task của workspace khác. Truy vấn theo workspace_id + kiểm membership/role, kết hợp domain rule và DB constraints. Object ID khó đoán không thay thế authorization.
Kiểm thử nên phân biệt:
| Loại | Dùng khi | Chú ý |
|---|---|---|
| Unit test với Mockito/fakes | Policy/service logic không cần khởi động full Spring | Không chứng minh DB/JPA behavior |
@WebMvcTest |
MVC/controller validation, status/error mapping | Thường mock service dependencies; không kiểm toàn flow DB |
@DataJpaTest |
Entity/repository mapping/query | Test transaction và DB compatibility; nếu dựa DB-specific SQL, cần môi trường gần production |
@SpringBootTest + Testcontainers |
Integration nhiều components; transaction/concurrency | Chậm hơn; cần setup thật và assert invariants |
DO — phát hiện lỗi theo thứ tự: Endpoint /api/workspaces/{w}/tasks trả chậm khi số task lớn; sau đó phát hiện user A có thể đọc task của workspace B. Nêu hai nhóm nguyên nhân và đề xuất test.
Đáp án DO
Chậm: đo số SQL queries/logs, xem N+1, pagination/index và query plan; không mặc định “Redis giải quyết hết”. Đọc chéo workspace: xác minh identity, membership/role check, tenant-scoped query predicate (workspaceId) và test A đọc tài nguyên của B phải 403/404 theo contract. Query performance và access control là hai lỗi khác nhau.
MICRO SPEAK V5.2 — sau mục 08B.5 · 2 Q&A. Chỉ làm khi đã hiểu ví dụ/code ở ngay phía trên. Mỗi lượt chọn tối đa 4–6 câu; nếu nhiều hơn, chia 2 lượt.
SHADOW: N plus one happens when one query loads a list and additional queries fetch related data item by item. (nghe và nhại 2 lần). Sau đó che đáp án, tự trả lời bằng tiếng Anh rồi mới mở mẫu.
FOLLOW-UP — case / phản biện (2 câu)
Q150 · SCENARIO / FOLLOW-UP · ADD V5
TTS 299 · Q: What is the N+1 query problem and how would you detect it?
Mở đáp án mẫu Q150 — sau khi tự trả lời
TTS 300 · A: N plus one happens when one query loads a list and additional queries fetch related data item by item. I would inspect SQL logs, query counts, and endpoint performance. Then I would choose a projection or an appropriate fetch strategy.
Q151 · SCENARIO / FOLLOW-UP · ADD V5
TTS 301 · Q: How would you test a service that uses DB transactions and external APIs?
Mở đáp án mẫu Q151 — sau khi tự trả lời
TTS 302 · A: I would use integration tests with a real test database for transaction behavior. I would simulate external API success, timeout, and duplicate responses. Then I would verify both database state and recovery behavior.
DO → TRANSFER: quay lại bài thực hành ngay phía trên; đổi một dữ kiện và giải thích hệ quả bằng tiếng Anh. Ghi một lỗi kiến thức và một lỗi nói.
08B.6. LAB Spring/SQL tích hợp (18–25 phút)
Đề mới: Implement an API to move a task to another column. Each column has a maximum number of active tasks. Only workspace members may move tasks.
Phần A (5 phút): ghi actor, Task, Column, Membership, API, DTO và 3 HTTP statuses.
Phần B (7 phút): nêu Controller/Service/Repository responsibilities, transaction boundary, 2 concurrency bugs, hướng phòng ngừa.
Phần C (5 phút): viết query SQL lấy các columns và số lượng active tasks; dùng LEFT JOIN để vẫn có column trống.
Phần D (3 phút): nói 3–5 câu tiếng Anh giải thích flow và một trade-off. Không nhìn V-Core trả lời mẫu trước.
Lời giải tham khảo — chỉ xem sau khi thử
A. POST /api/workspaces/{w}/tasks/{t}/moves, DTO {targetColumnId, expectedVersion}. 200 khi move OK, 403 user không có quyền, 404 task không thuộc workspace, 409 WIP đầy hoặc stale version.
B. Controller DTO validation; Service kiểm member, status, WIP/version và transaction; Repository lookup với workspace_id, lock target column khi cần, update Task/version, ghi audit. Hai moves của hai tasks khác nhau vào chỗ cuối có thể vượt WIP nếu chỉ check count; hai moves của cùng task có thể gây stale update nếu thiếu version/concurrency control. Tách cách bảo vệ business aggregate khỏi cách bảo vệ một row.
C. Ví dụ PostgreSQL:
SELECT c.id, COUNT(t.id) AS active_count
FROM workflow_columns c
LEFT JOIN tasks t ON t.column_id = c.id AND t.status = 'ACTIVE'
WHERE c.workspace_id = :workspaceId
GROUP BY c.id;
AND t.status = 'ACTIVE' trong ON giúp giữ cả columns không có task active. Đây là query minh họa; schema thật có thể cần workspace_id trên task, tenant checks và index tương ứng.
D. “The controller validates the move request. The service checks workspace membership and the task version. It must protect the target column's WIP limit against concurrent moves, not only update one task. I would verify this with two simultaneous requests and check the final count.”
08B.7. MOCK Spring/JPA — 12 câu chưa có đáp án lộ sẵn (15 phút)
- What is the difference between Spring and Spring Boot?
- What is a bean, and how does constructor injection work?
- What happens if two beans have the same type?
- What's the difference between @Component, @Service, and @Repository?
- Can @Valid prevent two users from registering the same email concurrently?
- What is the difference between JPA and Hibernate?
- What happens when you modify a managed JPA entity inside a transaction?
- What is lazy loading, and when can it fail?
- What is the N+1 query problem and how would you detect it?
- Does @Transactional guarantee that two requests won't oversell inventory?
- Why might @Transactional not work on a method called from within the same class?
- How would you test a service that uses DB transactions and external APIs?
Rubric / đáp án ngắn cho 12 câu
- Spring là framework/ecosystem; Spring Boot cung cấp auto-configuration, starters và conventions để phát triển/chạy nhanh, vẫn trên nền Spring.
- Bean do container quản lý; constructor injection cung cấp required dependencies và giúp test.
- Có thể ambiguous, dùng
@Qualifier/@Primaryhoặc config rõ. - Đều là stereotypes; Service nêu business layer, Repository cho persistence semantics/exception translation, Component tổng quát.
- Không;
@Validcheck input, unique DB constraint + error handling bảo vệ race. - JPA specification, Hibernate implementation.
- Dirty checking/flush trong persistence context, commit/rollback vẫn quyết định durability cuối.
- Association có thể tải khi truy cập; ngoài persistence context có thể exception; load nhiều lần có thể N+1.
- 1 query list + N association queries; đo SQL logs/count, dùng projection/appropriate fetch plan.
- Không; cần concurrency strategy DB và tests.
- Self-invocation bỏ qua proxy-based transactional advice mặc định.
- Unit cho business logic, integration Testcontainers cho DB, mock/fake provider hoặc sandbox cho external contract, test failure/timeout và đảm bảo không claim đã rollback remote call.
Chấm: mỗi câu 0–2 điểm như 08A; mục tiêu ≥19/24, đặc biệt 5, 9–11 không được 0. Nếu chưa đạt, mở đúng 08B.2–5, không đọc lại toàn Foundation.
Checkpoint 08B: làm LAB 08B.6 không xem đáp án; đạt mock; mở một flow thật từ V-Market rồi chỉ được Controller, Service, SQL/Repository, transaction boundary và integration test. Nói rõ code repo dùng JDBC ở flow nào, JPA ở flow nào; không tự nhận V-Market checkout dùng Hibernate nếu code dùng JDBC.
🎙️ SPEAKING LAB V5.2 — 08B. Spring Boot + JPA/Hibernate
Thứ tự sử dụng: PRETEST → WATCH & DO ngay trong phần kiến thức phía trên → LISTEN/SHADOW → FREE SPEAK → FOLLOW-UP → feedback. Không mở đáp án trước lượt nói đầu.
Những ý kỹ thuật phải hiểu trước khi nói: IoC/DI/Bean; controller/service/repository; DTO validation; JPA flush/commit; transaction and N+1.
Từ đơn → cụm nói được (chỉ chọn 3–5 cụm để ôn hôm nay):
| Useful chunk | Nghĩa |
|---|---|
inject a dependency |
tiêm phụ thuộc |
validate the request body |
xác thực dữ liệu request |
persist an entity |
lưu entity qua persistence layer |
trigger additional queries |
gây thêm các query |
1. PRETEST + WATCH + DO
Đã được chia nhỏ: 30 cặp Q&A của mô-đun này được đặt sau từng mục lý thuyết ở phía trên (MICRO SPEAK V5.2). Không đọc lại toàn bộ câu hỏi ở đây; chọn 3 câu khó nhất để làm lại không nhìn.
2. LISTEN → SHADOW
A — LISTEN & SHADOW (3–4 phút): Ẩn chữ; dùng TTS/Voice đọc lần lượt các câu sau. Lượt 1 nghe và tóm tắt ý; lượt 2–3 bắt chước nhịp nói, rồi nói lại không nhìn.
- Spring manages beans and injects dependencies through the application context.
- Flushing changes to the database is not the same as committing a transaction.
3. COMPLETE ORALLY
B — COMPLETE ORALLY (1–2 phút): Điền bằng giọng nói, không cần viết câu hoàn chỉnh trước.
The controller . The service . The repository . A common issue is .
4. FREE SPEAK + FOLLOW-UP — ôn các micro-lab
Lấy ngẫu nhiên 2 câu cơ chế + 1 câu tình huống đã làm trong các MICRO SPEAK phía trên. Không đọc script; câu nào sai phải sửa kèm một ví dụ/code/test.
Mã câu trong mô-đun: Q129, Q136, Q137, Q130, Q146, Q122, Q123, Q128, Q124, Q131, Q138, Q139, Q140, Q150, Q148, Q149, Q151, Q125, Q126, Q127, Q132, Q133, Q134, Q141, Q142, Q143, Q144, Q145, Q147, Q135.
6. REPEAT + FEEDBACK — checkpoint
E — REPEAT + FEEDBACK: Chọn câu khó nhất ở phần FREE SPEAK, nói 3 lượt (45–60 giây → 30–45 giây → 20–30 giây ở L1; tăng thời lượng ở L2), giữ ý chính và một test/example. Mở câu trả lời ngay dưới câu hỏi sau lượt 1; mỗi lượt chỉ sửa tối đa 2 lỗi.
- Thời lượng mục tiêu: L1: nói request flow 30–40 giây; L2: 90 giây về transaction/N+1 kèm test.
- Điều kiện qua bài: Phân biệt JPA spec, Hibernate implementation, Spring Data; hiểu flush != commit và validate != DB constraint.
- Điểm dễ nói sai / hiểu sai: Không nói save/flush luôn commit; không dùng @Transactional thay cho concurrency strategy.
| Self-check (đánh dấu sau khi nói) | Yes/No |
|---|---|
| Tôi giải đúng kiến thức và nêu được ví dụ / failure / test cần thiết | [ ] |
| Tôi hiểu câu hỏi khi nghe, hoặc hỏi lại đúng chỗ | [ ] |
| Tôi tự nói không nhìn script; có mở đầu và kết luận rõ | [ ] |
| Tôi xử lý được ít nhất 1 follow-up mới | [ ] |
Mẫu trả lời dài V4 (tùy chọn; xem sau khi tự nói)
Show sample only after speaking
One possible answer (~40–90 words):
A Spring controller receives the HTTP request and validates its format. The service applies business rules, and the repository accesses the database. Spring manages these components as beans and can inject their dependencies. JPA defines a persistence API, while Hibernate is a common implementation. Flushing may send SQL to the database, but it does not commit the transaction. I would also check for N+1 queries when loading related entities.
Knowledge guardrail: Không nói save/flush luôn commit; không dùng @Transactional thay cho concurrency strategy.
Reverse recall: Che sample; nói lại bằng từ của mình rồi trả lời follow-up số 2 trong Speaking Lab 08B.
LAB 08C [CORE][JAVA BACKEND] — Kiểm tra cuối: code → SQL → English → follow-up
LAB này chỉ 35–45 phút, dùng để kiểm tra năng lực vận dụng chứ không kiểm tra trí nhớ về file. Nếu cần, đổi tên entity / input để tự tạo biến thể.
C1. Java code (10 phút, không dùng AI)
Viết Map<String, Long> summarize(List<String> tags) đếm từ khóa không phân biệt hoa thường, bỏ null/blank, trả map bất kỳ thứ tự. Viết 3 tests (input thường, null/blank, empty). Giải thích complexity theo tổng số ký tự và số phần tử (không chỉ nói O(n) nếu phải trim/lowercase strings).
Tham khảo C1
static Map<String, Long> summarize(List<String> tags) {
Map<String, Long> counts = new HashMap<>();
for (String raw : tags) {
if (raw == null || raw.isBlank()) continue;
String key = raw.trim().toLowerCase(Locale.ROOT);
counts.merge(key, 1L, Long::sum);
}
return counts;
}
Giả sử average hash lookup O(1), work chủ yếu qua các characters để kiểm blank/trim/lowercase, cộng thêm O(m) hash operations cho m phần tử; O(k) map entries cộng bytes/chars của normalized keys. Không đảm bảo O(1) worst-case của HashMap. Test thêm List.of() (không chứa null); muốn test null entries hãy dùng Arrays.asList(null, " A ", "a", "").
C2. SQL (8 phút)
Có users(id,name) và orders(id,user_id,total,status). Viết query liệt kê mọi user với total_paid của các đơn PAID; người không có PAID trả 0. Vì sao đặt điều kiện status trong WHERE có thể làm mất người không có orders?
Tham khảo C2
SELECT u.id, u.name, COALESCE(SUM(o.total), 0) AS total_paid
FROM users u
LEFT JOIN orders o ON o.user_id = u.id AND o.status = 'PAID'
GROUP BY u.id, u.name;
Filter o.status='PAID' tại WHERE loại rows NULL do LEFT JOIN tạo, có thể biến kết quả thành hiệu ứng INNER JOIN cho user không có paid orders. Có cách khác dùng conditional aggregate; kiểm dataset và dialect cụ thể.
C3. Spring scenario (10 phút)
Một endpoint POST /api/bookings dùng DTO validation, @Transactional, findAvailableRoom() rồi lưu booking. Hai requests cùng room/date đều trả 201. Hãy nói tại sao, đề xuất hai phương án bảo vệ, và một integration test chứng minh không overbook.
Tham khảo C3
Read-check-insert race; chỉ có @Transactional không đủ dưới mọi isolation. Có thể dùng DB uniqueness cho (room,date) inventory hold phù hợp domain, hoặc atomic conditional allocation / row lock và check lại trong transaction. Test hai requests chồng lấn qua Testcontainers PostgreSQL, assert chỉ một allocation hợp lệ và DB invariant; cần quyết định status/hold semantics của PENDING trước.
C4. English (5 phút)
Trả lời mỗi câu trong 30–45 giây, không nhìn script:
- Why would you use constructor injection?
- How does your service prevent two users from buying the last item?
- What would happen if the external provider timed out after receiving a request?
Chuẩn: nói đúng ý, ít nhất 1 reason hoặc test, thừa nhận giới hạn khi không có provider status/idempotency. Sau đó ghi 3 lỗi vào error log của tài liệu gốc.
C5. Quy tắc chuyển bài
- Đạt: C1 code đúng + có tests; C2 đúng; C3 phân biệt transaction với concurrency; C4 giao tiếp hiểu được và không trả lời sai bản chất. Chuyển sang project deep dive/mocks, chỉ ôn lỗi.
- Chưa đạt: lỗi Java → 08A; lỗi bean/JPA/transaction → 08B; lỗi SQL → Mô-đun 04; lỗi English → 02/11/LAB D. Không phải đọc lại cả 3.000 dòng.
- JD DSA-heavy: LAB này không thay LeetCode Medium; duy trì vài pattern, tăng cường khi có lịch OA.
🎙️ SPEAKING LAB V5.2 — 08C. Java + SQL + English integrated case
Thứ tự sử dụng: PRETEST → WATCH & DO ngay trong phần kiến thức phía trên → LISTEN/SHADOW → FREE SPEAK → FOLLOW-UP → feedback. Không mở đáp án trước lượt nói đầu.
Những ý kỹ thuật phải hiểu trước khi nói: Read code → explain bug → implement/query → defend design → follow-up.
Từ đơn → cụm nói được (chỉ chọn 3–5 cụm để ôn hôm nay):
| Useful chunk | Nghĩa |
|---|---|
walk through the code |
giải thích code tuần tự |
identify the edge case |
xác định trường hợp biên |
run a concurrent test |
chạy test đồng thời |
explain the trade-off |
giải thích đánh đổi |
1. PRETEST + WATCH + DO
Hoàn thành ít nhất một bài COMPLETE/DO ở phía trên (hoặc giải thích một ví dụ mới). Nếu chưa giải thích được cơ chế bằng tiếng Việt, quay lại bài kỹ thuật trước khi bắt đầu nói.
2. LISTEN → SHADOW
A — LISTEN & SHADOW (3–4 phút): Ẩn chữ; dùng TTS/Voice đọc lần lượt các câu sau. Lượt 1 nghe và tóm tắt ý; lượt 2–3 bắt chước nhịp nói, rồi nói lại không nhìn.
- The current implementation can fail when two requests update the same inventory record.
- I would protect the invariant in the database and verify it with a concurrent test.
3. COMPLETE ORALLY
B — COMPLETE ORALLY (1–2 phút): Điền bằng giọng nói, không cần viết câu hoàn chỉnh trước.
The current code . This can fail when . I would change ___ and test ___.
4. FREE SPEAK — định nghĩa / cơ chế (không nhìn script)
Chọn 3–5 câu/lượt trong 5 câu sau. Đáp án được thu gọn dưới từng câu; chỉ mở sau khi đã nói.
Q152 · MECHANISM / WHY · BASE V4
TTS 303 · Q: Explain the main bug you found in the LAB 08C code.
Mở đáp án mẫu Q152 — sau khi tự trả lời
TTS 304 · A: Two booking requests can check the same available room before either saves a booking. Both may then return success. The bug is a read-check-write race that can cause overbooking.
Q153 · FOUNDATION · BASE V4
TTS 305 · Q: What SQL query or constraint would support your fix?
Mở đáp án mẫu Q153 — sau khi tự trả lời
TTS 306 · A: I could use an atomic conditional inventory update and check the affected row count. Another option is a database constraint or row lock with a suitable transaction. The choice depends on the schema.
Q154 · FOUNDATION · BASE V4
TTS 307 · Q: Which part of your fix is guaranteed by a database transaction, and which part is not?
Mở đáp án mẫu Q154 — sau khi tự trả lời
TTS 308 · A: A transaction can make the local database changes atomic. It does not automatically make a separate external API call atomic or prevent every concurrency race without the right database protection.
Q155 · MECHANISM / WHY · ADD V5
TTS 309 · Q: How do you explain a concurrent inventory bug in one minute?
Mở đáp án mẫu Q155 — sau khi tự trả lời
TTS 310 · A: Two requests read the last available item before either update becomes visible. Both may believe they can reserve it. I would move the critical check and update into a protected database operation and test two concurrent requests.
Q156 · FOUNDATION · ADD V5
TTS 311 · Q: What should a database integration test assert after two simultaneous bookings?
Mở đáp án mẫu Q156 — sau khi tự trả lời
TTS 312 · A: It should verify that the business invariant still holds in stored data. For one available room-night, at most one conflicting allocation should succeed. I would also check the returned statuses and any retry records.
5. UNEXPECTED FOLLOW-UP — thay giả định và suy luận
Chọn ít nhất một câu dưới đây, tự trả lời trước; sau đó yêu cầu người luyện thay một điều kiện mới.
Q157 · SCENARIO / FOLLOW-UP · BASE V4
TTS 313 · Q: How would you explain the solution to a teammate in under one minute?
Mở đáp án mẫu Q157 — sau khi tự trả lời
TTS 314 · A: Two requests were able to reserve the same inventory because the availability check was not protected. I would enforce the rule in the database and run a concurrent test to confirm that only one request succeeds.
Q158 · SCENARIO / FOLLOW-UP · BASE V4
TTS 315 · Q: What happens if a retry arrives with the same operation ID?
Mở đáp án mẫu Q158 — sau khi tự trả lời
TTS 316 · A: If the system stores operation IDs and their results, it should return the original result instead of repeating the action. The behavior must be supported by a persistent idempotency mechanism.
6. REPEAT + FEEDBACK — checkpoint
E — REPEAT + FEEDBACK: Chọn câu khó nhất ở phần FREE SPEAK, nói 3 lượt (45–60 giây → 30–45 giây → 20–30 giây ở L1; tăng thời lượng ở L2), giữ ý chính và một test/example. Mở câu trả lời ngay dưới câu hỏi sau lượt 1; mỗi lượt chỉ sửa tối đa 2 lỗi.
- Thời lượng mục tiêu: L1: bug 20–30 giây; L2: 60–90 giây evidence → root cause → fix → test.
- Điều kiện qua bài: Giải được case độc lập; câu trả lời nói tương ứng code/query thực sự đã kiểm tra.
- Điểm dễ nói sai / hiểu sai: Không chỉ nói “I fixed the bug”; phải nêu cách tái hiện, giới hạn và test.
| Self-check (đánh dấu sau khi nói) | Yes/No |
|---|---|
| Tôi giải đúng kiến thức và nêu được ví dụ / failure / test cần thiết | [ ] |
| Tôi hiểu câu hỏi khi nghe, hoặc hỏi lại đúng chỗ | [ ] |
| Tôi tự nói không nhìn script; có mở đầu và kết luận rõ | [ ] |
| Tôi xử lý được ít nhất 1 follow-up mới | [ ] |
Mẫu trả lời dài V4 (tùy chọn; xem sau khi tự nói)
Show sample only after speaking
One possible answer (~40–90 words):
The key risk is that two requests may pass the same availability check before either one commits. I would protect the inventory rule at the database boundary, for example with a conditional update or an appropriate lock and transaction. I would inspect the affected row count, handle the conflict, and run a concurrent test. The spoken explanation must match the SQL and Java behavior I implemented.
Knowledge guardrail: Không chỉ nói “I fixed the bug”; phải nêu cách tái hiện, giới hạn và test.
Reverse recall: Che sample; nói lại bằng từ của mình rồi trả lời follow-up số 2 trong Speaking Lab 08C.
🎙️ CASE LAB V5.2 — V-Market (11 cặp Q&A)
Nguồn:
PROJECT_DEEP_DIVE_PREP(4).md; snapshot commit được mô tả:ff9fde3. Chưa kiểm chứng repo độc lập; không tự nhận đã triển khai hoặc chạy test khi chưa làm.
Mục tiêu kiến thức: Stock-safe checkout, idempotency, JDBC/PostgreSQL, Redis metadata và legacy CSV.
WATCH → DO (đọc code/test thực tế): OrderController → OrderService.create → integration tests; CSV: LegacyImportService/ImportChunkService.
LISTEN → SHADOW: V-Market is a Java and Spring Boot commerce project with a product catalog, guest checkout, and CSV imports. (2 lượt), rồi giải thích lại flow mà không nhìn script.
FREE SPEAK — P0 (ưu tiên, 4–6 câu mỗi buổi)
Q159 · P0 · PROJECT-SPECIFIC V5.1
TTS 317 · Q: What problem does V-Market solve?
Mở đáp án mẫu Q159 — sau khi tự trả lời
TTS 318 · A: V-Market is a Java and Spring Boot commerce project with a product catalog, guest checkout, and CSV imports. Its main backend challenges are keeping stock correct and handling repeated checkout requests safely. The project does not claim real payment gateway integration.
Q160 · P0 · PROJECT-SPECIFIC V5.1
TTS 319 · Q: Walk me through a V-Market checkout request.
Mở đáp án mẫu Q160 — sau khi tự trả lời
TTS 320 · A: The browser sends a request through the Next.js backend-for-frontend to the Java API. Inside a database transaction, the service checks the operation key, locks stock rows, and validates the current price and quantity. It saves the order, inventory changes, movements, and audit together before returning the result.
Q161 · P0 · PROJECT-SPECIFIC V5.1
TTS 321 · Q: Two customers each buy twenty items when only twenty-seven are in stock. What happens?
Mở đáp án mẫu Q161 — sau khi tự trả lời
TTS 322 · A: The first checkout locks the relevant stock row and may purchase twenty items. The second checkout waits and then reads the updated stock of seven. It must reject a request for twenty items, so the database never commits negative stock in this case.
Q162 · P0 · PROJECT-SPECIFIC V5.1
TTS 323 · Q: Why does V-Market need both an operation-key lock and stock locks?
Mở đáp án mẫu Q162 — sau khi tự trả lời
TTS 324 · A: The operation-key lock prevents the same checkout operation from creating another order. Stock locks protect inventory when different operations compete for the same products. They solve different concurrency problems.
Q163 · P0 · PROJECT-SPECIFIC V5.1
TTS 325 · Q: How does V-Market handle a repeated checkout with the same key?
Mở đáp án mẫu Q163 — sau khi tự trả lời
TTS 326 · A: The backend compares the guest scope, operation key, and request fingerprint. The same operation and payload can return the existing order during the replay window. Reusing the key with different quantities or customer data causes a conflict.
Q164 · P0 · PROJECT-SPECIFIC V5.1
TTS 327 · Q: The client times out after checkout. Should it create a new request key?
Mở đáp án mẫu Q164 — sau khi tự trả lời
TTS 328 · A: No. A timeout does not prove the order was not committed. The client keeps the operation key and guest capability, and uses the recovery endpoint to check the result. It should not start a new operation blindly.
Q165 · P0 · PROJECT-SPECIFIC V5.1
TTS 329 · Q: Why does V-Market use Redis, and can the cache cause overselling?
Mở đáp án mẫu Q165 — sau khi tự trả lời
TTS 330 · A: Redis caches catalog metadata, not the authoritative stock count. The displayed availability is a snapshot, and checkout checks the database again under a lock. Cache freshness may affect displayed metadata, but cached availability is not trusted to commit an order.
Q166 · P0 · PROJECT-SPECIFIC V5.1
TTS 331 · Q: What happens if a database error occurs while creating an order?
Mở đáp án mẫu Q166 — sau khi tự trả lời
TTS 332 · A: The order, order items, stock changes, inventory movements, and audit are written in one transaction. A rollback prevents those related database changes from being committed only partially. This does not mean external payment or delivery operations are covered by the transaction.
Q167 · P0 · PROJECT-SPECIFIC V5.1
TTS 333 · Q: What evidence and limitations can you discuss for V-Market?
Mở đáp án mẫu Q167 — sau khi tự trả lời
TTS 334 · A: The repository describes Testcontainers integration tests for overselling, simultaneous duplicates, and rejected key reuse. These tests check order counts, inventory changes, and database records, not just HTTP responses. They do not prove production reliability or that I personally ran the tests.
FOLLOW-UP — P1 (chỉ học sâu sau P0)
Q168 · P1 · PROJECT-SPECIFIC V5.1
TTS 335 · Q: How does V-Market validate Japanese legacy CSV imports?
Mở đáp án mẫu Q168 — sau khi tự trả lời
TTS 336 · A: It accepts UTF-8 and CP932 or Windows-31J with strict decoding. It checks the file structure, headers, columns, SKU values, and row data. Structural errors may reject the file, while invalid business rows can be stored for review.
Q169 · P1 · PROJECT-SPECIFIC V5.1
TTS 337 · Q: Why can't an old CSV stock snapshot restore inventory that has already been sold?
Mở đáp án mẫu Q169 — sau khi tự trả lời
TTS 338 · A: Unversioned legacy feeds can update metadata but not authoritative stock. A versioned stock snapshot must match the current stock version after the database lock is acquired. This prevents an old snapshot from silently overwriting a newer inventory state.
UNEXPECTED FOLLOW-UP: Giả định client mất response sau khi server đã commit. Giải thích vì sao không tạo operation key mới và cách kiểm tra kết quả.
SELF-CHECK: có nêu một invariant, một failure, một test và một giới hạn thật? Chỉ nói I implemented hoặc I ran với phần mình đã xác minh từ công việc cá nhân.
🎙️ CASE LAB V5.2 — V-Core (11 cặp Q&A)
Nguồn:
PROJECT_DEEP_DIVE_PREP(3).md; snapshot commit được mô tả:aff7e93. Chưa kiểm chứng repo độc lập; không tự nhận đã triển khai hoặc chạy test khi chưa làm.
Mục tiêu kiến thức: Kanban WIP limit, task version, quyền workspace và SSE refresh.
WATCH → DO (đọc code/test thực tế): TaskController → TaskMoveService.move → WorkflowColumnRepository/TaskEntity → integration tests.
LISTEN → SHADOW: V-Core is a Kanban collaboration project using Java, Spring Boot, PostgreSQL, and a React frontend. (2 lượt), rồi giải thích lại flow mà không nhìn script.
FREE SPEAK — P0 (ưu tiên, 4–6 câu mỗi buổi)
Q170 · P0 · PROJECT-SPECIFIC V5.1
TTS 339 · Q: What problem does V-Core solve?
Mở đáp án mẫu Q170 — sau khi tự trả lời
TTS 340 · A: V-Core is a Kanban collaboration project using Java, Spring Boot, PostgreSQL, and a React frontend. Its backend manages workspace permissions and concurrent task changes. A key rule is that moving tasks must not exceed a column's work-in-progress limit.
Q171 · P0 · PROJECT-SPECIFIC V5.1
TTS 341 · Q: Walk me through a task move in V-Core.
Mở đáp án mẫu Q171 — sau khi tự trả lời
TTS 342 · A: The client sends the target column, the task version, and an idempotency key through a BFF. The service checks access, locks the target column, and validates the task version and WIP limit inside a transaction. It then saves the task change, activity, outbox record, and idempotency result.
Q172 · P0 · PROJECT-SPECIFIC V5.1
TTS 343 · Q: Why does V-Core use both a column lock and a task version?
Mở đáp án mẫu Q172 — sau khi tự trả lời
TTS 344 · A: The column lock protects the shared WIP limit across different tasks. The task version prevents a stale update to one task. Two different tasks have different versions, so version checking alone cannot protect the column's capacity.
Q173 · P0 · PROJECT-SPECIFIC V5.1
TTS 345 · Q: Two users move tasks into the last free slot. How does V-Core prevent overflow?
Mở đáp án mẫu Q173 — sau khi tự trả lời
TTS 346 · A: Both operations need the target column lock before checking occupancy. One move fills the final slot and commits. The waiting request checks occupancy again and is rejected if the column is now full.
Q174 · P0 · PROJECT-SPECIFIC V5.1
TTS 347 · Q: What does V-Core do when the same task move request is retried?
Mở đáp án mẫu Q174 — sau khi tự trả lời
TTS 348 · A: The backend stores an idempotency key and a request hash scoped to the workspace. A matching retry can receive the saved response without applying the move again. Reusing the key with different content causes a conflict.
Q175 · P0 · PROJECT-SPECIFIC V5.1
TTS 349 · Q: What does the task-move transaction guarantee, and what does it not guarantee?
Mở đáp án mẫu Q175 — sau khi tự trả lời
TTS 350 · A: The task change, activity record, outbox entry, and idempotency result are committed together. If the transaction rolls back, those database changes roll back together. The transaction does not guarantee that an SSE notification reaches every browser.
Q176 · P0 · PROJECT-SPECIFIC V5.1
TTS 351 · Q: How does V-Core prevent a user from changing tasks in another workspace?
Mở đáp án mẫu Q176 — sau khi tự trả lời
TTS 352 · A: The service checks the current session and workspace membership or role in PostgreSQL. It also scopes task queries to the requested workspace and project. A trusted BFF secret is not the same as user authorization, and a public viewer cannot perform writes.
Q177 · P0 · PROJECT-SPECIFIC V5.1
TTS 353 · Q: How would you verify V-Core's WIP concurrency rule?
Mở đáp án mẫu Q177 — sau khi tự trả lời
TTS 354 · A: The repository includes an integration test that starts two competing moves for one remaining slot. The test checks both the responses and the final number of tasks in the column. I would explain the test from the code and avoid claiming that I personally ran it unless I did.
FOLLOW-UP — P1 (chỉ học sâu sau P0)
Q178 · P1 · PROJECT-SPECIFIC V5.1
TTS 355 · Q: What is the purpose of SSE in V-Core, and is delivery guaranteed?
Mở đáp án mẫu Q178 — sau khi tự trả lời
TTS 356 · A: SSE tells the user interface that workspace data may have changed. The interface then fetches current data from the database-backed API. The current feed can lose notifications, so SSE is a refresh hint, not a durable exactly-once event stream.
Q179 · P1 · PROJECT-SPECIFIC V5.1
TTS 357 · Q: What happens to an existing SSE stream when a user's access is revoked?
Mở đáp án mẫu Q179 — sau khi tự trả lời
TTS 358 · A: The backend rechecks the original session, account, and workspace membership before events or heartbeats. If access cannot be verified, the stream is closed. This does not undo events already sent or promise instantaneous revocation at every moment.
Q180 · P1 · PROJECT-SPECIFIC V5.1
TTS 359 · Q: Can an administrator lower a WIP limit below the current task count?
Mở đáp án mẫu Q180 — sau khi tự trả lời
TTS 360 · A: No. The current implementation locks the column and checks its version and occupancy. It rejects a new limit that is below the number of existing tasks. It does not automatically delete or move tasks to satisfy the limit.
UNEXPECTED FOLLOW-UP: Giả định hai task cùng tranh slot cuối trong cột. Phân biệt column lock với task version và nêu một test.
SELF-CHECK: có nêu một invariant, một failure, một test và một giới hạn thật? Chỉ nói I implemented hoặc I ran với phần mình đã xác minh từ công việc cá nhân.
MÔ-ĐUN 09 [CORE] — Basic System Design: từ 1 server đến một hệ thống đủ tin cậy
09.1. System Design không đồng nghĩa “thiết kế YouTube/Netflix”
Đối với bài cơ bản, interviewer có thể chỉ muốn biết API nào, lưu dữ liệu ở đâu, luồng hoạt động và khi service ngoài lỗi thì sao. Đừng nhảy sang Kafka + Kubernetes + microservices khi bài toán chưa cần.
09.2. Level 1 — khởi đầu bằng cấu trúc tối giản
[Browser] ──HTTPS──> [Spring Boot App] ──SQL──> [PostgreSQL]
Ưu điểm: dễ xây, debug, deploy; transaction nội bộ rõ. Nhược: một app instance có thể là single point of failure; DB có thể thành bottleneck. Đây thường là thiết kế xuất phát tốt, không phải thiết kế sai.
Framework 5 bước cần thuộc: 1. Requirements: functions, users, traffic, availability/security constraints. 2. APIs + Data: endpoints, objects/tables, invariants. 3. Components + Flow: ai gọi ai, source of truth. 4. Failures + Bottlenecks: timeout, duplicate, consistency, scaling. 5. Trade-offs + Tests: vì sao chọn và cách chứng minh.
09.3. Level 2 — khi nhiều người đọc availability
┌──> [Redis cache] (optional, derived data)
[App] ────┤
└──> [PostgreSQL] (source of truth)
Vì sao cache? Giảm truy vấn lặp cho dữ liệu đọc nhiều.
Tại sao cache nguy hiểm? Có thể stale; không tin cache là authority duy nhất khi xác nhận đặt phòng.
- Cache hit / miss: đọc được / không có key.
- TTL: dữ liệu tồn tại trong cache bao lâu.
- Invalidation: xóa/cập nhật cache khi source data thay đổi.
Answer: I might cache read-heavy availability summaries with a short TTL, but the final booking decision must be validated against the authoritative inventory store.
09.4. Level 3 — external service bị chậm / lỗi
[Client] → [Backend] → [Third-party room provider]
↓ × timeout
logs / pending state / safe retry / reconciliation
Có thể làm gì?
- Đặt timeout để request không treo vô hạn.
- Phân loại lỗi tạm thời / lỗi business / lỗi không retry.
- Retry với backoff nếu operation safe hoặc idempotency mechanism đã được xác nhận.
- Có trạng thái PENDING_CONFIRMATION nếu chưa biết kết quả thực tế.
- Log correlation ID, request ID để truy vết.
- Reconciliation: đối soát lại sau lỗi để không tạo booking ảo/nhân đôi.
Không hứa chính xác-once chỉ vì đã bật retry.
09.5. Level 4 — scale và background work
┌─ [App instance 1] ─┐
[Load balancer] ──┤ ├── [Database]
└─ [App instance 2] ─┘
│
└─[Queue]→[Worker]→ email / report
- Horizontal scale: nhiều app instances; cần stateless app hoặc quản lý session phù hợp, shared DB/cache.
- Queue: các công việc không cần trả kết quả ngay (ví dụ gửi email), nhưng introduces retry, duplicates và eventual delivery.
- Monolith vs microservices: một ứng dụng dễ thay đổi/transaction nội bộ, so với triển khai từng service độc lập nhưng vận hành/giao tiếp phức tạp.
09.6. Bảng ra quyết định 8 trade-offs phổ biến
| Khi interviewer hỏi | Chọn đơn giản trước | Khi nào cân nhắc phương án khác? | Rủi ro phải nói |
|---|---|---|---|
| DB hay cache? | DB là source of truth | read-heavy & repeated queries → cache | stale cache / invalidation |
| Sync hay async? | sync nếu user cần kết quả ngay | email, batch → async | queue delays, duplicate deliveries |
| SQL hay NoSQL? | SQL nếu relations/transactions rõ | flexible access pattern hoặc scale đặc thù | joins/transactions/query needs |
| Monolith hay microservices? | modular monolith cho MVP | team/services cần deploy độc lập thật | distributed complexity |
| Optimistic hay pessimistic lock? | dựa trên conflict frequency | high contention có thể cần locking mạnh hơn | retries vs waiting/deadlocks |
| Retry hay fail? | fail rõ nếu chưa biết an toàn retry | transient + idempotent operations | duplicated business effect |
| Offset hay cursor paging? | offset đơn giản | large/rapidly changing list → cursor | stable ordering / complexity |
| Index hay scan? | đo workload + EXPLAIN trước |
predicates selective, frequent queries | overhead storage/writes |
Nhớ: không có đáp án “luôn luôn chọn X”. Đáp án tốt là theo yêu cầu và có lý do.
09.7. Một bài worked example đầy đủ (ngắn)
Đề: Design a URL shortener for a small internal team.
- Clarify: custom alias? expiration? internal only? anticipated traffic?
- API:
POST /links→ short code;GET /{code}→ redirect. - DB:
Link(code UNIQUE, originalUrl, createdAt, expiresAt, ownerId). - Flow: create validates URL + uniqueness; redirect looks up code and returns redirect response.
- Failure: collision in generated code → generate another; expired link → appropriate response; abuse prevention.
- Scaling: start with single app + relational DB; add cache for very frequent redirects if measurements justify it.
Mẫu tiếng Anh:
I'd start by clarifying traffic and expiration requirements. For the MVP, I'd use a Spring Boot service and a relational database with a unique short code. Redirect requests look up the code and return a redirect. If read traffic increases, I'd consider caching popular mappings, while keeping the database as the source of truth.
09.8. Tự làm — không có sẵn một đáp án duy nhất
Đề: Design a task management API for a team of 20 users. The app must support create/update tasks and an activity log.
Viết tối đa 10–12 dòng cho: requirements, entities, APIs, components, one failure case, one trade-off. Đừng giải thích Kubernetes/queues trước khi chỉ ra lý do cần.
Đáp án gợi ý
- Entities: Workspace, User, Task, ActivityEvent.
- API:
POST /tasks,PATCH /tasks/{id},GET /tasks/{id},GET /tasks/{id}/activities. - Backend: Controller → Service (permissions/business rules) → Repository → PostgreSQL.
- Update task và ghi audit event trong một transaction phù hợp khi cần tính nhất quán tức thời.
- Concurrent updates: optimistic version hoặc chính sách last-write-wins nếu business chấp nhận.
- Trade-off: một modular monolith + SQL đơn giản hơn microservices cho 20 users; chia nhỏ khi có nhu cầu xác thực.
🎙️ SPEAKING LAB V5.2 — 09. Basic System Design
Thứ tự sử dụng: PRETEST → WATCH & DO ngay trong phần kiến thức phía trên → LISTEN/SHADOW → FREE SPEAK → FOLLOW-UP → feedback. Không mở đáp án trước lượt nói đầu.
Những ý kỹ thuật phải hiểu trước khi nói: MVP monolith; database authority; caching; queue; failure/timeouts; scaling and trade-offs.
Từ đơn → cụm nói được (chỉ chọn 3–5 cụm để ôn hôm nay):
| Useful chunk | Nghĩa |
|---|---|
start with a simple architecture |
bắt đầu với kiến trúc đơn giản |
cache read-heavy data |
cache dữ liệu đọc nhiều |
keep the database authoritative |
giữ DB là nguồn dữ liệu có thẩm quyền |
introduce a message queue |
thêm hàng đợi thông điệp |
1. PRETEST + WATCH + DO
Hoàn thành ít nhất một bài COMPLETE/DO ở phía trên (hoặc giải thích một ví dụ mới). Nếu chưa giải thích được cơ chế bằng tiếng Việt, quay lại bài kỹ thuật trước khi bắt đầu nói.
2. LISTEN → SHADOW
A — LISTEN & SHADOW (3–4 phút): Ẩn chữ; dùng TTS/Voice đọc lần lượt các câu sau. Lượt 1 nghe và tóm tắt ý; lượt 2–3 bắt chước nhịp nói, rồi nói lại không nhìn.
- I would start with one backend service and a relational database for the MVP.
- Caching can reduce read load, but stale data must not break booking correctness.
3. COMPLETE ORALLY
B — COMPLETE ORALLY (1–2 phút): Điền bằng giọng nói, không cần viết câu hoàn chỉnh trước.
For the MVP, I would use . If ___ becomes a bottleneck, I would . The trade-off is ___.
4. FREE SPEAK — định nghĩa / cơ chế (không nhìn script)
Chọn 3–5 câu/lượt trong 4 câu sau. Đáp án được thu gọn dưới từng câu; chỉ mở sau khi đã nói.
Q181 · FOUNDATION · BASE V4
TTS 361 · Q: Design a simple booking service for an MVP.
Mở đáp án mẫu Q181 — sau khi tự trả lời
TTS 362 · A: For an MVP, I would build one Spring Boot backend with a relational database. The service handles booking rules, and the database stores bookings and inventory. I would add monitoring and test failures before adding more components.
Q182 · MECHANISM / WHY · BASE V4
TTS 363 · Q: When might you add Redis caching, and what should not rely on a stale cache?
Mở đáp án mẫu Q182 — sau khi tự trả lời
TTS 364 · A: I would consider Redis if repeated reads put too much load on the database. But final room allocation must not trust a possibly stale cache. The database should enforce the inventory rule.
Q183 · FOUNDATION · ADD V5
TTS 365 · Q: What is a load balancer?
Mở đáp án mẫu Q183 — sau khi tự trả lời
TTS 366 · A: A load balancer distributes incoming requests across available backend instances. It can improve availability and capacity, but the instances must handle shared state correctly.
Q184 · FOUNDATION · ADD V5
TTS 367 · Q: What is eventual consistency?
Mở đáp án mẫu Q184 — sau khi tự trả lời
TTS 368 · A: Eventual consistency allows replicas or components to temporarily disagree. If updates stop and the system converges as designed, they eventually reach consistent state. I would clarify whether that delay is acceptable for the business rule.
5. UNEXPECTED FOLLOW-UP — thay giả định và suy luận
Chọn ít nhất một câu dưới đây, tự trả lời trước; sau đó yêu cầu người luyện thay một điều kiện mới.
Q185 · SCENARIO / FOLLOW-UP · BASE V4
TTS 369 · Q: Why would you choose a modular monolith before microservices?
Mở đáp án mẫu Q185 — sau khi tự trả lời
TTS 370 · A: A modular monolith is easier to develop, test, and deploy for a small product. It avoids early distributed-system complexity. The trade-off is less independent scaling and deployment.
Q186 · SCENARIO / FOLLOW-UP · BASE V4
TTS 371 · Q: What changes if an external provider is frequently slow?
Mở đáp án mẫu Q186 — sau khi tự trả lời
TTS 372 · A: I would set appropriate timeouts and identify whether the operation is safe to retry. I would track uncertain results and use a fallback or reconciliation workflow when the provider is unavailable.
Q187 · SCENARIO / FOLLOW-UP · BASE V4
TTS 373 · Q: How would you measure whether scaling actually helped?
Mở đáp án mẫu Q187 — sau khi tự trả lời
TTS 374 · A: I would compare latency, error rate, and throughput before and after scaling under similar load. I would also check database load and costs to make sure the change actually helped.
6. REPEAT + FEEDBACK — checkpoint
E — REPEAT + FEEDBACK: Chọn câu khó nhất ở phần FREE SPEAK, nói 3 lượt (45–60 giây → 30–45 giây → 20–30 giây ở L1; tăng thời lượng ở L2), giữ ý chính và một test/example. Mở câu trả lời ngay dưới câu hỏi sau lượt 1; mỗi lượt chỉ sửa tối đa 2 lỗi.
- Thời lượng mục tiêu: L1: 30 giây kiến trúc tối thiểu; L2: 90 giây gồm 1 bottleneck và 1 trade-off.
- Điều kiện qua bài: Có assumption, component flow, consistency owner, ít nhất 2 failure paths và cách đo/test.
- Điểm dễ nói sai / hiểu sai: Không thêm microservices/Redis/Kafka chỉ để thể hiện biết công nghệ; phải có nhu cầu.
| Self-check (đánh dấu sau khi nói) | Yes/No |
|---|---|
| Tôi giải đúng kiến thức và nêu được ví dụ / failure / test cần thiết | [ ] |
| Tôi hiểu câu hỏi khi nghe, hoặc hỏi lại đúng chỗ | [ ] |
| Tôi tự nói không nhìn script; có mở đầu và kết luận rõ | [ ] |
| Tôi xử lý được ít nhất 1 follow-up mới | [ ] |
Mẫu trả lời dài V4 (tùy chọn; xem sau khi tự nói)
Show sample only after speaking
One possible answer (~40–90 words):
For an MVP, I would start with one Spring Boot backend and a relational database. The backend handles booking rules and the database remains the authoritative source for availability. If read traffic increases, I might cache suitable read-heavy data, while protecting final inventory allocation in the database. I would monitor latency and query load before scaling. This design is simpler to deploy, but independent scaling is more limited.
Knowledge guardrail: Không thêm microservices/Redis/Kafka chỉ để thể hiện biết công nghệ; phải có nhu cầu.
Reverse recall: Che sample; nói lại bằng từ của mình rồi trả lời follow-up số 2 trong Speaking Lab 09.
LAB B [CORE] — Debugging + API Integration: từ triệu chứng đến nguyên nhân
Tại sao có LAB này? Java Backend và FDE đều có thể yêu cầu bạn xử lý một lỗi lạ, đọc API/data hiện có và đưa ra cách kiểm chứng — không phải chỉ nêu tên design pattern.
B1. Quy trình 6 bước (dùng cho mọi lỗi)
Symptom → Reproduce → Locate boundary → Hypotheses → Evidence → Fix & regression test.
| Bước | Ví dụ booking | English prompt |
|---|---|---|
| Symptom | Khách thấy “request timed out” | What exactly failed? |
| Reproduce | Dùng request ID, input và thời điểm | Can you reproduce it? |
| Boundary | Browser → BFF → backend → DB → provider | Where does the flow stop? |
| Hypotheses | Provider chậm, DB lock wait, network drop | What might cause this? |
| Evidence | Logs, traces, DB status, request ID | What evidence supports it? |
| Fix/Test | Retry có kiểm soát; test timeout/duplicate | How would you verify the fix? |
Tránh lỗi thường gặp: timeout ở browser không chứng minh database rollback; response 500 không chứng minh bên thứ ba chưa thực hiện side effect.
B2. WATCH — đơn đặt hàng trả 504 nhưng DB đã có order
- User gửi
POST /ordersvớiIdempotency-Key: K1. - Backend tạo order và commit DB; response bị rớt trên đường về.
- Browser nhận 504 và người dùng bấm “Pay/Order” lại.
Phân tích: 504 nói gateway/upstream đã chờ quá lâu. Cần query tình trạng operation theo key/order ID trước khi tạo lại. Nếu retry cùng operation, client phải giữ K1. Backend phải có dedup durable, và tốt hơn là kiểm tra payload hash; concurrent duplicates cần có chiến lược xử lý rõ. Không chỉ thêm @Transactional là đủ.
English (45s): A timeout does not prove that the operation failed. I would check the order status using a stable request ID or idempotency key. If the client retries the same operation, the backend must avoid creating a second order. I'd test a timeout after commit and concurrent retries.
B3. COMPLETE — triệu chứng khác nhau, xử lý khác nhau
| Triệu chứng | Điều biết chắc | Bước xác minh tiếp theo |
|---|---|---|
| 400 after POST | Server đã phản hồi client error | __________ |
| 403 on staff approval | Bị từ chối quyền | __________ |
| 409 when allocating last room | Có xung đột trạng thái theo contract | __________ |
| 503 from provider | Provider hiện không phục vụ request | __________ |
| Timeout from payment provider | Caller không biết kết quả cuối | __________ |
Đáp án tham khảo
400: validate schema, required fields, constraints; 403: user identity, role, authorization policy; 409: current state, concurrency/race, whether retry/update allowed; 503: retry policy với backoff/circuit breaker nếu operation an toàn, quan sát lỗi; timeout payment: query provider status/correlation ID, kiểm soát idempotency và reconciliation trước khi thử lại. Chú ý mapping HTTP phụ thuộc API contract; không suy đoán mọi 409 cùng lý do.
B4. DO — API/data integration (10 phút)
An external vendor sends a CSV file every morning. Some rows are duplicated, some product names have garbled Japanese characters, and a few quantities are negative.
Không chọn tech ngay. Tự viết:
- 5 câu hỏi làm rõ (định dạng, encoding, business key, tần suất, cách xử lý sai).
- Pipeline 5 bước từ raw file tới DB.
- Một quy tắc dedup cấp file và một quy tắc dedup cấp row, vì hai thứ khác nhau.
- Một chiến lược xử lý lỗi: reject cả file hay partial success? Điều kiện nào quyết định?
- 4 tests kể cả replay/crash.
Hướng giải — chỉ xem sau khi thử
Clarify: encoding do exporter định nghĩa (UTF-8/Windows-31J?), delimiter/quote, SKU/vendor unique key, full snapshot hay delta, số hàng/file, lỗi row có chặn toàn bộ không, sale có chạy song song không? Pipeline: receive raw bytes → decode/parse → validate/normalize → stage + report rejects → transactional apply + reconcile. File checksum theo bytes ngăn upload giống bytes; unique business key/check theo vendor SKU/order ID xử lý duplicate record xuyên nhiều file. Partial success hay all-or-nothing phải được đồng ý qua acceptance criteria. Tests: CP932 fixture, negative quantity, same file reupload, duplicate SKU across files, crash/partial commit/recovery.
B5. Liên hệ đúng với V-Market (đọc sau khi hiểu B4)
Trong tài liệu phân tích project V-Market do bạn cung cấp, flow importer được mô tả dùng staged rows, checksum, Windows-31J, tasklet và các nhóm ghi REQUIRES_NEW. Tài liệu cũng cảnh báo: API hiện tại chưa có workflow restart đầy đủ, dù dữ liệu tiến độ đã lưu, và reconciliation phát hiện chênh lệch nhưng không tự chứng minh chênh lệch là lỗi. Đây là điều tài liệu phân tích code mô tả, không phải test tôi vừa chạy lại.
Câu FDE gợi ý: The client wants to import inventory without stopping sales. What would you ask before making changes? → hỏi feed là snapshot/delta, cutoff time, update stock ghi đè sale hợp lệ hay không, quyền operator, tiêu chí đối soát.
Qua LAB B nếu: Bạn không còn trả lời “cứ retry”, “cứ thêm Redis” khi chưa xác định root cause, có thể nêu evidence và một regression test.
🎙️ SPEAKING LAB V5.2 — B. Debugging và external integration
Thứ tự sử dụng: PRETEST → WATCH & DO ngay trong phần kiến thức phía trên → LISTEN/SHADOW → FREE SPEAK → FOLLOW-UP → feedback. Không mở đáp án trước lượt nói đầu.
Những ý kỹ thuật phải hiểu trước khi nói: Symptom → evidence → reproduce → hypothesis → fix → verify; external timeout; duplicate imports.
Từ đơn → cụm nói được (chỉ chọn 3–5 cụm để ôn hôm nay):
| Useful chunk | Nghĩa |
|---|---|
reproduce the issue |
tái hiện lỗi |
inspect request logs |
kiểm tra log request |
isolate the root cause |
khoanh nguyên nhân gốc |
verify the fix |
kiểm chứng bản sửa |
1. PRETEST + WATCH + DO
Hoàn thành ít nhất một bài COMPLETE/DO ở phía trên (hoặc giải thích một ví dụ mới). Nếu chưa giải thích được cơ chế bằng tiếng Việt, quay lại bài kỹ thuật trước khi bắt đầu nói.
2. LISTEN → SHADOW
A — LISTEN & SHADOW (3–4 phút): Ẩn chữ; dùng TTS/Voice đọc lần lượt các câu sau. Lượt 1 nghe và tóm tắt ý; lượt 2–3 bắt chước nhịp nói, rồi nói lại không nhìn.
- A gateway timeout does not prove that the database operation was rolled back.
- I would correlate request IDs, database records, and downstream logs.
3. COMPLETE ORALLY
B — COMPLETE ORALLY (1–2 phút): Điền bằng giọng nói, không cần viết câu hoàn chỉnh trước.
The symptom is . My first hypothesis is . I would check ___ before changing ___.
4. FREE SPEAK — định nghĩa / cơ chế (không nhìn script)
Chọn 3–5 câu/lượt trong 1 câu sau. Đáp án được thu gọn dưới từng câu; chỉ mở sau khi đã nói.
Q188 · FOUNDATION · BASE V4
TTS 375 · Q: Which evidence would tell you that a retry is safe?
Mở đáp án mẫu Q188 — sau khi tự trả lời
TTS 376 · A: I would look for an idempotency contract and a way to check the original operation status. If I cannot confirm that repeating the request is safe, I would not retry it blindly.
5. UNEXPECTED FOLLOW-UP — thay giả định và suy luận
Chọn ít nhất một câu dưới đây, tự trả lời trước; sau đó yêu cầu người luyện thay một điều kiện mới.
Q189 · SCENARIO / FOLLOW-UP · BASE V4
TTS 377 · Q: An API returns 504, but an order exists in the database. What do you do first?
Mở đáp án mẫu Q189 — sau khi tự trả lời
TTS 378 · A: I would not assume the order failed. First, I would find the request ID and compare application logs with database records. Then I would check whether the order committed before the gateway timed out.
Q190 · SCENARIO / FOLLOW-UP · BASE V4
TTS 379 · Q: How would you investigate duplicate product imports?
Mở đáp án mẫu Q190 — sau khi tự trả lời
TTS 380 · A: I would reproduce the import with a small dataset and inspect duplicate records, request IDs, and retry behavior. Then I would identify the root cause and consider a stable external ID or database constraint.
Q191 · SCENARIO / FOLLOW-UP · BASE V4
TTS 381 · Q: What if logs show the same request ID twice?
Mở đáp án mẫu Q191 — sau khi tự trả lời
TTS 382 · A: That could be a retry, duplicate log entry, or another processing issue. I would compare timestamps, handlers, and database effects before concluding that the business action ran twice.
Q192 · SCENARIO / FOLLOW-UP · BASE V4
TTS 383 · Q: How would you design a regression test for the root cause?
Mở đáp án mẫu Q192 — sau khi tự trả lời
TTS 384 · A: I would reproduce the original failure, then test the corrected behavior. For a duplicate-order bug, I would send two requests with the same operation ID and verify there is only one order.
Q193 · SCENARIO / FOLLOW-UP · ADD V5
TTS 385 · Q: How would you trace an HTTP request across multiple services?
Mở đáp án mẫu Q193 — sau khi tự trả lời
TTS 386 · A: I would attach or propagate a correlation identifier and inspect logs or traces for that identifier. Then I would compare timestamps, error boundaries, and database effects.
Q194 · SCENARIO / FOLLOW-UP · ADD V5
TTS 387 · Q: What would you do if an external API returned an unfamiliar error?
Mở đáp án mẫu Q194 — sau khi tự trả lời
TTS 388 · A: I would check the API contract, log the safe diagnostic details, and reproduce the request if appropriate. I would separate permanent validation failures from transient failures before deciding whether to retry.
Q195 · SCENARIO / FOLLOW-UP · ADD V5
TTS 389 · Q: How would you prevent duplicate records during a CSV import?
Mở đáp án mẫu Q195 — sau khi tự trả lời
TTS 390 · A: I would identify a stable business key for each imported record. Then I would use an appropriate unique constraint or upsert strategy. I would also test duplicate rows and repeated file uploads.
6. REPEAT + FEEDBACK — checkpoint
E — REPEAT + FEEDBACK: Chọn câu khó nhất ở phần FREE SPEAK, nói 3 lượt (45–60 giây → 30–45 giây → 20–30 giây ở L1; tăng thời lượng ở L2), giữ ý chính và một test/example. Mở câu trả lời ngay dưới câu hỏi sau lượt 1; mỗi lượt chỉ sửa tối đa 2 lỗi.
- Thời lượng mục tiêu: L1: mô tả symptom + evidence; L2: 90 giây giả thuyết → kiểm chứng → fix → test.
- Điều kiện qua bài: Không đoán nguyên nhân khi chưa có bằng chứng; không xóa dữ liệu hoặc retry mù.
- Điểm dễ nói sai / hiểu sai: Không hứa “adding a queue will fix it” trước khi biết bottleneck/bug.
| Self-check (đánh dấu sau khi nói) | Yes/No |
|---|---|
| Tôi giải đúng kiến thức và nêu được ví dụ / failure / test cần thiết | [ ] |
| Tôi hiểu câu hỏi khi nghe, hoặc hỏi lại đúng chỗ | [ ] |
| Tôi tự nói không nhìn script; có mở đầu và kết luận rõ | [ ] |
| Tôi xử lý được ít nhất 1 follow-up mới | [ ] |
Mẫu trả lời dài V4 (tùy chọn; xem sau khi tự nói)
Show sample only after speaking
One possible answer (~40–90 words):
A 504 response is a symptom, not proof that the order failed. I would start by correlating the request ID with application logs and database records. Then I would check whether the operation committed before the gateway timed out. If retries can duplicate the order, I would investigate idempotency and add a regression test. I would only change the code after identifying a defensible root cause.
Knowledge guardrail: Không hứa “adding a queue will fix it” trước khi biết bottleneck/bug.
Reverse recall: Che sample; nói lại bằng từ của mình rồi trả lời follow-up số 2 trong Speaking Lab B.
🎙️ CASE LAB V5.2 — V-Pulse (11 cặp Q&A)
Nguồn:
PROJECT_DEEP_DIVE_PREP(5).md; snapshot commit được mô tả:08e6a01. Chưa kiểm chứng repo độc lập; không tự nhận đã triển khai hoặc chạy test khi chưa làm.
Mục tiêu kiến thức: Payment-reliability demo với simulated rails, timeout, retry safety và recovery.
WATCH → DO (đọc code/test thực tế): PaymentController → PaymentService.create/process → RailGateway → integration tests.
LISTEN → SHADOW: V-Pulse is a payment-reliability demo built with Java, Spring Boot, PostgreSQL, Redis, and React. (2 lượt), rồi giải thích lại flow mà không nhìn script.
FREE SPEAK — P0 (ưu tiên, 4–6 câu mỗi buổi)
Q196 · P0 · PROJECT-SPECIFIC V5.1
TTS 391 · Q: What is V-Pulse, and does it connect to real banks?
Mở đáp án mẫu Q196 — sau khi tự trả lời
TTS 392 · A: V-Pulse is a payment-reliability demo built with Java, Spring Boot, PostgreSQL, Redis, and React. It uses simulated payment rails, not real bank integrations. The main learning problem is handling uncertain payment outcomes safely.
Q197 · P0 · PROJECT-SPECIFIC V5.1
TTS 393 · Q: Walk me through creating a payment instruction in V-Pulse.
Mở đáp án mẫu Q197 — sau khi tự trả lời
TTS 394 · A: The browser sends a stable operation key and payload through the BFF. The Java service validates the request and stores a processing instruction and its identity in a short transaction. It calls the simulated gateway outside that transaction, then finalizes the result in another transaction.
Q198 · P0 · PROJECT-SPECIFIC V5.1
TTS 395 · Q: Does a gateway timeout mean that the payment failed?
Mở đáp án mẫu Q198 — sau khi tự trả lời
TTS 396 · A: No. A timeout means the caller did not confirm the result in time. A real provider might already have processed the request. V-Pulse parks uncertain work instead of blindly authorizing the payment again.
Q199 · P0 · PROJECT-SPECIFIC V5.1
TTS 397 · Q: What is the difference between duplicate create and replaying a payment attempt?
Mở đáp án mẫu Q199 — sau khi tự trả lời
TTS 398 · A: Duplicate create uses the same merchant, key, and payload to retrieve the existing instruction. Replay means making another attempt to send an already known instruction to the gateway. A safe duplicate create does not automatically authorize a new gateway attempt.
Q200 · P0 · PROJECT-SPECIFIC V5.1
TTS 399 · Q: When is a parked instruction allowed to replay in V-Pulse?
Mở đáp án mẫu Q200 — sau khi tự trả lời
TTS 400 · A: Replay needs explicit evidence that the previous attempt did not execute, such as a definite rejection or a call blocked before sending. A timeout or unknown outcome does not give that permission. The backend rejects unsafe replay even if the rail appears healthy now.
Q201 · P0 · PROJECT-SPECIFIC V5.1
TTS 401 · Q: Explain timeout, circuit breaker, bulkhead, and rate limit in V-Pulse.
Mở đáp án mẫu Q201 — sau khi tự trả lời
TTS 402 · A: A timeout limits how long we wait for a result. A circuit breaker stops calling a rail that repeatedly fails, while a bulkhead limits concurrent calls. A Redis rate limit controls how many new requests one merchant can make in a time window.
Q202 · P0 · PROJECT-SPECIFIC V5.1
TTS 403 · Q: Why does V-Pulse call the gateway outside its database transaction?
Mở đáp án mẫu Q202 — sau khi tự trả lời
TTS 404 · A: Waiting for an external gateway inside a database transaction could hold locks for too long. V-Pulse commits instruction identity first, calls the gateway, and finalizes the result separately. This design requires explicit handling of crashes and uncertain outcomes between those steps.
Q203 · P0 · PROJECT-SPECIFIC V5.1
TTS 405 · Q: How would you test V-Pulse's timeout and retry behavior?
Mở đáp án mẫu Q203 — sau khi tự trả lời
TTS 406 · A: The repository includes integration tests that assert instruction state and simulated gateway call counts. One test confirms that a timed-out instruction cannot be replayed just because the rail recovers. Another verifies that a late result cannot overwrite a recovered database state.
Q204 · P0 · PROJECT-SPECIFIC V5.1
TTS 407 · Q: What are the most important limitations of V-Pulse?
Mở đáp án mẫu Q204 — sau khi tự trả lời
TTS 408 · A: Its rails are simulators, so the tests do not prove real payment settlement behavior. Local deduplication and version checks do not guarantee exactly-once payments at a real provider. Reliable real-provider integration would need a provider contract for references, deduplication, status lookup, and reconciliation.
FOLLOW-UP — P1 (chỉ học sâu sau P0)
Q205 · P1 · PROJECT-SPECIFIC V5.1
TTS 409 · Q: What happens if an old gateway result arrives after recovery?
Mở đáp án mẫu Q205 — sau khi tự trả lời
TTS 410 · A: Finalization checks that the instruction is still processing and has the expected version. A stale worker cannot overwrite a database state already changed by recovery. This database guard cannot undo an external provider side effect.
Q206 · P1 · PROJECT-SPECIFIC V5.1
TTS 411 · Q: What happens when Redis rate limiting fails in V-Pulse?
Mở đáp án mẫu Q206 — sau khi tự trả lời
TTS 412 · A: The current limiter fails open: it allows requests to continue and records a metric. That favors availability, but it temporarily loses the quota protection. Merchant IDs are normalized for the budget, but choosing an ID is not proof of ownership.
UNEXPECTED FOLLOW-UP: Giả định rail đã khỏe lại nhưng instruction còn PARKED vì timeout. Giải thích vì sao vẫn không được blind replay.
SELF-CHECK: có nêu một invariant, một failure, một test và một giới hạn thật? Chỉ nói I implemented hoặc I ran với phần mình đã xác minh từ công việc cá nhân.
CHẶNG V — FDE VÀ CUSTOMER PROBLEM DECOMPOSITION
MÔ-ĐUN 10 [CORE][FDE] — Problem Decomposition cho người chưa từng học Solution Engineering
10.1. Decomposition khác LLD và System Design
Một yêu cầu như “khách hàng muốn đặt phòng nhanh hơn” chưa chỉ rõ phần mềm phải làm gì.
- Problem Decomposition: bài toán thực sự là gì? ai bị ảnh hưởng? làm phần nào trước? cần xác minh điều gì?
- LLD: khi đã biết chức năng, thiết kế entities/classes/states/API.
- System Design: nối các components, lựa chọn cách xử lý dữ liệu, lỗi, bottleneck.
Thứ tự đúng: Customer problem → Scope → Features/rules → Data/API → Architecture → Delivery & metrics.
Sai lầm phổ biến: nghe chữ “slow” lập tức đề xuất Redis, nghe “automation” lập tức đề xuất AI agents.
10.2. Công thức 6 bước duy nhất
GOAL → CLARIFY → SCOPE → BREAK DOWN → DESIGN → VALIDATE
| Bước | Cần trả lời | Kết quả phải viết ra |
|---|---|---|
| Goal | Họ muốn thay đổi điều gì? | 1 câu problem statement |
| Clarify | Ai, quy trình hiện tại, dữ liệu, constraint? | 4–6 câu hỏi quan trọng |
| Scope | MVP có gì / không có gì? | danh sách in-scope / out-of-scope |
| Break down | Actors, workflows, entities, rules, exceptions? | 3–5 tính năng và dependencies |
| Design | Data/API/components? trade-offs? | sơ đồ tối giản + lựa chọn |
| Validate | Làm sao biết cải thiện? | acceptance criteria + metric + demo |
Khác với trả bài thuộc lòng: interviewer đổi một ràng buộc ⇒ bạn biết phải quay lại bước nào và sửa giả định.
10.3. Worked example 1 — “Hệ thống booking đang rất chậm”
Yêu cầu: Our hotel staff spend too much time handling reservation requests. We want to make it faster.
Bước 1 — Goal
Không vội hiểu là “trang web load chậm”. Chậm có thể là nhân viên phải nhập tay, phải chờ hệ thống khác, hoặc trả lời email chậm.
I'd like to understand which part of the booking process is slow and who is affected.
Bước 2 — Clarify (hỏi để tìm nguyên nhân)
- Who: Staff nào xử lý? Customer hay staff bị ảnh hưởng nhiều nhất?
- Current workflow: Request đến bằng email/phone/web? Ai nhập dữ liệu? Bao nhiêu bước?
- Volume: Một ngày bao nhiêu request, giờ cao điểm?
- Bottleneck: 5 phút chờ thao tác nào? Trả lời khách, check availability hay duyệt?
- Data/source: Lịch phòng nằm ở đâu, có API không?
- Constraints: Deadline, budget, privacy, languages, approval policies?
Bước 3 — giả lập câu trả lời khách hàng: - 100 yêu cầu/ngày qua email. - Nhân viên copy thông tin vào spreadsheet, rồi check availability ở PMS. - 80% yêu cầu là hỏi phòng trống và giá. - API của PMS cho phép tra cứu availability nhưng booking cần nhân viên xác nhận. - MVP cần trong 3 tuần; chưa cần thanh toán online.
Bước 4 — Scope:
- In scope: web form thu thập dates/room type; gọi availability API; tạo request PENDING; staff dashboard; notification.
- Out of scope: AI chatbot, payment gateway, revenue optimization, dynamic pricing.
- Metric: thời gian nhân viên xử lý mỗi request; % yêu cầu phải nhập lại; tỷ lệ lỗi.
Bước 5 — Break down thành workstreams:
A. Collect information
└─ web form + validation
B. Check availability
└─ PMS adapter + timeout handling
C. Create request
└─ booking request data + idempotency
D. Staff approval
└─ dashboard + role/permission + status
E. Observe results
└─ audit/events + processing time measurements
Bước 6 — Design: frontend form → Spring API → PMS adapter → PostgreSQL workflow states → staff dashboard. Nếu external PMS không xác nhận kịp: request thành PENDING_CHECK và nhân viên tra soát, không tự trả CONFIRMED.
Bước 7 — Validate:
Acceptance criteria: - Given dates hợp lệ và PMS trả availability, when customer gửi form, then tạo một request có ID. - Given PMS timeout, then không xác nhận phòng trống; hiển thị thông báo phù hợp và lưu trạng thái để xử lý tiếp. - Given staff không có quyền, then không thể approve. - Given hai lần submit cùng một idempotency key, then không sinh hai business requests khác nhau.
Business metric đề xuất (không bịa số đã đạt): đo median/percentile processing time trước và sau pilot, tỷ lệ re-entry, số lỗi booking.
Câu trả lời cuối 60–90 giây bằng tiếng Anh:
Before proposing a solution, I'd clarify which part of the current process is slow. Let's assume staff manually copy requests from email and check availability in a separate system. For an MVP, I'd provide a booking form, integrate the availability API, and create requests for staff approval. I'd keep payment and AI features out of scope initially. The main risks are stale availability and third-party timeouts, so the system should avoid confirming a booking until we have a reliable result. I'd measure staff handling time and error rates to validate whether the solution helps.
10.4. Worked example 2 — Data integration: ứng dụng rất gần FDE
Đề: Three vendors send product catalogs as CSV files with different formats. Our team spends hours cleaning and importing them.
Clarify: File có cột gì? encoding nào? ID trùng? Mỗi vendor gửi bao lần? Lỗi một dòng thì bỏ cả file hay ghi lỗi? Có hệ thống hiện tại? Có cần review bằng tay?
Định nghĩa MVP:
1. upload CSV + identify vendor;
2. adapter mapping vendor fields → canonical Product schema;
3. validate sku, price, currency, encoding, required fields;
4. detect duplicate file & duplicate SKU theo business rules;
5. import valid rows hoặc quarantine invalid rows; report lỗi;
6. audit import result và cho phép retry idempotent.
Vendor CSV A/B/C
↓
Format-specific adapters
↓
Canonical Product DTO
↓
Validate / Deduplicate
↓
Import transaction/batch → DB
↓
Import report + error rows
Trade-off: fail-fast cả file giúp consistency đơn giản hơn; partial import giúp tận dụng rows hợp lệ nhưng cần reconciliation/status và business sign-off.
Dự án V-Market trong CV của bạn đã có batch importer/encoding/duplicate checking, nên đây là chất liệu phỏng vấn cực phù hợp. Bạn có thể tận dụng kinh nghiệm đó để thảo luận mà không phải học framework mới.
10.5. Discovery questions — học theo nhóm, không học thuộc một trăm câu
| Nhóm | Mẫu câu | Mục đích |
|---|---|---|
| Business goal | What business outcome are you trying to improve? | biết thành công nghĩa là gì |
| Users | Who uses the current workflow? | biết actor |
| Process | Could you walk me through the current process? | hiểu các bước đang làm |
| Constraints | Are there any security or deadline constraints? | không design phi thực tế |
| Data | Where does the source data come from? | biết hệ thống nào là authority |
| Scope | What is essential for the first release? | giữ MVP nhỏ |
| Success | How would you measure success? | chọn metrics đúng |
| Failure | What happens when the external system is unavailable? | chốt quy trình xử lý lỗi |
10.6. Phân biệt assumptions, constraints, acceptance criteria và metrics
- Assumption: điều ta đang tạm tin, cần hỏi/kiểm chứng. Assume approval is required.
- Constraint: giới hạn phải tuân thủ. Must integrate with the existing PMS.
- Functional requirement: tính năng phải có. Staff can approve a booking.
- Non-functional requirement: mức chất lượng/ràng buộc vận hành. Only authorized staff can approve; P95 response time under target under stated load.
- Acceptance criterion: điều kiện cụ thể để nghiệm thu. Given a pending booking, when authorized staff approves, then status becomes confirmed.
- Metric: số đo thành công. Median handling time per request.
10.7. Luyện giải case chưa có sẵn giải pháp — giảm gợi ý
Case A (có gợi ý): A university wants to avoid clashes when students register for classes.
Gợi ý chỉ mở khi bí:
Gợi ý 1
Hỏi: “Clash” là xung đột lịch học, trùng chỗ, capacity, hay prerequisites?
Gợi ý 2
Liệt kê actors: students/admin/teachers; entities: course/section/timetable/enrollment; những rules phải giữ đúng.
Gợi ý 3
Đề xuất MVP trước: view class schedule → choose section → validate constraints/capacity → enroll → confirmation. Nhớ concurrency với last seat.
Case B (không gợi ý): A small logistics company complains that deliveries are often late. Build something to help.
Không được đề xuất ngay app GPS. Trong 12 phút, viết: problem statement, 5 discovery questions, in/out of scope, top 3 features, 2 risks và 2 metrics.
Mẫu trả lời Case B — chỉ mở sau khi làm
- Goal: giảm tỷ lệ giao hàng trễ đã được định nghĩa (ví dụ tính theo deadline đã hứa).
- Clarify: trễ ở pickup, dispatch, routing hay handoff? Quy mô chuyến? Dữ liệu GPS tồn tại không? Ai xử lý ngoại lệ? Deadline/nguồn lực?
- MVP giả định: dashboard đơn hàng, ETA/status collection từ dữ liệu đang có, cảnh báo đơn nguy cơ trễ và phân công xử lý.
- Out of scope: tối ưu route bằng AI, tự động hóa toàn bộ đội xe.
- Risks: dữ liệu cập nhật chậm; sai ETA; không ai nhận cảnh báo.
- Metrics: late-delivery rate, average delay, time-to-detect, time-to-resolve.
- Thiết kế chỉ quyết định sau khi khách xác nhận loại chậm và nguồn dữ liệu.
10.8. FDE interview scorecard (tự chấm 0–2 mỗi tiêu chí)
| Tiêu chí | 0 điểm | 1 điểm | 2 điểm |
|---|---|---|---|
| Discovery | không hỏi | hỏi 1–2 câu chung | hỏi đúng bottleneck, users, constraints |
| Scope | xây mọi thứ | MVP chưa rõ | MVP có in/out rõ |
| Breakdown | một câu chung | nêu vài features | workflows + entities + business rules |
| Design | kể tech stack | có API/data nhưng thiếu flow | flow hợp lý, đơn giản, nhất quán |
| Risks | không nhắc lỗi | có 1 failure | nêu failure + mitigation phù hợp |
| Success | không có KPI | KPI chung chung | acceptance criteria + measurable KPI |
| Communication | nói lan man | đủ ý nhưng không rõ | tóm tắt logic, trả lời thay đổi |
12–14/14 là tiêu chuẩn tự luyện đề xuất, không có ý nghĩa bảo đảm pass. Quan trọng hơn: làm được trên một case chưa từng đọc trước.
🎙️ SPEAKING LAB V5.2 — 10. FDE discovery và problem decomposition
Thứ tự sử dụng: PRETEST → WATCH & DO ngay trong phần kiến thức phía trên → LISTEN/SHADOW → FREE SPEAK → FOLLOW-UP → feedback. Không mở đáp án trước lượt nói đầu.
Những ý kỹ thuật phải hiểu trước khi nói: Goal → Clarify → Scope → Break down → Design → Validate; metrics and acceptance criteria.
Từ đơn → cụm nói được (chỉ chọn 3–5 cụm để ôn hôm nay):
| Useful chunk | Nghĩa |
|---|---|
clarify the business goal |
làm rõ mục tiêu kinh doanh |
define the MVP scope |
xác định phạm vi MVP |
state an assumption |
nêu giả định |
agree on acceptance criteria |
thống nhất điều kiện nghiệm thu |
1. PRETEST + WATCH + DO
Hoàn thành ít nhất một bài COMPLETE/DO ở phía trên (hoặc giải thích một ví dụ mới). Nếu chưa giải thích được cơ chế bằng tiếng Việt, quay lại bài kỹ thuật trước khi bắt đầu nói.
2. LISTEN → SHADOW
A — LISTEN & SHADOW (3–4 phút): Ẩn chữ; dùng TTS/Voice đọc lần lượt các câu sau. Lượt 1 nghe và tóm tắt ý; lượt 2–3 bắt chước nhịp nói, rồi nói lại không nhìn.
- Before proposing a solution, I would clarify which workflow is failing and how often.
- I would define an MVP and measurable acceptance criteria with the customer.
3. COMPLETE ORALLY
B — COMPLETE ORALLY (1–2 phút): Điền bằng giọng nói, không cần viết câu hoàn chỉnh trước.
Before choosing a technology, I would ask . My MVP would . We could validate it by ___.
4. FREE SPEAK — định nghĩa / cơ chế (không nhìn script)
Chọn 3–5 câu/lượt trong 2 câu sau. Đáp án được thu gọn dưới từng câu; chỉ mở sau khi đã nói.
Q207 · FOUNDATION · BASE V4
TTS 413 · Q: What makes an acceptance criterion testable?
Mở đáp án mẫu Q207 — sau khi tự trả lời
TTS 414 · A: A testable acceptance criterion has a clear action, condition, and expected result. For example, a valid booking request should return a confirmed result within an agreed target under a defined test load.
Q208 · MECHANISM / WHY · ADD V5
TTS 415 · Q: What is the difference between a business outcome and a technical output?
Mở đáp án mẫu Q208 — sau khi tự trả lời
TTS 416 · A: A technical output is something we build, such as an API or dashboard. A business outcome is the effect, such as fewer manual errors or faster processing. I would define a metric for the outcome.
5. UNEXPECTED FOLLOW-UP — thay giả định và suy luận
Chọn ít nhất một câu dưới đây, tự trả lời trước; sau đó yêu cầu người luyện thay một điều kiện mới.
Q209 · SCENARIO / FOLLOW-UP · BASE V4
TTS 417 · Q: A customer says their booking system is slow. What do you ask first?
Mở đáp án mẫu Q209 — sau khi tự trả lời
TTS 418 · A: I would ask which workflow is slow, when the problem happens, and how many users are affected. Then I would inspect latency metrics, logs, and the business impact before proposing a fix.
Q210 · SCENARIO / FOLLOW-UP · BASE V4
TTS 419 · Q: How would you distinguish symptoms from actual business goals?
Mở đáp án mẫu Q210 — sau khi tự trả lời
TTS 420 · A: A symptom is what users notice, such as a slow screen. The business goal may be faster check-in or fewer staff errors. I would ask what outcome matters and how it will be measured.
Q211 · SCENARIO / FOLLOW-UP · BASE V4
TTS 421 · Q: What if the customer wants to automate everything in the first release?
Mở đáp án mẫu Q211 — sau khi tự trả lời
TTS 422 · A: I would ask the customer to rank the workflows by value and risk. Then I would propose a small MVP that solves the most important problem first and leaves lower-priority automation for later.
Q212 · SCENARIO / FOLLOW-UP · BASE V4
TTS 423 · Q: How would you respond if the assumed root cause is disproved?
Mở đáp án mẫu Q212 — sau khi tự trả lời
TTS 424 · A: I would show the new evidence and revise my hypothesis. Then I would investigate other causes and update the plan. I should not defend an assumption after the data disproves it.
Q213 · SCENARIO / FOLLOW-UP · ADD V5
TTS 425 · Q: How would you start a discovery meeting with a nontechnical client?
Mở đáp án mẫu Q213 — sau khi tự trả lời
TTS 426 · A: I would ask them to walk me through the current process and the main pain point. Then I would clarify who uses the process, how often it fails, and what improvement would matter.
Q214 · SCENARIO / FOLLOW-UP · ADD V5
TTS 427 · Q: How would you define acceptance criteria for a small MVP?
Mở đáp án mẫu Q214 — sau khi tự trả lời
TTS 428 · A: I would write scenarios with clear inputs, conditions, and expected results. I would include at least one failure case and an agreed measure of success. The client should confirm these criteria before delivery.
6. REPEAT + FEEDBACK — checkpoint
E — REPEAT + FEEDBACK: Chọn câu khó nhất ở phần FREE SPEAK, nói 3 lượt (45–60 giây → 30–45 giây → 20–30 giây ở L1; tăng thời lượng ở L2), giữ ý chính và một test/example. Mở câu trả lời ngay dưới câu hỏi sau lượt 1; mỗi lượt chỉ sửa tối đa 2 lỗi.
- Thời lượng mục tiêu: L1: 3 discovery questions; L2: 90 giây scope + metric; L3: live requirement change.
- Điều kiện qua bài: Không giải pháp hóa quá sớm; đặt được câu hỏi về user, impact, constraints, source of truth và measurable success.
- Điểm dễ nói sai / hiểu sai: FDE không chỉ nói tech stack: phải liên hệ business outcome và điều kiện nghiệm thu.
| Self-check (đánh dấu sau khi nói) | Yes/No |
|---|---|
| Tôi giải đúng kiến thức và nêu được ví dụ / failure / test cần thiết | [ ] |
| Tôi hiểu câu hỏi khi nghe, hoặc hỏi lại đúng chỗ | [ ] |
| Tôi tự nói không nhìn script; có mở đầu và kết luận rõ | [ ] |
| Tôi xử lý được ít nhất 1 follow-up mới | [ ] |
Mẫu trả lời dài V4 (tùy chọn; xem sau khi tự nói)
Show sample only after speaking
One possible answer (~40–90 words):
If a customer says the booking system is slow, I would first ask which workflow is slow, how often it happens, and how it affects users. I would request evidence such as latency measurements and error logs. For the MVP, I would focus on the highest-impact bottleneck, not redesign the entire platform. We should agree on measurable acceptance criteria and verify the result with a realistic workload.
Knowledge guardrail: FDE không chỉ nói tech stack: phải liên hệ business outcome và điều kiện nghiệm thu.
Reverse recall: Che sample; nói lại bằng từ của mình rồi trả lời follow-up số 2 trong Speaking Lab 10.
LAB C [CORE][FDE] — Cold Decomposition: đề mới, yêu cầu thay đổi, không học thuộc
Mục tiêu: có thể nói chuyện với interviewer như với khách hàng thực sự. Không cố đoán họ muốn nghe tech stack nào. Đây là bài mô phỏng dựa trên kiểu năng lực đã được ứng viên FDSE/FDE kể lại, không phải đề thi công ty cụ thể.
C0. Công thức dùng khi đứng hình
GOAL → CLARIFY → SCOPE → WORKFLOW & DATA → EDGE CASES → VALIDATE.
Đặt tối thiểu một câu mỗi nhóm: Users? Current pain? Success metric? Data source? Permissions? Failure/constraint? Sau đó mô tả MVP bằng 3–5 hành động có thể quan sát, rồi mới nói component/API.
Khác biệt: Decomposition bắt đầu khi bài toán còn mơ hồ; LLD đi sâu vào classes/state/API cho chức năng đã chốt; system design giải thích cách các components tương tác và những quality constraints. Đừng nhảy vào sơ đồ server khi người dùng còn chưa xác định vấn đề.
C1. Cold case 1 — Kho hàng của cửa hàng nhỏ (12 phút)
A local retailer says, “Our inventory data is never accurate. Build a system to fix this.”
Không đọc đáp án trước. Viết: 5 discovery questions; 1 goal đo được; 1 MVP tối đa 3 features; 4 entities; 3 edge cases; 2 acceptance criteria.
Interviewer bất ngờ bổ sung ở phút 6: We already use an old point-of-sale system that exports CSV nightly. Employees still sell items during imports.
Sửa lại: đâu là source of truth, file snapshot hay delta, điều gì xảy ra nếu đè stock sau sale? Không cần thiết kế event streaming nếu chưa cần.
C2. Cold case 2 — Scheduling thay đổi thường xuyên (12 phút)
An operations manager says, “Shifts change every day and people keep showing up at the wrong time.”
Phải làm: goal, actors, workflow hiện tại, minimum feature, data model và cách thông báo thay đổi.
Interviewer thay yêu cầu: Employees do not have company email, some share phones, and managers need an audit trail.
Làm lại: authentication/identity giả định ban đầu có còn hợp lệ? kênh thông báo, consent, access control và audit có thay đổi không?
C3. Cold case 3 — Bảo vệ sự chính xác của báo cáo (12 phút)
A finance team receives daily reports from 3 suppliers and says their numbers do not match. They want automation.
Phải làm: xác định loại dữ liệu, cách nhận file/API, có canonical IDs không, thế nào là mismatch, rule xử lý và ai phê duyệt ngoại lệ.
Interviewer thay yêu cầu: One supplier sometimes sends corrections for the previous day.
Thiết kế lại idempotency/version/source timestamp và reconciliation; đừng giả định daily import append-only.
C4. Cold case 4 — Đặt lịch dịch vụ (15 phút, luyện bằng tiếng Anh)
The owner of a chain of repair shops says, “Customers complain that online appointments are unreliable.”
Trả lời tiếng Anh (có thể dùng câu ngắn):
- Three questions about problem / users / existing workflow.
- Two questions about source of truth / branch constraints.
- MVP with 3 features.
- One concurrency problem, one external integration failure.
- One customer-facing demo scenario and two measurable success criteria.
Interviewer đổi scope ở phút 8: Employees currently confirm every booking manually. We cannot remove manual approval in the first release.
Điều chỉnh state machine và acceptance criteria, không tự ép auto-confirmation.
C5. Khuôn trả lời 90 giây — không phải script cố định
Before proposing a solution, I'd like to understand the current workflow and which failure matters most. For the first release, I would focus on [one pain point] for [specific user]. The core data would include [entities]. One important risk is [failure case], so I would [control/test]. I'd validate the MVP using [measurable outcome].
Rubric 0–2 mỗi tiêu chí (tổng 12): Goal đúng vấn đề; questions làm rõ; MVP có phạm vi; workflow/data hợp lý; xử lý thay đổi yêu cầu; validation đo được. 0: không có, 1: có nhưng mơ hồ, 2: cụ thể và phù hợp giả định. 8+/12 là ngưỡng tự luyện để chuyển case; không phải chuẩn tuyển dụng.
HƯỚNG GIẢI — chỉ mở khi đã làm cả 4 case
C1: Hỏi stock có từ POS/ERP không, SKU/vendor mapping, snapshot/delta, tần suất, bán hàng online/offline, mục tiêu sai lệch. MVP: nhận feed → staging/reject report → apply có kiểm soát + reconciliation. Product, StockMovement, ImportJob, ImportRow/Discrepancy. Không overwrite snapshot cũ lên sale mới nếu chưa có cutoff/version policy. Acceptance: không tạo SKU trùng, rejected rows có reason, xử lý sale/import đồng thời không làm mất biến động đã commit.
C2: Goal giảm ca xuất hiện sai lịch. Xác minh người đổi lịch, approval, lead time, notification read/ack, thiết bị có/không. MVP: canonical roster, permissioned change, acknowledgement + audit. Employee, Shift, ShiftAssignment, ChangeRequest, AuditEvent. Shared phones làm identity kém tin cậy; chọn cơ chế xác thực phù hợp điều kiện người dùng, không giả định chỉ cần email. Metrics: tỷ lệ missed shift, notification acknowledgement delay.
C3: Cần định nghĩa canonical source, ID, timezone, currency, adjustment vs replacement, cutoff, người xác nhận mismatch. MVP: ingest/stage/normalize, reconciliation report, manual resolution. Supplier, DailyStatement, StatementVersion, ReconciliationRun, Discrepancy. Correction có version/effective date; rerun cho ngày liên quan không ghi đè history. Metrics: unresolved discrepancy count và resolution time. Không tự tạo chuyển tiền hoặc tự sửa số liệu chưa được duyệt.
C4: Hỏi fail tại booking, staff confirm, reminders hay branch inventory? Nguồn lịch có tập trung không? Appointment(PENDING_APPROVAL, CONFIRMED, REJECTED, CANCELLED); API tạo request/duyệt/cancel, branch/service/slot mapping. Concurrent booking không được tạo hai confirmations cho cùng slot. Timeout sau submit cần request ID/status lookup; demo staff xác nhận một appointment và customer nhận trạng thái. Metrics: thời gian tới confirmation và tỷ lệ khách phải gọi lại/booking bị trùng. Scope change giữ staff approval là requirement bắt buộc.
Nhiều hướng giải đúng: tiêu chí là không bịa business rules; nêu assumptions, dữ liệu, concurrency, failure và kiểm chứng rõ.
Qua LAB C nếu: nhận đề mơ hồ mới mà bạn có thể đặt câu hỏi, chọn MVP và cập nhật khi requirement thay đổi, thay vì đọc lại một case đã thuộc.
🎙️ SPEAKING LAB V5.2 — C. FDE cold cases + changing requirements
Thứ tự sử dụng: PRETEST → WATCH & DO ngay trong phần kiến thức phía trên → LISTEN/SHADOW → FREE SPEAK → FOLLOW-UP → feedback. Không mở đáp án trước lượt nói đầu.
Những ý kỹ thuật phải hiểu trước khi nói: Unseen case; discovery; explicit assumptions; alternative and trade-off; update plan under change.
Từ đơn → cụm nói được (chỉ chọn 3–5 cụm để ôn hôm nay):
| Useful chunk | Nghĩa |
|---|---|
revisit the scope |
xem lại phạm vi |
adjust the proposed design |
điều chỉnh thiết kế đề xuất |
identify a constraint |
xác định ràng buộc |
run an acceptance test |
chạy kiểm thử nghiệm thu |
1. PRETEST + WATCH + DO
Hoàn thành ít nhất một bài COMPLETE/DO ở phía trên (hoặc giải thích một ví dụ mới). Nếu chưa giải thích được cơ chế bằng tiếng Việt, quay lại bài kỹ thuật trước khi bắt đầu nói.
2. LISTEN → SHADOW
A — LISTEN & SHADOW (3–4 phút): Ẩn chữ; dùng TTS/Voice đọc lần lượt các câu sau. Lượt 1 nghe và tóm tắt ý; lượt 2–3 bắt chước nhịp nói, rồi nói lại không nhìn.
- That new requirement changes my assumption about the source of truth.
- I would revise the MVP scope and validate the new constraint before implementing it.
3. COMPLETE ORALLY
B — COMPLETE ORALLY (1–2 phút): Điền bằng giọng nói, không cần viết câu hoàn chỉnh trước.
Originally, I assumed . With this new requirement, . I would change ___ and validate ___.
4. FREE SPEAK — định nghĩa / cơ chế (không nhìn script)
Chọn 3–5 câu/lượt trong 4 câu sau. Đáp án được thu gọn dưới từng câu; chỉ mở sau khi đã nói.
Q215 · MECHANISM / WHY · BASE V4
TTS 429 · Q: Choose one cold case from LAB C and explain your first three discovery questions.
Mở đáp án mẫu Q215 — sau khi tự trả lời
TTS 430 · A: I would first ask who uses the workflow and what problem they face. Second, I would ask where the data comes from and which source is trusted. Third, I would ask how we measure success.
Q216 · MECHANISM / WHY · BASE V4
TTS 431 · Q: How do you decide what belongs in an MVP?
Mở đáp án mẫu Q216 — sau khi tự trả lời
TTS 432 · A: I would choose the smallest workflow that delivers measurable value. It needs clear assumptions, a testable result, and a realistic scope. I would defer nonessential features.
Q217 · FOUNDATION · BASE V4
TTS 433 · Q: What is your fallback if the customer data source is unavailable?
Mở đáp án mẫu Q217 — sau khi tự trả lời
TTS 434 · A: I would clarify whether we can use cached data, pause processing, or ask for manual review. I would not silently accept stale or unverified data when correctness matters.
Q218 · FOUNDATION · BASE V4
TTS 435 · Q: Which metric would show business value after deployment?
Mở đáp án mẫu Q218 — sau khi tự trả lời
TTS 436 · A: I would choose a metric linked to the customer’s goal, such as processing time, error rate, or manual work hours. I would measure it before and after deployment under comparable conditions.
5. UNEXPECTED FOLLOW-UP — thay giả định và suy luận
Chọn ít nhất một câu dưới đây, tự trả lời trước; sau đó yêu cầu người luyện thay một điều kiện mới.
Q219 · SCENARIO / FOLLOW-UP · BASE V4
TTS 437 · Q: The interviewer changes one business rule. How do you update the design?
Mở đáp án mẫu Q219 — sau khi tự trả lời
TTS 438 · A: I would restate the new rule and identify which entities, states, APIs, and tests it affects. Then I would update the design and explain any extra cost or risk.
Q220 · SCENARIO / FOLLOW-UP · ADD V5
TTS 439 · Q: The customer changes the source of truth during the interview. What do you do?
Mở đáp án mẫu Q220 — sau khi tự trả lời
TTS 440 · A: I would clarify which source is authoritative and whether it can be delayed or incorrect. Then I would update the data flow, conflict rules, and tests. I would explain the new trade-off before continuing.
Q221 · SCENARIO / FOLLOW-UP · ADD V5
TTS 441 · Q: What if the customer needs a working demo next week?
Mở đáp án mẫu Q221 — sau khi tự trả lời
TTS 442 · A: I would reduce scope to one high-value workflow and reuse reliable existing components. I would identify the riskiest integration early and agree on what the demo must prove.
Q222 · SCENARIO / FOLLOW-UP · ADD V5
TTS 443 · Q: How would you prioritize two competing customer requests?
Mở đáp án mẫu Q222 — sau khi tự trả lời
TTS 444 · A: I would compare their business impact, urgency, implementation cost, and dependencies. If priorities still conflict, I would ask the customer to decide based on explicit trade-offs.
6. REPEAT + FEEDBACK — checkpoint
E — REPEAT + FEEDBACK: Chọn câu khó nhất ở phần FREE SPEAK, nói 3 lượt (45–60 giây → 30–45 giây → 20–30 giây ở L1; tăng thời lượng ở L2), giữ ý chính và một test/example. Mở câu trả lời ngay dưới câu hỏi sau lượt 1; mỗi lượt chỉ sửa tối đa 2 lỗi.
- Thời lượng mục tiêu: L1: 45 giây assumptions; L2: 90 giây; L3: interviewer ngắt ngang và thay scope.
- Điều kiện qua bài: Đáp án ứng biến chứ không lặp mẫu cũ; thay đổi assumptions/rules/tests theo yêu cầu.
- Điểm dễ nói sai / hiểu sai: Thay requirement phải thay model/test và đôi khi scope; không chỉ thay tên endpoint.
| Self-check (đánh dấu sau khi nói) | Yes/No |
|---|---|
| Tôi giải đúng kiến thức và nêu được ví dụ / failure / test cần thiết | [ ] |
| Tôi hiểu câu hỏi khi nghe, hoặc hỏi lại đúng chỗ | [ ] |
| Tôi tự nói không nhìn script; có mở đầu và kết luận rõ | [ ] |
| Tôi xử lý được ít nhất 1 follow-up mới | [ ] |
Mẫu trả lời dài V4 (tùy chọn; xem sau khi tự nói)
Show sample only after speaking
One possible answer (~40–90 words):
Originally, I assumed that the customer had one reliable data source. If the requirement changes and there are two conflicting sources, I need to clarify which source is authoritative. I would update the data flow and define how conflicts are handled. Then I would narrow the MVP to a testable workflow and agree on acceptance criteria for correctness, latency, and recoverability.
Knowledge guardrail: Thay requirement phải thay model/test và đôi khi scope; không chỉ thay tên endpoint.
Reverse recall: Che sample; nói lại bằng từ của mình rồi trả lời follow-up số 2 trong Speaking Lab C.
CHẶNG VI — GIAO TIẾP, LEARNING & PRACTICAL CODING
MÔ-ĐUN 11 [CORE] — Technical English: nói tự nhiên, ngắn, có cấu trúc
11.1. Vấn đề thật của người đã biết Java nhưng tiếng Anh kỹ thuật yếu
Bạn có thể biết câu trả lời bằng tiếng Việt nhưng vấp ở ba bước: 1. Decode: không biết interviewer đang yêu cầu definition, mechanism, trade-off hay example. 2. Retrieve: biết tiếng Việt nhưng không gọi ra được keywords tiếng Anh. 3. Speak: nghĩ quá lâu hoặc nói lan man vì cố tìm câu hoàn hảo.
Giải pháp: dùng short answer first. Một câu định hướng → 2–3 ý chính → ví dụ. Không cần mỹ từ.
11.2. Bộ từ “động từ chuyên môn” đáng luyện nhất
| Từ | Dùng trong câu nào? |
|---|---|
| validate | validate user input |
| enforce | enforce business rules / access control |
| retrieve | retrieve a booking from the database |
| persist | persist a record |
| allocate | allocate inventory |
| prevent | prevent duplicate requests |
| ensure | ensure data consistency (trong phạm vi bảo đảm) |
| handle | handle failures / exceptions |
| retry | retry a failed request safely |
| reproduce | reproduce a bug |
| investigate | investigate the root cause |
| trace | trace a request across components |
| measure | measure latency / success rate |
| trade off | trade off simplicity against scalability |
| assume / clarify | assume approval is required / clarify requirements |
| prioritize / exclude | prioritize the MVP / exclude payment initially |
11.3. Bốn kiểu hỏi — bốn cách trả lời (với câu thật)
Kiểu 1 — WHAT: What is dependency injection?
Dependency injection means providing dependencies from outside a class instead of creating them inside it. In Spring, constructor injection makes dependencies explicit and helps with testing.
Kiểu 2 — HOW: Walk me through the booking request flow.
The controller validates the request and calls the service. The service checks business rules, interacts with the inventory store, and persists the booking when the conditions are met. The API then returns a booking ID and its status.
Kiểu 3 — WHY: Why did you use Redis?
We used Redis for caching and rate limiting. It can reduce repeated database reads, but cached data may become stale, so we don't rely on it as the only source of truth for critical booking decisions.
Kiểu 4 — WHAT IF: What if the third-party service times out?
We cannot assume that the operation failed just because the response timed out. I would use a request identifier, check the operation status, and retry only when the API contract supports safe retries. Otherwise, the request should remain pending for reconciliation.
11.4. Mini dialogue — mock discussion FDE (từng bước)
Interviewer: Our support team says the current process is too slow. What would you build?
Candidate (good first move): Before proposing a solution, could you describe the current workflow and the main bottleneck?
Interviewer: They manually copy requests from email to a spreadsheet.
Candidate: Understood. Roughly how many requests arrive daily, and do you have an existing customer database or API?
Interviewer: About a hundred daily, and we have a basic API.
Candidate: For an MVP, I would consider a structured intake form integrated with that API, so staff no longer need to copy data manually. We'd also need validation, duplicate prevention, and a way to handle API failures.
Interviewer: What if the API is down?
Candidate: I'd avoid losing the request. Depending on the business rules, I'd store it as pending, display the status to staff, and retry or reconcile when the API recovers.
Học được gì? Người trả lời không bắt đầu bằng tên framework; họ hỏi, chọn MVP và phản ứng khi ràng buộc thay đổi.
11.5. Vòng nói 10 phút hàng ngày
- 2 phút: đọc 5 câu hỏi, đoán dạng câu hỏi.
- 3 phút: lấy 1 khái niệm bất kỳ (transaction/index/DI/cache), nói 30–45 giây.
- 3 phút: nói 1 luồng trong project hoặc 1 case problem decomposition, không script.
- 2 phút: nghe/đọc lại, sửa 1 lỗi nội dung và 1 lỗi diễn đạt.
Tiêu chuẩn đạt: người nghe hiểu what, how, why, dù ngữ pháp chưa hoàn hảo. Với câu không biết, có thể nói rõ giới hạn và đề xuất cách kiểm chứng.
11.6. Project deep dive — 8 câu chỉ cần luyện 1 project thật sâu
Lưu ý: các câu sau là đề mô phỏng dựa vào kinh nghiệm trong CV, không phải câu hỏi đã được xác nhận từ công ty tuyển dụng.
- What problem does your project solve?
- Which parts did you personally implement?
- Walk me through one important request from UI to database.
- Why did you choose this database/cache/framework?
- What happens if an external API times out?
- How do you protect against duplicate or concurrent operations?
- What is one difficult bug you encountered? How did you debug it?
- If you were to build it again, what would you improve?
Khung trả lời 45–90 giây: Context → My action / implementation → Why → Test / observed outcome → Limitation. Đừng bịa số liệu hoặc nói “I built everything” nếu làm theo team.
11.7. DSA speaking tối giản
The problem asks us to ... My first approach would be ... That takes O(...). We can improve it by ... One important edge case is ... I would verify it with ...
Example:
The problem asks us to find two numbers whose sum matches the target. A brute-force solution checks every pair in O(n²). A hash map lets us check the complement in O(n) expected time, using O(n) extra space. I'd test duplicates and negative values.
🎙️ SPEAKING LAB V5.2 — 11. Technical English, project story, DSA explanation
Thứ tự sử dụng: PRETEST → WATCH & DO ngay trong phần kiến thức phía trên → LISTEN/SHADOW → FREE SPEAK → FOLLOW-UP → feedback. Không mở đáp án trước lượt nói đầu.
Những ý kỹ thuật phải hiểu trước khi nói: Clear short answers; project flow; contribution; why/failure/test; DSA describe complexity.
Từ đơn → cụm nói được (chỉ chọn 3–5 cụm để ôn hôm nay):
| Useful chunk | Nghĩa |
|---|---|
I was responsible for... |
tôi phụ trách... |
one challenge was... |
một khó khăn là... |
I chose this approach because... |
tôi chọn cách này vì... |
the time complexity is... |
độ phức tạp thời gian là... |
1. PRETEST + WATCH + DO
Hoàn thành ít nhất một bài COMPLETE/DO ở phía trên (hoặc giải thích một ví dụ mới). Nếu chưa giải thích được cơ chế bằng tiếng Việt, quay lại bài kỹ thuật trước khi bắt đầu nói.
2. LISTEN → SHADOW
A — LISTEN & SHADOW (3–4 phút): Ẩn chữ; dùng TTS/Voice đọc lần lượt các câu sau. Lượt 1 nghe và tóm tắt ý; lượt 2–3 bắt chước nhịp nói, rồi nói lại không nhìn.
- I worked on a backend feature and focused on the request flow and error handling.
- One trade-off was added complexity in exchange for stronger consistency.
3. COMPLETE ORALLY
B — COMPLETE ORALLY (1–2 phút): Điền bằng giọng nói, không cần viết câu hoàn chỉnh trước.
The project solves . My contribution was . One issue was . I tested it by .
4. FREE SPEAK — định nghĩa / cơ chế (không nhìn script)
Chọn 3–5 câu/lượt trong 12 câu sau. Đáp án được thu gọn dưới từng câu; chỉ mở sau khi đã nói.
Q223 · PROJECT TEMPLATE · BASE V4
TTS 445 · Q: Tell me about one backend project in 60 seconds.
Cần cá nhân hóa: Câu trả lời sau chỉ là khung học từ vựng/cách triển khai ý, không mô tả kinh nghiệm có thật.
Mở đáp án mẫu Q223 — sau khi tự trả lời
TTS 446 · A: For practice, I would describe a Java backend project that handles business requests. I would explain the user problem, the main API flow, and one technical decision. I would only claim work that I actually did.
Q224 · MECHANISM / WHY · BASE V4
TTS 447 · Q: Explain one bug and how you verified the fix.
Mở đáp án mẫu Q224 — sau khi tự trả lời
TTS 448 · A: I would explain how I reproduced the bug, what caused it, and what I changed. Then I would describe the test and its actual result. I would not claim the fix worked without evidence.
Q225 · MECHANISM / WHY · BASE V4
TTS 449 · Q: Walk me through one DSA solution and its time complexity.
Mở đáp án mẫu Q225 — sau khi tự trả lời
TTS 450 · A: First, I would explain the input and expected output. Then I would describe the main steps and data structure. Finally, I would give the time and space complexity and explain why.
Q226 · PROJECT TEMPLATE · BASE V4
TTS 451 · Q: Which parts did you personally implement?
Cần cá nhân hóa: Câu trả lời sau chỉ là khung học từ vựng/cách triển khai ý, không mô tả kinh nghiệm có thật.
Mở đáp án mẫu Q226 — sau khi tự trả lời
TTS 452 · A: I would name the classes, features, and tests I personally worked on. For everything else, I would say that I reviewed or learned from it rather than claiming ownership.
Q227 · PROJECT TEMPLATE · ADD V5
TTS 453 · Q: What problem does your project solve?
Cần cá nhân hóa: Câu trả lời sau chỉ là khung học từ vựng/cách triển khai ý, không mô tả kinh nghiệm có thật.
Mở đáp án mẫu Q227 — sau khi tự trả lời
TTS 454 · A: I would start with the user problem and the workflow the project supports. Then I would name the main backend responsibility and a result I can actually demonstrate. I would replace this practice outline with facts from my own project.
Q228 · PROJECT TEMPLATE · ADD V5
TTS 455 · Q: How can you prove which parts you personally implemented?
Cần cá nhân hóa: Câu trả lời sau chỉ là khung học từ vựng/cách triển khai ý, không mô tả kinh nghiệm có thật.
Mở đáp án mẫu Q228 — sau khi tự trả lời
TTS 456 · A: I would name the endpoints, services, queries, or tests I wrote myself. I would separate my work from team contributions. I would be ready to open the relevant code and explain one decision.
Q229 · PROJECT TEMPLATE · ADD V5
TTS 457 · Q: Walk me through one important request from UI to database.
Cần cá nhân hóa: Câu trả lời sau chỉ là khung học từ vựng/cách triển khai ý, không mô tả kinh nghiệm có thật.
Mở đáp án mẫu Q229 — sau khi tự trả lời
TTS 458 · A: First, the client sends a request to an endpoint. The controller validates the input, and the service applies business rules. The repository accesses the database, and the API returns a result. For my real project, I must describe the actual classes and flow.
Q230 · PROJECT TEMPLATE · ADD V5
TTS 459 · Q: Why did you choose this database/cache/framework?
Cần cá nhân hóa: Câu trả lời sau chỉ là khung học từ vựng/cách triển khai ý, không mô tả kinh nghiệm có thật.
Mở đáp án mẫu Q230 — sau khi tự trả lời
TTS 460 · A: I would connect the choice to a requirement such as relational consistency or read performance. Then I would explain one alternative and one trade-off. I would only say I chose a tool if I actually participated in that decision.
Q231 · PROJECT TEMPLATE · ADD V5
TTS 461 · Q: What happens if an external API times out?
Cần cá nhân hóa: Câu trả lời sau chỉ là khung học từ vựng/cách triển khai ý, không mô tả kinh nghiệm có thật.
Mở đáp án mẫu Q231 — sau khi tự trả lời
TTS 462 · A: A timeout may leave the operation's result unknown. I would describe the actual error handling, retries, and status checks implemented in my code. If those protections are missing, I would state that honestly as a limitation.
Q232 · PROJECT TEMPLATE · ADD V5
TTS 463 · Q: How do you protect against duplicate or concurrent operations?
Cần cá nhân hóa: Câu trả lời sau chỉ là khung học từ vựng/cách triển khai ý, không mô tả kinh nghiệm có thật.
Mở đáp án mẫu Q232 — sau khi tự trả lời
TTS 464 · A: I would identify the business invariant and show where the system enforces it. Possible mechanisms include a unique constraint, an atomic update, or persistent idempotency handling. I would describe only the mechanism that exists in my project.
Q233 · PROJECT TEMPLATE · ADD V5
TTS 465 · Q: What is one difficult bug you encountered? How did you debug it?
Cần cá nhân hóa: Câu trả lời sau chỉ là khung học từ vựng/cách triển khai ý, không mô tả kinh nghiệm có thật.
Mở đáp án mẫu Q233 — sau khi tự trả lời
TTS 466 · A: I would explain the symptom, how I reproduced it, and what evidence revealed the cause. Then I would describe the fix and the test that prevented a regression. I need a real example rather than an invented story.
Q234 · PROJECT TEMPLATE · ADD V5
TTS 467 · Q: If you were to build it again, what would you improve?
Cần cá nhân hóa: Câu trả lời sau chỉ là khung học từ vựng/cách triển khai ý, không mô tả kinh nghiệm có thật.
Mở đáp án mẫu Q234 — sau khi tự trả lời
TTS 468 · A: I would choose one concrete limitation supported by the current code. Then I would propose a small improvement and explain its benefit and cost. I would avoid promising a complete redesign without evidence.
5. UNEXPECTED FOLLOW-UP — thay giả định và suy luận
Chọn ít nhất một câu dưới đây, tự trả lời trước; sau đó yêu cầu người luyện thay một điều kiện mới.
Q235 · SCENARIO / FOLLOW-UP · BASE V4
TTS 469 · Q: If you had one more week, what would you improve and why?
Mở đáp án mẫu Q235 — sau khi tự trả lời
TTS 470 · A: I would improve the highest-risk part first, based on evidence from tests or measurements. I would explain why that change matters and how I would verify it.
Q236 · SCENARIO / FOLLOW-UP · ADD V5
TTS 471 · Q: How would you explain Two Sum and its time complexity?
Mở đáp án mẫu Q236 — sau khi tự trả lời
TTS 472 · A: The goal is to find two indices whose values add up to a target. A hash map lets us look up the needed complement in expected O(n) time with O(n) extra space. I would test duplicate values and negative numbers.
6. REPEAT + FEEDBACK — checkpoint
E — REPEAT + FEEDBACK: Chọn câu khó nhất ở phần FREE SPEAK, nói 3 lượt (45–60 giây → 30–45 giây → 20–30 giây ở L1; tăng thời lượng ở L2), giữ ý chính và một test/example. Mở câu trả lời ngay dưới câu hỏi sau lượt 1; mỗi lượt chỉ sửa tối đa 2 lỗi.
- Thời lượng mục tiêu: L1: project 4 câu; L2: 90 giây flow/challenge/test; L3: 2 phút và 2 follow-ups không soạn trước.
- Điều kiện qua bài: Phân biệt contribution trực tiếp và chỉ đọc từ code/repo; nói có kết cấu và không phóng đại sản phẩm.
- Điểm dễ nói sai / hiểu sai: Mẫu trên là cách kể, không phải xác nhận bạn đã tự làm mọi tính năng được nhắc tới.
| Self-check (đánh dấu sau khi nói) | Yes/No |
|---|---|
| Tôi giải đúng kiến thức và nêu được ví dụ / failure / test cần thiết | [ ] |
| Tôi hiểu câu hỏi khi nghe, hoặc hỏi lại đúng chỗ | [ ] |
| Tôi tự nói không nhìn script; có mở đầu và kết luận rõ | [ ] |
| Tôi xử lý được ít nhất 1 follow-up mới | [ ] |
Mẫu trả lời dài V4 (tùy chọn; xem sau khi tự nói)
Show sample only after speaking
One possible answer (~40–90 words):
One project I can discuss is a Java Spring Boot backend that handles order-related workflows. I would start by explaining the user problem and the request flow. Then I would describe one issue, such as duplicate operations or inventory concurrency, and the specific code and tests I can verify. I would clearly distinguish my implementation from features I only explored. The main lesson is to explain design decisions with evidence, not just tool names.
Knowledge guardrail: Mẫu trên là cách kể, không phải xác nhận bạn đã tự làm mọi tính năng được nhắc tới.
Reverse recall: Che sample; nói lại bằng từ của mình rồi trả lời follow-up số 2 trong Speaking Lab 11.
🎙️ CASE LAB V5.2 — Cross-project practice (3 cặp Q&A)
Nguồn: ba bản Project Deep Dive được cung cấp; so sánh dùng trong mock, không phải thành tích cá nhân.
Mục tiêu kiến thức: Đặt các giải pháp concurrency, retry và integration cạnh nhau để chọn ví dụ phù hợp với JD.
WATCH → DO (đọc code/test thực tế): Chọn một flow checkout, một flow move hoặc một flow gateway và nêu class/test bạn thực sự đã đọc.
LISTEN → SHADOW: V-Market locks inventory so two different checkouts cannot oversell stock. (2 lượt), rồi giải thích lại flow mà không nhìn script.
FREE SPEAK — P0 (ưu tiên, 4–6 câu mỗi buổi)
Q237 · P0 · CROSS-PROJECT V5.1
TTS 473 · Q: How is the concurrency problem different in V-Market and V-Core?
Mở đáp án mẫu Q237 — sau khi tự trả lời
TTS 474 · A: V-Market locks inventory so two different checkouts cannot oversell stock. V-Core locks a column so task moves cannot exceed its WIP limit, while task versions detect stale edits. Both protect shared business invariants at the database boundary.
Q238 · P0 · CROSS-PROJECT V5.1
TTS 475 · Q: How are retries different between V-Market checkout and V-Pulse payment attempts?
Mở đáp án mẫu Q238 — sau khi tự trả lời
TTS 476 · A: V-Market reuses the checkout operation key to recover an existing order without deducting stock again. V-Pulse also deduplicates create requests, but a new gateway attempt needs separate permission. A payment timeout can leave the external outcome unknown, so blind replay is unsafe.
Q239 · P0 · CROSS-PROJECT V5.1
TTS 477 · Q: Which project would you discuss for Java Backend concurrency versus FDE integration?
Mở đáp án mẫu Q239 — sau khi tự trả lời
TTS 478 · A: For Java Backend concurrency, I would use V-Market's stock-locking checkout or V-Core's WIP rule. For FDE integration and uncertain downstream outcomes, I would use V-Pulse's simulated gateway workflow. I would choose the example I can explain from code and tests, without overstating my personal contribution.
UNEXPECTED FOLLOW-UP: Người phỏng vấn chuyển từ bài toán inventory sang external payment. So sánh tính chắc chắn của local transaction và unknown downstream outcome.
SELF-CHECK: có nêu một invariant, một failure, một test và một giới hạn thật? Chỉ nói I implemented hoặc I ran với phần mình đã xác minh từ công việc cá nhân.
LAB D [CORE] — Technical English Listening + Reading New Code + Practical Coding
Tại sao khác với học thuộc từ vựng? Khi interviewer đưa một câu nói hoặc code chưa thấy trước, bạn phải (1) hiểu yêu cầu, (2) xác minh giả định, (3) xử lý vấn đề, (4) giải thích bằng lời. LAB này đặt thử thách theo thứ tự dễ → vừa → không gợi ý.
D1. Listening: phương pháp không cần audio đính kèm
File Markdown không chứa âm thanh. Bạn có thể dùng trình đọc văn bản thành giọng nói trên Windows/điện thoại, hoặc nhờ một người đọc các câu trong mục D2. Không xem transcript trước. Nếu tự học một mình, copy lần lượt câu vào TTS, quay sang cửa sổ khác, nghe một lần, tự nói lại bằng tiếng Việt và trả lời bằng tiếng Anh. Nếu không có TTS, tự đọc thành tiếng vẫn luyện speaking nhưng không thay thế luyện nghe.
Mỗi câu 3 lượt:
1. First listen: nói lại interviewer muốn define / mechanism / compare / design / debug / trade-off.
2. Second listen: ghi 3 keywords và điều kiện if/unless/only if/most/least.
3. Answer: trả lời 3–5 câu ngắn; yêu cầu phát lại/hỏi rõ một chỗ nếu thật sự cần.
D2. 12 câu nghe/nói, từ dễ đến có follow-up
Dùng bảng này làm answer sheet; transcript được đặt trong phần gấp/mở bên dưới nhằm hạn chế nhìn lén.
| Lượt | Nhóm | Bạn cần ghi |
|---|---|---|
| 1–3 | Định nghĩa/compare | Loại câu + 2 keywords |
| 4–6 | Mechanism/debug | Các bước và failure |
| 7–9 | Design/assumption | 2 câu làm rõ và lựa chọn |
| 10–12 | FDE follow-up | Nêu trade-off và phản ứng trước scope change |
12 PROMPTS cho TTS / partner — chỉ mở khi luyện
- Could you briefly explain the difference between an interface and an abstract class in Java?
- Why can a database index make an update slower even if it speeds up some reads?
- What's the main difference between authentication and authorization?
- Walk me through what happens when a browser sends a request to your Spring Boot API.
- A user reports that saving a booking timed out. Does that always mean no booking was created?
- How would you investigate a sudden increase in HTTP 409 responses?
- Design a simple feature that lets staff approve booking requests. What would you clarify first?
- You are allowed to use a relational database and a single service. How would you design the first version?
- What assumptions would you validate before adding a cache to this system?
- The client says the problem is not low throughput but incorrect inventory. Would your solution change?
- Suppose the vendor API does not support idempotency and may time out after applying a change. What would you do?
- Halfway through the project, the customer decides manual approval must remain. How would you adjust the MVP and explain the impact?
Self-score (0–2): 0 không nhận diện câu hỏi / trả lời lệch; 1 đúng chủ đề nhưng thiếu cơ chế/thiếu tự tin; 2 đúng ý, rõ bước và xử lý điều kiện. Thêm điểm listening nếu nghe hiểu không nhìn script. Không nên tự đánh giá nghe từ việc đọc transcript.
D3. Reading unfamiliar Java: WATCH — nhận trách nhiệm của class trước
class BookingFacade {
private final ReservationClient client;
private final BookingRepository repo;
BookingFacade(ReservationClient client, BookingRepository repo) {
this.client = client;
this.repo = repo;
}
BookingResult reserve(String requestId, String roomId) {
ExternalResult remote = client.createReservation(roomId);
return repo.save(requestId, roomId, remote.id());
}
}
Cách đọc trong 90 giây: method là reserve → input requestId,roomId → external network call → DB save → return. Failure window: provider có thể tạo reservation rồi DB save lỗi; nếu retry, có thể tạo reservation khác. Có requestId không đồng nghĩa provider/client đang dùng nó để chống trùng.
Mẫu giải thích: The facade calls an external reservation service and then saves a local record. A failure between these steps can leave an external reservation without a matching local record. I'd check whether the provider supports an idempotency key or status lookup before adding retries.
D4. COMPLETE — đọc code và tìm tối thiểu 3 vấn đề
class ImportService {
int importQuantities(List<String> lines) {
int count = 0;
for (String line : lines) {
String[] cells = line.split("\\|");
int quantity = Integer.parseInt(cells[1]);
db.updateQuantity(cells[0], quantity);
count++;
}
return count;
}
}
Đề: format mỗi dòng SKU|QUANTITY, số lượng không âm. Giả định db tồn tại và updateQuantity sẽ thay giá trị hiện tại. Hãy liệt kê input lỗi có thể làm code fail hoặc ghi sai và nêu bước kiểm thử; chưa cần viết lại toàn bộ implementation.
Đáp án gợi ý (sau 5 phút)
cells[1] có thể gây index error nếu thiếu dấu |; parse lỗi khi ký tự không phải số; số âm chưa bị từ chối; SKU rỗng/trailing whitespace; duplicate SKU có thể ghi đè khó hiểu; không rõ update SKU không tồn tại; import một phần nếu nửa file đã ghi rồi mới throw; CSV-like format có escaping và encoding cần spec riêng nếu dữ liệu thật phức tạp. Chọn validation/staging, check business key và failure policy. Tests: A|3, A|, A|-3, |2, A|abc, A|3 hai lần, crash giữa file.
D5. DO — thực hành Java không cho sẵn lời giải ngay
Yêu cầu rõ để code được: Viết phương thức parse nhận List<String> với định dạng giản lược SKU|quantity, không có escape/quote, mỗi SKU unique trong file (duplicate phải throw), trim hai trường; quantity là số nguyên ≥ 0; dòng lỗi ném IllegalArgumentException kèm số dòng. Trả về Map<String,Integer> giữ thứ tự input. Không ghi database. Đưa ra 5 tests. Giới hạn: không cần xử lý CSV chuẩn hoặc Unicode decoding ở bài này.
static Map<String,Integer> parse(List<String> lines) {
// TODO: validate, split, parse, reject duplicate, return result
}
Hướng giải Java + test ideas — chỉ mở sau khi code
import java.util.*;
class SimpleFeedParser {
static Map<String, Integer> parse(List<String> lines) {
if (lines == null) throw new IllegalArgumentException("lines is null");
Map<String, Integer> result = new LinkedHashMap<>();
for (int i = 0; i < lines.size(); i++) {
String line = lines.get(i);
if (line == null) throw new IllegalArgumentException("line " + (i + 1));
String[] a = line.split("\\|", -1);
if (a.length != 2) throw new IllegalArgumentException("line " + (i + 1));
String sku = a[0].trim();
String qtyText = a[1].trim();
if (sku.isEmpty()) throw new IllegalArgumentException("line " + (i + 1));
int qty;
try {
qty = Integer.parseInt(qtyText);
} catch (NumberFormatException ex) {
throw new IllegalArgumentException("line " + (i + 1), ex);
}
if (qty < 0 || result.containsKey(sku))
throw new IllegalArgumentException("line " + (i + 1));
result.put(sku, qty);
}
return result;
}
}
Tests: valid two rows preserves order; empty SKU; negative; malformed numeric; duplicate SKU; missing/extra separator; null line/list. Complexity roughly O(n + total characters) time and O(number of distinct SKUs) extra map space (excluding stored strings). Đây là parser cho format rất hẹp, không đủ xử lý CSV quoted values chuẩn.
D6. Learning interview: đọc tài liệu của một API giả tưởng
SPEC (chỉ dựa trên thông tin dưới đây): API VendorClient.update(sku, quantity, requestKey) trả UpdateResponse(status, version). status là APPLIED, ALREADY_APPLIED, hoặc TEMPORARY_ERROR. Cùng requestKey và cùng payload phải có cùng hiệu ứng; dùng cùng key khác payload trả error. Không có API lấy trạng thái operation theo key.
Nhiệm vụ trong 8 phút:
1. Chọn cách xử lý TEMPORARY_ERROR mà không làm phát sinh kết quả ngoài spec.
2. Nêu trường hợp vẫn không thể chắc trạng thái sau mất kết nối.
3. Viết pseudocode update có giới hạn retry, giữ requestKey, có logging không lộ secret.
4. Hỏi interviewer hai điều mà spec còn thiếu.
Hướng giải — đối chiếu với spec, không tự bịa
TEMPORARY_ERROR là status đã nhận; có thể retry bounded với same requestKey nếu spec thực sự bảo đảm idempotency theo key/payload. Mất kết nối không rõ request có áp dụng hay chưa; caller có thể retry same key theo contract, nhưng không biết kết quả cuối nếu hết retry và không có status endpoint; cần ghi trạng thái pending/manual reconciliation. Pseudocode: generate key per operation → loop max N → call same key/payload → APPLIED hoặc ALREADY_APPLIED thì success; TEMPORARY_ERROR thì backoff nếu chính sách cho phép; catch timeout lưu UNKNOWN và retry có giới hạn → hết lần thì escalate. Hỏi key TTL/scope và semantics của TEMPORARY_ERROR; cũng cần biết rate limit và pagination nếu có.
D7. Behavioral English — đủ cho vòng intern/junior
Chuẩn bị 3 câu chuyện thật theo Situation → Task → Action → Result → Reflection, tối đa 60–90 giây/câu. Chọn: (a) bug khó bạn debug; (b) thay đổi requirement; (c) học công nghệ mới trong thời gian ngắn. Result có thể là test/feature giao được; không bịa metrics, production incident hoặc công lao cá nhân.
Khung: The situation was ... My responsibility was ... I tried ... I verified the result by ... Next time, I would ....
D8. Ghép project thật sau khi học cơ chế
Chỉ chọn 1 project chính trong một lượt phỏng vấn. V-Market phù hợp để giải thích checkout, row locking, CSV import, reconciliation; V-Core phù hợp để giải thích WIP invariant, optimistic lock, audit/outbox; V-Pulse phù hợp reliability/recovery. Các bản phân tích project bạn tải lên có đánh dấu Confirmed in code / Inferred / Not verified. Trước khi nói "I built", xác nhận đúng vai trò và mở implementation/test thật. Không khẳng định test đã chạy xanh trong buổi ôn nếu chưa chạy.
Qua LAB D nếu: Bạn nghe được câu hỏi chưa biết trước, đọc một class lạ, code một parser đơn giản và giải thích hạn chế mà không dựa vào script.
🎙️ SPEAKING LAB V5.2 — D. Listening blind + unfamiliar Java + on-the-job learning
Thứ tự sử dụng: PRETEST → WATCH & DO ngay trong phần kiến thức phía trên → LISTEN/SHADOW → FREE SPEAK → FOLLOW-UP → feedback. Không mở đáp án trước lượt nói đầu.
Những ý kỹ thuật phải hiểu trước khi nói: Hear intent; explain unfamiliar code; identify bugs; ask for requirements; safe verification.
Từ đơn → cụm nói được (chỉ chọn 3–5 cụm để ôn hôm nay):
| Useful chunk | Nghĩa |
|---|---|
as far as I understand... |
theo cách tôi hiểu... |
this method appears to... |
method này có vẻ... |
I would check the contract |
tôi sẽ kiểm tra contract |
I would confirm this behavior |
tôi sẽ xác nhận hành vi này |
1. PRETEST + WATCH + DO
Hoàn thành ít nhất một bài COMPLETE/DO ở phía trên (hoặc giải thích một ví dụ mới). Nếu chưa giải thích được cơ chế bằng tiếng Việt, quay lại bài kỹ thuật trước khi bắt đầu nói.
2. LISTEN → SHADOW
A — LISTEN & SHADOW (3–4 phút): Ẩn chữ; dùng TTS/Voice đọc lần lượt các câu sau. Lượt 1 nghe và tóm tắt ý; lượt 2–3 bắt chước nhịp nói, rồi nói lại không nhìn.
- From the method name and return type, this appears to parse an incoming request.
- I would read the API contract and write a small test before changing the code.
3. COMPLETE ORALLY
B — COMPLETE ORALLY (1–2 phút): Điền bằng giọng nói, không cần viết câu hoàn chỉnh trước.
This method appears to . I am not sure whether . I would verify it by ___.
4. FREE SPEAK — định nghĩa / cơ chế (không nhìn script)
Chọn 3–5 câu/lượt trong 2 câu sau. Đáp án được thu gọn dưới từng câu; chỉ mở sau khi đã nói.
Q240 · MECHANISM / WHY · BASE V4
TTS 479 · Q: Look at a Java method you have never seen. How do you understand it?
Mở đáp án mẫu Q240 — sau khi tự trả lời
TTS 480 · A: First, I would read the method name, parameters, and return type. Then I would trace the main branches and dependencies. Finally, I would run or write small tests to confirm my understanding.
Q241 · MECHANISM / WHY · BASE V4
TTS 481 · Q: How do you distinguish a missing requirement from a bug?
Mở đáp án mẫu Q241 — sau khi tự trả lời
TTS 482 · A: A missing requirement means the expected behavior was not clearly defined. A bug means the implementation does not meet an agreed requirement. I would confirm the expected behavior with the team.
5. UNEXPECTED FOLLOW-UP — thay giả định và suy luận
Chọn ít nhất một câu dưới đây, tự trả lời trước; sau đó yêu cầu người luyện thay một điều kiện mới.
Q242 · SCENARIO / FOLLOW-UP · BASE V4
TTS 483 · Q: What would you ask before integrating an unfamiliar API?
Mở đáp án mẫu Q242 — sau khi tự trả lời
TTS 484 · A: I would ask about authentication, request and response formats, errors, rate limits, and retry rules. I would also confirm whether repeated calls can create duplicate side effects.
Q243 · SCENARIO / FOLLOW-UP · BASE V4
TTS 485 · Q: What if the API documentation contradicts actual behavior?
Mở đáp án mẫu Q243 — sau khi tự trả lời
TTS 486 · A: I would reproduce the actual behavior with a small request and record the evidence. Then I would ask the provider to clarify the contract and make our integration handle the verified behavior safely.
Q244 · SCENARIO / FOLLOW-UP · BASE V4
TTS 487 · Q: What test would you write before refactoring the method?
Mở đáp án mẫu Q244 — sau khi tự trả lời
TTS 488 · A: I would write a characterization test for the current behavior, including important edge cases. Then I would refactor and run the tests again to check that behavior did not change unexpectedly.
Q245 · SCENARIO / FOLLOW-UP · ADD V5
TTS 489 · Q: The interviewer speaks too quickly. What would you say?
Mở đáp án mẫu Q245 — sau khi tự trả lời
TTS 490 · A: Could you repeat the last part a little more slowly, please? I want to make sure I understood the requirement before answering.
Q246 · SCENARIO / FOLLOW-UP · ADD V5
TTS 491 · Q: How would you explain unfamiliar Java code before changing it?
Mở đáp án mẫu Q246 — sau khi tự trả lời
TTS 492 · A: I would identify the inputs, outputs, main branches, and side effects. Then I would run a small example and check edge cases. I would change one behavior at a time and rerun tests.
Q247 · SCENARIO / FOLLOW-UP · ADD V5
TTS 493 · Q: How would you learn a new backend library for an urgent task?
Mở đáp án mẫu Q247 — sau khi tự trả lời
TTS 494 · A: I would start with official documentation and a small working example. Then I would integrate the minimum required feature and write tests for important behavior. I would ask for review where the risk is high.
6. REPEAT + FEEDBACK — checkpoint
E — REPEAT + FEEDBACK: Chọn câu khó nhất ở phần FREE SPEAK, nói 3 lượt (45–60 giây → 30–45 giây → 20–30 giây ở L1; tăng thời lượng ở L2), giữ ý chính và một test/example. Mở câu trả lời ngay dưới câu hỏi sau lượt 1; mỗi lượt chỉ sửa tối đa 2 lỗi.
- Thời lượng mục tiêu: L1: đọc 2 câu và diễn giải; L2: 60–90 giây về code lạ; L3: nghe câu follow-up không transcript.
- Điều kiện qua bài: Không bịa ý nghĩa code; nêu evidence từ signature, data flow, return type, tests.
- Điểm dễ nói sai / hiểu sai: Đừng nói “it probably works” chỉ từ tên method; cần contract và kiểm chứng.
| Self-check (đánh dấu sau khi nói) | Yes/No |
|---|---|
| Tôi giải đúng kiến thức và nêu được ví dụ / failure / test cần thiết | [ ] |
| Tôi hiểu câu hỏi khi nghe, hoặc hỏi lại đúng chỗ | [ ] |
| Tôi tự nói không nhìn script; có mở đầu và kết luận rõ | [ ] |
| Tôi xử lý được ít nhất 1 follow-up mới | [ ] |
Mẫu trả lời dài V4 (tùy chọn; xem sau khi tự nói)
Show sample only after speaking
One possible answer (~40–90 words):
When I read unfamiliar code, I first look at the method signature, input, output, and callers. Then I trace the data flow and identify side effects or exceptions. If I am unsure about an external API, I check the contract and run a small controlled test. I would avoid making a large refactor until I understand the expected behavior and can reproduce the issue.
Knowledge guardrail: Đừng nói “it probably works” chỉ từ tên method; cần contract và kiểm chứng.
Reverse recall: Che sample; nói lại bằng từ của mình rồi trả lời follow-up số 2 trong Speaking Lab D.
MÔ-ĐUN 12 [CORE] — Bốn bài tập tổng hợp: gợi ý ít dần
Cách làm: lấy giấy hoặc VS Code, gõ câu trả lời trước khi mở đáp án. Mỗi case 15–20 phút. Nếu chưa biết gì, quay lại đúng bài; đừng mở đáp án ngay lập tức.
Case 1 — Có ví dụ trước, tự đổi requirement
Prompt: An app lets users register. Now the product owner wants a maximum of 3 active devices per account.
Nhiệm vụ: 1. Hỏi 3 câu làm rõ. 2. Đề xuất entity/session model. 3. Nêu cách xác định “active device”. 4. Xử lý login thiết bị thứ 4. 5. Nêu một race condition.
Gợi ý từng nấc
- Nấc 1: active là thiết bị đã đăng nhập, token còn sống hay đang online?
- Nấc 2: xem
DeviceSession(userId, deviceId, revokedAt, expiresAt, lastSeenAt). - Nấc 3: hai concurrent logins khi đang có 2 sessions → bảo vệ số sessions active ở nguồn dữ liệu có authority; chọn lock/version/transaction phù hợp.
Đáp án tham khảo
- Clarify: tính theo refresh-token/session hay device fingerprint? Thiết bị thứ 4 bị từ chối hay kick oldest? Thiết bị mất kết nối có tự hết active?
- Model: session ID, userId, stable device identifier tùy privacy/security, expiry/revocation fields.
- Rule: count active sessions theo chính sách; khi vượt 3, reject hoặc revoke oldest theo quyết định product.
- Concurrency: bảo đảm transaction/locking hoặc cơ chế kiểm soát cạnh tranh để hai login đồng thời không cùng thấy còn slot.
- Test: đăng nhập đồng thời khi đã có 2 active sessions ⇒ không còn quá 3 active sessions sau xử lý.
Case 2 — Chỉ có yêu cầu + đầu ra
Prompt: Design an API to import customer orders from daily CSV files. Re-uploading the same file should not create duplicates.
Đầu ra (10 phút): entities, API, input validation, duplicate detection, failure behavior, tests, 45-second English summary.
Đáp án tham khảo
ImportJob(id, vendorId, fileFingerprint, status, processedRows, errorRows, createdAt);Ordercó business unique keys theo nguồn.POST /importsupload file;GET /imports/{id}status/errors.- Validate encoding/schema/required columns, normalize và check duplicate file fingerprint + vendor, nhưng không dựa độc quyền vào file hash để xử lý record duplicates.
- Nếu fail: quyết định whole-file atomic vs partial success và cho phép retry với idempotent import job.
- Tests: identical re-upload, same order in different file, invalid rows, process crash/restart, duplicate requests.
Case 3 — Decomposition không cho biết tech stack
Prompt: A school administrator says, "Teachers and students complain that schedules change too often. We need a better system."
Đầu ra (12 phút): Problem statement, 5 discovery questions, MVP scope, entities, risks, metrics, 60-second English explanation.
Đáp án tham khảo
- Cần hỏi lý do đổi lịch (teacher absence, room conflict, manual approval?), tần suất, thông báo, người sửa, dữ liệu gốc.
- MVP có thể là canonical schedule + permissioned change request + conflict checks + notification + change history.
- Entities: Teacher, StudentGroup, Room, ClassSession, ScheduleChange, Notification.
- Constraints: giờ học, phòng, teacher conflict, privacy.
- Metric: số thay đổi không báo trước, conflict rate, time-to-notify.
- Tránh tự động tối ưu toàn bộ timetable trước khi biết nguyên nhân chính.
Case 4 — Mô phỏng gần phỏng vấn thực: thay đổi requirement giữa chừng
Prompt: Design a simple internal expense reimbursement system for 30 employees.
Interviewer bổ sung ở phút thứ 6: Now the finance team says every expense over a threshold needs two-level approval, and approvals must be auditable.
Tự trình bày không gợi ý: - Phút 0–3: hỏi requirement, actor, constraints. - Phút 3–6: scope và design version 1. - Phút 6–10: điều chỉnh data/state/API sau thay đổi. - Phút 10–12: one failure, one trade-off, how to validate.
Rubric và hướng giải (xem sau khi làm)
- Actors: employee, manager, finance.
- Entities: ExpenseClaim, ExpenseItem, ApprovalStep, AuditEvent, User/Role.
- Original states: DRAFT → SUBMITTED → APPROVED/REJECTED → PAID.
- Revised:
SUBMITTED → MANAGER_APPROVED → FINANCE_APPROVED → PAIDcho khoản vượt threshold; logic branch theo business policy. - Audit: append-only events về approver, action, time, reason; staff không được tuỳ tiện sửa/xóa history; thiết kế quyền phù hợp.
- API: submit, approve/reject, list pending, get audit.
- Race: claim không được approve/reject hai lần sai trạng thái; optimistic lock/version or transaction-controlled transition.
- Metric/acceptance: đúng mức duyệt; người không có quyền bị 403; audit ghi nhận đầy đủ mỗi state change.
Tự nhận xét sau mỗi case (viết 3 dòng):
Tôi bỏ sót: ...
Tại sao bỏ sót: (không hiểu từ / không biết bước / thiếu knowledge / vội chọn tech)
Lần sau tôi sẽ hỏi/kiểm tra: ...
🎙️ SPEAKING LAB V5.2 — 12. Integrated design cases
Thứ tự sử dụng: PRETEST → WATCH & DO ngay trong phần kiến thức phía trên → LISTEN/SHADOW → FREE SPEAK → FOLLOW-UP → feedback. Không mở đáp án trước lượt nói đầu.
Những ý kỹ thuật phải hiểu trước khi nói: Unknown prompt → assumptions → model/API → failure → test → revision.
Từ đơn → cụm nói được (chỉ chọn 3–5 cụm để ôn hôm nay):
| Useful chunk | Nghĩa |
|---|---|
break the problem down |
chia nhỏ vấn đề |
define the scope |
xác định phạm vi |
protect the invariant |
bảo vệ điều kiện bất biến |
demonstrate the result |
trình diễn kết quả |
1. PRETEST + WATCH + DO
Hoàn thành ít nhất một bài COMPLETE/DO ở phía trên (hoặc giải thích một ví dụ mới). Nếu chưa giải thích được cơ chế bằng tiếng Việt, quay lại bài kỹ thuật trước khi bắt đầu nói.
2. LISTEN → SHADOW
A — LISTEN & SHADOW (3–4 phút): Ẩn chữ; dùng TTS/Voice đọc lần lượt các câu sau. Lượt 1 nghe và tóm tắt ý; lượt 2–3 bắt chước nhịp nói, rồi nói lại không nhìn.
- I would begin with the smallest testable use case and make my assumptions explicit.
- After validating the core flow, I would add failure handling and concurrency tests.
3. COMPLETE ORALLY
B — COMPLETE ORALLY (1–2 phút): Điền bằng giọng nói, không cần viết câu hoàn chỉnh trước.
My assumption is . The simplest design is . A failure case is . I would test .
4. FREE SPEAK — định nghĩa / cơ chế (không nhìn script)
Chọn 3–5 câu/lượt trong 2 câu sau. Đáp án được thu gọn dưới từng câu; chỉ mở sau khi đã nói.
Q248 · MECHANISM / WHY · BASE V4
TTS 495 · Q: Choose one integrated case: explain your assumptions and design.
Mở đáp án mẫu Q248 — sau khi tự trả lời
TTS 496 · A: I would clarify the actors, main entities, and one important business rule. Then I would describe the API, database flow, and an error case. I would test the basic flow before adding more complexity.
Q249 · FOUNDATION · BASE V4
TTS 497 · Q: Which business invariant is most important in your solution?
Mở đáp án mẫu Q249 — sau khi tự trả lời
TTS 498 · A: The most important invariant depends on the case. For a booking system, the same room must not be allocated to two active bookings for the same night. I would enforce this at the database boundary.
5. UNEXPECTED FOLLOW-UP — thay giả định và suy luận
Chọn ít nhất một câu dưới đây, tự trả lời trước; sau đó yêu cầu người luyện thay một điều kiện mới.
Q250 · SCENARIO / FOLLOW-UP · BASE V4
TTS 499 · Q: What would you change if the interviewer added an external system?
Mở đáp án mẫu Q250 — sau khi tự trả lời
TTS 500 · A: I would clarify the external API contract and failure behavior. Then I would add a separate integration component, timeouts, and a way to check uncertain results without creating duplicates.
Q251 · SCENARIO / FOLLOW-UP · BASE V4
TTS 501 · Q: Where would you enforce data consistency?
Mở đáp án mẫu Q251 — sau khi tự trả lời
TTS 502 · A: I would enforce important local invariants in the database through suitable constraints or atomic operations. The service also validates business rules, but application checks alone may not handle concurrency.
Q252 · SCENARIO / FOLLOW-UP · BASE V4
TTS 503 · Q: How would you show the solution works without claiming zero bugs?
Mở đáp án mẫu Q252 — sau khi tự trả lời
TTS 504 · A: I would show tests for normal requests, invalid inputs, and concurrent conflicts. I would also report observed results and limitations. Tests provide evidence, but they cannot prove the absence of all bugs.
Q253 · SCENARIO / FOLLOW-UP · ADD V5
TTS 505 · Q: How would you design a simple course enrollment API from scratch?
Mở đáp án mẫu Q253 — sau khi tự trả lời
TTS 506 · A: I would clarify the actors, the capacity rule, and whether students may enroll twice. Then I would model Enrollment, define an endpoint, and protect capacity in the database. I would test two students competing for the last seat.
Q254 · SCENARIO / FOLLOW-UP · ADD V5
TTS 507 · Q: What do you do if two services cannot commit atomically?
Mở đáp án mẫu Q254 — sau khi tự trả lời
TTS 508 · A: I would not assume one local transaction covers both services. I would define the required consistency level and use an appropriate workflow with status tracking and compensation or reconciliation. Then I would test partial failures.
6. REPEAT + FEEDBACK — checkpoint
E — REPEAT + FEEDBACK: Chọn câu khó nhất ở phần FREE SPEAK, nói 3 lượt (45–60 giây → 30–45 giây → 20–30 giây ở L1; tăng thời lượng ở L2), giữ ý chính và một test/example. Mở câu trả lời ngay dưới câu hỏi sau lượt 1; mỗi lượt chỉ sửa tối đa 2 lỗi.
- Thời lượng mục tiêu: L1: 60 giây case; L2: 90 giây design; L3: 2 phút với requirement change.
- Điều kiện qua bài: Có đồ vật cụ thể: flow/API/state/invariant/test; không chỉ là chuỗi buzzwords.
- Điểm dễ nói sai / hiểu sai: Không áp đặt một design cho mọi đề; cần assumptions và trade-offs.
| Self-check (đánh dấu sau khi nói) | Yes/No |
|---|---|
| Tôi giải đúng kiến thức và nêu được ví dụ / failure / test cần thiết | [ ] |
| Tôi hiểu câu hỏi khi nghe, hoặc hỏi lại đúng chỗ | [ ] |
| Tôi tự nói không nhìn script; có mở đầu và kết luận rõ | [ ] |
| Tôi xử lý được ít nhất 1 follow-up mới | [ ] |
Mẫu trả lời dài V4 (tùy chọn; xem sau khi tự nói)
Show sample only after speaking
One possible answer (~40–90 words):
I would first clarify who uses the feature and which business rule must never be violated. Then I would define the main entities, one API flow, and the simplest deployment that can support the MVP. I would identify a failure case, such as a timeout or duplicate request, and describe how to verify the system behavior. If an external integration is added, I would revisit transaction boundaries and recovery.
Knowledge guardrail: Không áp đặt một design cho mọi đề; cần assumptions và trade-offs.
Reverse recall: Che sample; nói lại bằng từ của mình rồi trả lời follow-up số 2 trong Speaking Lab 12.
CHẶNG VII — ĐÁNH GIÁ VÀ ÔN TẬP
MÔ-ĐUN 13 [CORE] — Mock interview có đáp án, không học vẹt
13.1. Một vòng luyện 55 phút (tự làm trước, không dùng AI/tra cứu)
| Phần | Thời gian | Cách làm |
|---|---|---|
| A. Technical English | 5 phút | nghe/đọc 5 câu hỏi, nói lại interviewer muốn dạng đáp án nào |
| B. CS MCQ | 12 phút | làm 24 câu dưới đây; không nhìn đáp án |
| C. LLD mini | 12 phút | tự thiết kế một yêu cầu đơn giản |
| D. FDE decomposition | 15 phút | hỏi yêu cầu, khoanh MVP, flow, risks, metrics |
| E. English oral | 8 phút | 2 câu knowledge + 1 câu project + 1 câu design |
| F. Tự chấm | 3 phút | xác định loại lỗi, không chỉ điểm số |
Phần A — 5 prompts: 1. Walk me through how a request reaches your backend. 2. What happens if two requests update the same row? 3. Which assumption would you validate first? 4. Why would you choose a monolith for an MVP? 5. How would you measure whether your solution helped users?
Phần B — 24 MCQ tiếng Anh, từ dễ đến tình huống
Nhóm 1: nhận diện (1–8)
- Which option BEST describes a functional requirement?
A. 99.9% uptime · B. Staff can approve a booking · C. P95 latency < 200 ms · D. Data encrypted at rest - Which data structure usually supports BFS traversal?
A. Queue · B. Stack only · C. HashSet only · D. Sorted array - A method is overridden when...
A. The parameter list changes in the same class · B. A subtype supplies a compatible inherited implementation · C. A variable is final · D. Two classes have the same name - Which HTTP status usually means an authenticated client lacks permission?
A. 200 · B. 401 · C. 403 · D. 500 - Which SQL expression counts rows with
NULLin any column?
A. COUNT(column) · B. COUNT(*) · C. SUM(column) · D. AVG(column) - Which isolation anomaly means reading uncommitted data from another transaction?
A. Dirty read · B. Phantom read · C. Deadlock · D. Starvation - What is the PRIMARY purpose of a sequence diagram?
A. Display table indexes · B. Show message order among participants · C. Show deployment costs · D. Show server CPU usage - What is the difference between scale-up and scale-out?
A. More CPU/RAM per instance vs more instances · B. SQL vs NoSQL · C. Sync vs async · D. Unit vs integration testing
Nhóm 2: hiểu cơ chế (9–16)
- Two Java threads each execute
counter++on a shared int. Which statement is correct?
A. volatile alone makes it atomic · B. Counter cannot lose increments · C. A race condition may cause a lost increment · D. JIT guarantees the outcome - Which is NOT a standard Coffman deadlock condition?
A. Circular wait · B. Hold and wait · C. No preemption · D. Round Robin scheduling - Why might an index slow down writes?
A. The DB must also maintain index structures · B. Indexes block all inserts permanently · C. Indexes turn SQL into NoSQL · D. Indexes require HTTP - A client times out after sending
POST /bookings. Which is the safest initial conclusion?
A. The server certainly did nothing · B. The server certainly committed · C. The operation outcome is not yet known · D. The booking must be cancelled - Which statement BEST describes idempotency?
A. Requests always return identical HTTP bytes · B. Repeated execution has the same intended effect as one execution, within defined semantics · C. Requests never fail · D. The network never duplicates packets - When does
LEFT JOINpreserve unmatched rows from the left?
A. Always even if WHERE removes them later · B. During join, with NULLs for unmatched right columns, subject to later filtering · C. Never · D. Only after GROUP BY - Why is a DB unique constraint useful for concurrent registrations?
A. It prevents all network failures · B. It enforces uniqueness at the authoritative data store · C. It guarantees emails are delivered · D. It replaces every validation - Which test best detects two simultaneous requests allocating the same last unit?
A. One unit test for positive input · B. Concurrent integration test asserting inventory invariant · C. CSS snapshot test · D. Documentation lint
Nhóm 3: design và decomposition (17–24)
- A customer says, “Our workflow is slow.” What should you do FIRST?
A. Add Redis · B. Deploy Kubernetes · C. Ask which step is slow and how it is measured · D. Rewrite everything in Go - The product owner requests a simple internal task app for 15 users. Which starting point is usually easiest to justify?
A. 12 microservices · B. Modular app + relational DB, revisiting after measuring constraints · C. Blockchain · D. No database - A booking application stores availability in Redis. Which statement is safest?
A. Redis data can never become stale · B. Cached availability alone always guarantees a room · C. Final allocation should use an authoritative inventory check/control · D. Disable all DB constraints - An external service returns 503 intermittently. What is the best design consideration?
A. Retry forever without limit · B. Classify failure and retry only with appropriate bounds and safe semantics · C. Never set timeout · D. Tell user the service succeeded - What does out of scope mean in an MVP?
A. The feature is impossible forever · B. A capability intentionally excluded from this release · C. A bug · D. A production outage - What is a good acceptance criterion?
A. The system is modern · B. Use more libraries · C. Given an unauthorized user, when they request approval, then access is denied · D. Build a nice UX - An interviewer changes the requirement from one approver to two approvers. What should you do?
A. Ignore it · B. Update actors/workflow/states/data model and discuss consequences · C. Switch to NoSQL automatically · D. Remove logging - Which question best checks the business value of your delivered workflow?
A. How many frameworks did we use? · B. Has the mean/median handling time and error rate improved under an agreed measurement plan? · C. How many classes exist? · D. Is the diagram colorful?
Phần C — mini LLD (12 phút)
Design a library book borrowing feature. A member can borrow an available copy, return it, and view active loans. A copy cannot be borrowed by two members at the same time.
Yêu cầu đầu ra: 2–4 questions, 3–5 entities, 3 API endpoints, state diagram bằng chữ, một concurrent invariant, một failure test, 45-second English explanation.
Phần D — FDE case (15 phút)
A small medical appointment center says: “Patients keep missing appointments. We need an app.”
Đầu ra: GOAL → CLARIFY (5 questions) → SCOPE → BREAK DOWN → DESIGN → VALIDATE. Không mặc định dữ liệu y tế được phép gửi qua mọi third-party service; privacy/security là constraint cần làm rõ.
Phần E — trả lời nói:
- Explain the difference between a database transaction and a Java synchronized block.
- Why might you choose a queue instead of directly sending an email in the request thread?
- Walk me through an important project decision you personally made.
- What would you do if a customer changed the requirements halfway through development?
ĐÁP ÁN PHẦN B — chỉ mở sau khi làm
| Câu | Đúng | Vì sao / lỗi thường gặp |
|---|---|---|
| 1 | B | Functional requirement là chức năng, các lựa chọn khác là quality/security constraints. |
| 2 | A | BFS dùng FIFO queue cho traversal theo level. |
| 3 | B | Overriding thuộc subtype; A thiên về overloading. |
| 4 | C | 403 là thiếu quyền; 401 là xác thực chưa hợp lệ/thiếu. |
| 5 | B | COUNT(*) đếm rows, COUNT(column) bỏ NULL. |
| 6 | A | Dirty read = thấy uncommitted data. |
| 7 | B | Sequence diagram biểu diễn messages theo thời gian. |
| 8 | A | Vertical (up) vs horizontal (out). |
| 9 | C | counter++ gồm nhiều bước; volatile không biến nó thành atomic. |
| 10 | D | Scheduling RR không thuộc điều kiện Coffman. |
| 11 | A | Chi phí duy trì index khi write. |
| 12 | C | Timeout khiến outcome chưa biết; cần status/reconciliation/idempotency. |
| 13 | B | Idempotency nói về effect được định nghĩa; không bắt buộc identical response bytes. |
| 14 | B | WHERE filter có thể loại rows unmatched về sau. |
| 15 | B | DB unique constraint là tuyến phòng vệ ở authoritative store. |
| 16 | B | Concurrent integration test kiểm invariant thật. |
| 17 | C | Discovery trước khi chọn giải pháp. |
| 18 | B | Start simple; tăng độ phức tạp khi constraints thật yêu cầu. |
| 19 | C | Cache không nên quyết định business allocation một mình. |
| 20 | B | Retry có giới hạn và ngữ nghĩa an toàn. |
| 21 | B | Out of scope = không nằm trong release/MVP hiện tại. |
| 22 | C | Given/When/Then có thể kiểm chứng. |
| 23 | B | Requirement mới ảnh hưởng workflow, states và data, không phải đổi stack vô cớ. |
| 24 | B | Đo outcome thay vì đếm công nghệ. |
Cách dùng điểm: - 0–15/24: quay lại Mô-đun 02, 04–08; ghi rõ vì sao sai. - 16–20/24: nền tảng đang lên; luyện tiếp Mô-đun 03, 07, 09–10 và các câu scenario sai. - 21–24/24: chuyển sang bài case chưa từng thấy và English oral; điểm MCQ cao không chứng minh design tốt.
Ngưỡng chỉ là cách tự học, không phải thang điểm tuyển dụng.
ĐÁP ÁN PHẦN C — Library Borrowing LLD
- Clarify: borrow window? renewal? copy vs book title? fine/overdue? member limit?
- Entities:
Member,Book,BookCopy(copyId, bookId, status),Loan(id, memberId, copyId, borrowedAt, dueAt, returnedAt). - APIs:
POST /loans,POST /loans/{id}/return,GET /members/{id}/loans?active=true. - States:
AVAILABLE → BORROWED → AVAILABLE; nếu lost/damaged policy có states khác. - Invariant: một
BookCopycó tối đa một active loan; enforce qua locking/constraint/data model thích hợp (ví dụ active loan uniqueness), không chỉ kiểm tra nếustatus == AVAILABLEtrong Java. - Test: hai concurrent borrow requests cùng một copy → không thể cả hai success.
- English: I'd model each physical book copy separately from the book title. A loan references a member and a copy. The service checks availability and creates a loan under appropriate concurrency control, so only one active loan exists for a copy. I would test simultaneous borrowing requests and overdue returns.
ĐÁP ÁN PHẦN D — Appointment Decomposition
Goal: giảm missed appointments, nhưng chưa khẳng định nguyên nhân là “thiếu app”.
Clarify: patients quên hay hủy sát giờ? Hiện nhắc lịch thế nào? Consent với SMS/email? Ai dùng? Có hệ thống booking/CRM sẵn chưa? Dữ liệu nhạy cảm và quy định áp dụng?
Scope giả định: reminders dựa trên lịch đã có + confirm/cancel/reschedule request + staff dashboard; không xây hồ sơ y tế hay diagnostic AI.
Breakdown: Appointment, PatientContact/consent, ReminderJob, Response, StaffAction; trạng thái scheduled/confirmed/cancelled, policy no-show.
Design: tích hợp nguồn lịch hiện tại → enqueue reminder theo chính sách + opt-in → track delivery/response → staff follow-up.
Failures: số điện thoại/email sai, provider down, duplicate reminders, timezone, privacy/consent.
Validate: no-show rate, reminder delivery rate, confirmation rate; compare baseline/pilot; định nghĩa cách đo công bằng.
ĐÁP ÁN PHẦN E — English sample answers
- A Java synchronized block coordinates access to shared memory within a JVM. A database transaction manages a unit of data operations under the database's guarantees. A JVM lock alone is not enough to protect data shared across multiple application instances.
- A queue can keep slow email delivery out of the user-facing request, improve resilience, and support retries. However, the worker must handle duplicate messages, failures, and delayed processing.
- Không có một đáp án chung đúng: dùng project thực tế, nói rõ tôi làm gì, tại sao, kiểm thử ra sao và còn hạn chế gì. Không bịa metrics.
- I'd confirm the new requirement and its impact on scope, data, workflows, and deadlines. I'd explain the trade-offs, agree on priorities, then update the design and acceptance criteria before implementing it.
13.2. Chấm lỗi theo nguyên nhân, không chấm mỗi điểm
| Nếu vấp | Dấu hiệu | Hành động tối thiểu |
|---|---|---|
| Technical English reading | đọc LEAST/EXCEPT/only if sai |
học lại Mô-đun 02, làm 10 câu phân biệt |
| CS knowledge | không biết isolation, index, thread | chỉ mở đúng Mô-đun 04–06 liên quan |
| LLD | không chia nổi class/state/API | làm lại Mô-đun 03 hoặc 07 với đề biến thể |
| System Design | liệt kê technologies không có reason | làm lại Mô-đun 09, buộc nêu “because” + trade-off |
| Decomposition | không biết phải hỏi gì | làm lại 10.2 bằng case mới |
| Speaking | viết được nhưng nói không thành câu | Mô-đun 11, ghi âm 30–60 giây mỗi ngày |
| Coding practical | giải thích hay nhưng không code được | quay lại luyện Java/SQL/LeetCode bên ngoài file này |
🎙️ SPEAKING LAB V5.2 — 13. Mock interview + oral delivery
Thứ tự sử dụng: PRETEST → WATCH & DO ngay trong phần kiến thức phía trên → LISTEN/SHADOW → FREE SPEAK → FOLLOW-UP → feedback. Không mở đáp án trước lượt nói đầu.
Những ý kỹ thuật phải hiểu trước khi nói: Blend CS/Java/SQL/LLD/FDE; no scripted answers; question recognition and follow-up.
Từ đơn → cụm nói được (chỉ chọn 3–5 cụm để ôn hôm nay):
| Useful chunk | Nghĩa |
|---|---|
let me think through it |
để tôi suy luận một chút |
my assumption is... |
giả định của tôi là... |
the key risk is... |
rủi ro chính là... |
I would verify that by... |
tôi sẽ kiểm chứng bằng cách... |
1. PRETEST + WATCH + DO
Hoàn thành ít nhất một bài COMPLETE/DO ở phía trên (hoặc giải thích một ví dụ mới). Nếu chưa giải thích được cơ chế bằng tiếng Việt, quay lại bài kỹ thuật trước khi bắt đầu nói.
2. LISTEN → SHADOW
A — LISTEN & SHADOW (3–4 phút): Ẩn chữ; dùng TTS/Voice đọc lần lượt các câu sau. Lượt 1 nghe và tóm tắt ý; lượt 2–3 bắt chước nhịp nói, rồi nói lại không nhìn.
- My assumption is that the database is the source of truth for inventory.
- The key risk is an inconsistent update when multiple requests arrive together.
3. COMPLETE ORALLY
B — COMPLETE ORALLY (1–2 phút): Điền bằng giọng nói, không cần viết câu hoàn chỉnh trước.
My understanding is . I would . The main risk is . I would verify it by .
4. FREE SPEAK — định nghĩa / cơ chế (không nhìn script)
Chọn 3–5 câu/lượt trong 5 câu sau. Đáp án được thu gọn dưới từng câu; chỉ mở sau khi đã nói.
Q255 · MECHANISM / WHY · BASE V4
TTS 509 · Q: Explain a technical concept from a randomly selected module in 45 seconds.
Mở đáp án mẫu Q255 — sau khi tự trả lời
TTS 510 · A: A database transaction groups related operations into one logical unit. It can make local changes succeed or fail together. For example, booking creation and inventory updates should remain consistent.
Q256 · MECHANISM / WHY · BASE V4
TTS 511 · Q: Defend a design choice and name one trade-off.
Mở đáp án mẫu Q256 — sau khi tự trả lời
TTS 512 · A: I would use a modular monolith for a small MVP because it is easier to build and deploy. The trade-off is that individual components are harder to scale or deploy independently.
Q257 · FOUNDATION · BASE V4
TTS 513 · Q: Handle one unexpected follow-up without looking at notes.
Mở đáp án mẫu Q257 — sau khi tự trả lời
TTS 514 · A: I would clarify the changed requirement before answering. Then I would explain what part of the design changes, why it changes, and which new test I would add.
Q258 · FOUNDATION · BASE V4
TTS 515 · Q: What evidence would change your decision?
Mở đáp án mẫu Q258 — sau khi tự trả lời
TTS 516 · A: I would change my decision if measurements showed a different bottleneck or if business requirements changed. For example, very high independent load might justify separating one service.
Q259 · MECHANISM / WHY · BASE V4
TTS 517 · Q: Could you explain the same answer in simpler English for a non-engineer?
Mở đáp án mẫu Q259 — sau khi tự trả lời
TTS 518 · A: I would explain that the system first checks whether a room is free, then saves the reservation. It must prevent two customers from getting the same room for the same night.
5. UNEXPECTED FOLLOW-UP — thay giả định và suy luận
Chọn ít nhất một câu dưới đây, tự trả lời trước; sau đó yêu cầu người luyện thay một điều kiện mới.
Q260 · SCENARIO / FOLLOW-UP · ADD V5
TTS 519 · Q: How would you answer a question whose assumptions are incomplete?
Mở đáp án mẫu Q260 — sau khi tự trả lời
TTS 520 · A: I would state the missing information and ask one focused clarification. If no answer is available, I would make a reasonable assumption and label it. Then I would explain how the design changes if the assumption is wrong.
Q261 · SCENARIO / FOLLOW-UP · ADD V5
TTS 521 · Q: How would you respond when an interviewer challenges your design choice?
Mở đáp án mẫu Q261 — sau khi tự trả lời
TTS 522 · A: I would listen to the new constraint and compare it with my original assumption. Then I would explain whether I would keep or change the design and what trade-off follows. I would not defend a choice simply because I made it first. ---
6. REPEAT + FEEDBACK — checkpoint
E — REPEAT + FEEDBACK: Chọn câu khó nhất ở phần FREE SPEAK, nói 3 lượt (45–60 giây → 30–45 giây → 20–30 giây ở L1; tăng thời lượng ở L2), giữ ý chính và một test/example. Mở câu trả lời ngay dưới câu hỏi sau lượt 1; mỗi lượt chỉ sửa tối đa 2 lỗi.
- Thời lượng mục tiêu: L2: 60–90 giây mỗi câu; L3: 5–8 phút mock liền mạch không biết trước câu hỏi.
- Điều kiện qua bài: Qua ít nhất 3/4 loại câu hỏi mới ở mức K≥2, S≥2 và biết hỏi lại khi cần; chọn lỗi cần học lại.
- Điểm dễ nói sai / hiểu sai: Mock là đo phản xạ với câu hỏi mới; không dùng bài mẫu vừa đọc để tự cho điểm cao.
| Self-check (đánh dấu sau khi nói) | Yes/No |
|---|---|
| Tôi giải đúng kiến thức và nêu được ví dụ / failure / test cần thiết | [ ] |
| Tôi hiểu câu hỏi khi nghe, hoặc hỏi lại đúng chỗ | [ ] |
| Tôi tự nói không nhìn script; có mở đầu và kết luận rõ | [ ] |
| Tôi xử lý được ít nhất 1 follow-up mới | [ ] |
Mẫu trả lời dài V4 (tùy chọn; xem sau khi tự nói)
Show sample only after speaking
One possible answer (~40–90 words):
Before answering, I would clarify the requirement and state my main assumption. Then I would explain a simple, testable approach. For example, if the issue involves inventory concurrency, I would protect the invariant at the database boundary and verify it with two overlapping requests. The trade-off may be extra contention or complexity, so I would choose a solution appropriate to the actual workload.
Knowledge guardrail: Mock là đo phản xạ với câu hỏi mới; không dùng bài mẫu vừa đọc để tự cho điểm cao.
Reverse recall: Che sample; nói lại bằng từ của mình rồi trả lời follow-up số 2 trong Speaking Lab 13.
HARD MOCK V3.1 — ĐÁNH GIÁ THỰC CHẤT, KHÔNG HỌC THUỘC
Chỉ mở phần này sau một vòng học. Đề được tạo để luyện tư duy, không phải đề bị lộ hay bài thi chính thức. Đây là bộ riêng, khó hơn 24 MCQ nhận diện của V3. Hãy làm trước, chỉ xem đáp án khi kết thúc toàn bộ phần cần chấm.
E0. Một vòng 70 phút
| Phần | Thời gian | Sản phẩm |
|---|---|---|
| A. 20 MCQ tình huống | 20 phút | 20 đáp án + 1 dòng vì sao cho 5 câu khó nhất |
| B. Java/API đọc code lạ | 10 phút | Mô tả flow, 2 bugs/risks, 2 tests |
| C. LLD + basic system design | 15 phút | 3 câu hỏi clarify, entities, APIs, state, failure, trade-off |
| D. FDE cold case | 15 phút | Goal/MVP/data/acceptance + response khi đổi requirement |
| E. Nói tiếng Anh | 7 phút | 2 answers dài 45–60s, 2 follow-ups |
| F. Error log | 3 phút | 3 lỗ hổng ưu tiên nhất |
Phần A — 20 câu MCQ tình huống, chọn MOST defensible
1. A service checks availableSeats > 0, then decreases the count. Two requests race for the last seat. What is the strongest fix among these options?
A. Put @Transactional around the existing read-then-write, using the default isolation without extra checks.
B. Use a transaction and an atomic conditional update or suitable row lock, then test competing requests.
C. Synchronize the controller method in one JVM, even if the service may run on multiple instances.
D. Refresh the seat count after each request in the frontend.
2. A client gets a read timeout from a provider after sending a request to create a reservation. There is no status lookup and no documented idempotency contract. Which conclusion is safest?
A. Treat the timeout as a documented provider rejection and create a new request immediately.
B. Retry once with a new generated operation ID, because that will improve safety.
C. Mark the outcome as uncertain and investigate/reconcile before retrying blindly.
D. Increase the timeout on every retry; duplicates are then impossible.
3. The same idempotency key is reused with a different request body. Which behavior is easiest to defend in an API with stored request hashes?
A. Treat the new body as a new operation with the same key.
B. Ignore both requests permanently.
C. Return the old result without telling the caller the bodies differ.
D. Return a conflict according to the contract because one key must identify one operation.
4. An API returns HTTP 201 with status: PENDING_APPROVAL. A product manager says “201 means the booking is confirmed.” What is the best correction?
A. Creation of a booking resource and approval of that booking are the same event.
B. HTTP 201 indicates resource creation; approval is a separate business state.
C. 201 must be changed to 202 whenever a staff review is needed, regardless of whether a resource was already created.
D. 201 implies the resource cannot transition into another state.
5. A query filters by workspace_id, orders by created_at DESC, and frequently limits to 20 results. Before recommending an index, what should you do?
A. Add separate indexes on workspace_id and created_at without reviewing the actual plan.
B. Create a partial index only on created_at because ordering is the slow part.
C. Inspect workload and query plans, then evaluate an index matching filter and sort order.
D. Add one composite index in the reverse order of the query and assume the planner must use it.
6. You want departments whose employee count is over 10. Which construct filters grouped results?
A. WHERE COUNT(*) > 10 before GROUP BY.
B. HAVING COUNT(*) > 10 after GROUP BY.
C. ORDER BY COUNT(*) > 10.
D. LIMIT COUNT(*) > 10.
7. A cache stores user roles for five minutes. A user is removed from an admin role but can still approve a change briefly. What is the direct underlying problem?
A. Cached authorization data is stale; revocation is not immediately reflected.
B. Database isolation changed the meaning of the role value.
C. Authentication automatically fails whenever an authorization role changes.
D. The frontend must be failing to read a successful 200 response.
8. A payment provider reports success, but the app crashes before saving the final payment state. Which claim is valid?
A. Wrap the local database write in a transaction; that makes the provider operation atomic with it.
B. Retry a fresh provider request using a new key because the DB lacks the old state.
C. Reconcile the provider's outcome using a stable reference before deciding whether to retry.
D. Rely on a circuit breaker to deduplicate the already-successful charge.
9. A product owner asks for 12 microservices for a 20-user internal admin tool. How should a junior engineer respond?
A. Start with microservices because the product owner requested twelve; decide service boundaries later.
B. Clarify team, deployment and workload constraints; propose a simpler modular MVP unless separate services are justified.
C. Choose a queue-first architecture so all operations become asynchronous from day one.
D. Choose a serverless architecture without identifying the workflow or operational constraints.
10. A LEFT JOIN returns unexpected missing customer rows after adding WHERE orders.status='PAID'. Why?
A. Filtering orders.status in WHERE can remove left rows whose joined order is NULL.
B. LEFT JOIN only preserves unmatched left rows if a primary key is present in both tables.
C. LEFT JOIN preserves unmatched left rows even after any WHERE filter.
D. A database index must be missing on the right table, changing the set of returned rows.
11. You need to allow staff approval but prevent users from approving their own requests. Where should the invariant live?
A. Hide the approval button and assume users cannot invoke its API directly.
B. Enforce role and self-approval checks in backend logic and test unauthorized calls.
C. Check only that the request contains a valid JWT signature, regardless of its actor.
D. Add a foreign key from the request to the approver and assume that enforces the role policy.
12. A notification worker receives a message twice under an at-least-once queue. Which practice addresses the duplicate effect?
A. Increase the message visibility timeout and rely on that to prevent every duplicate.
B. Deduplicate by durable message/event ID or make processing idempotent.
C. Run just one worker instance and assume redeliveries cannot occur.
D. Disable retries, accepting lost notifications as the required behavior.
13. A Java class overrides equals() by business ID but does not update the corresponding hash behavior. Where might you first notice a bug?
A. A HashSet can incorrectly treat logically equal business objects as distinct.
B. The equals method can no longer be called directly by the JVM.
C. Changing the DB isolation level is required to fix Java object equality.
D. The compiler will reject every class that overrides equals without hashCode.
14. Two threads run count++ on a shared volatile int. Which statement is defensible?
A. volatile provides visibility, so the compound count++ becomes atomic.
B. count++ can still lose updates because the read-modify-write sequence is not atomic.
C. Synchronizing only the getter guarantees atomic increments in every writer.
D. Atomics are unnecessary because integer writes are indivisible on common platforms.
15. An order import job is marked COMPLETE, but the customer says inventory is now different from yesterday's file. Which question matters first?
A. Reapply the whole nightly file until the DB matches it exactly.
B. Clarify whether the file is a snapshot/delta and whether valid sales occurred after its cutoff.
C. Treat the import job's COMPLETED state as proof every stock row is still identical to the input.
D. Retry the job with a new ID, even if corrections and sales may already have happened.
16. A team reports 100% line coverage but missed a concurrency defect. What is the best interpretation?
A. Line coverage alone is sufficient if there are no thrown exceptions.
B. Add concurrent integration scenarios that assert the business invariant under overlapping requests.
C. Raise line coverage above 100% by repeatedly executing the same single-thread tests.
D. Switch unit tests to mocks so scheduling becomes deterministic and races no longer matter.
17. A downstream service fails, but the system successfully serves cached catalog data. Which risk still needs review?
A. Cached availability may be too stale for the operation the user is about to perform.
B. Any successful cache read proves the downstream is healthy and database stock is correct.
C. Retrying the cache read always guarantees the newest business data.
D. Removing the cache TTL is enough to make reads immediately consistent.
18. An interviewer says “Which approach is LEAST likely to prevent duplicates?” You know three proposed approaches each have limitations. What should you do?
A. Pick the strongest approach.
B. Choose the one that appears least effective under stated assumptions, and explain why.
C. Ignore LEAST; all answers are equal.
D. Always choose the longest answer.
19. A customer says the MVP needs manual approval, and your design automatically approves requests after validation. Which issue is most direct?
A. A functional requirement has been missed; the workflow/state model needs manual approval.
B. The design is still correct if the frontend says "pending" while the backend auto-approves.
C. An asynchronous email after auto-approval is equivalent to staff approval.
D. The requested manual step can be excluded without stakeholder agreement because validation passed.
20. A vendor's fictional API spec says identical requestKey + payload is idempotent for 24 hours. The client retries after 48 hours. What is safest?
A. Reusing the key after 48 hours is guaranteed safe because it worked on the first day.
B. The documented window expired; do not assume provider deduplication still protects a retry.
C. Retrying with a new key at 48 hours is safer because each retry needs a new identifier.
D. An HTTP POST becomes idempotent after the first successful response, independent of key lifetime.
Phần B — đọc code lạ (10 phút)
class MembershipService {
private final MemberRepository repo;
private final EventPublisher events;
void promote(UUID workspaceId, UUID memberId) {
Member member = repo.find(workspaceId, memberId);
if (member.role() == Role.ADMIN) return;
member.setRole(Role.ADMIN);
repo.save(member);
events.publish("MEMBER_PROMOTED", memberId.toString());
}
}
Chỉ dựa trên code đã thấy: Mô tả flow; nêu 2 câu hỏi về access/authorization và reliability; nếu events.publish lỗi sau repo.save, điều gì có thể xảy ra? Thiết kế 2 tests. Đừng tự khẳng định @Transactional, outbox, authorization ở nơi khác có hoặc không vì snippet chưa cho thấy.
Phần C — LLD + Basic System Design (15 phút)
Design a simple equipment loan system for a small office. Employees borrow laptops from IT. Only available items may be borrowed. IT staff record returns and damages.
Yêu cầu: 4 questions → actors → 4 entities → 3 endpoints → states → concurrency invariant → error case → 1 trade-off → 45-second English explanation.
Phần D — FDE Case (15 phút)
A client says: “We spend two hours every morning cleaning supplier data. Please automate it.”
Bắt đầu bằng discovery và ghi assumptions. Phút thứ 7, interviewer bổ sung: “Different suppliers use different product IDs, and corrections can arrive days later.” Điều chỉnh MVP, mapping, version/reconciliation và acceptance criteria. Không cần đề xuất AI nếu chưa có bằng chứng đây là giải pháp phù hợp.
Phần E — Technical English oral (7 phút)
Nói không nhìn script:
- Why is a database transaction different from a Java synchronized block?
- Could you walk me through a production-like failure case in your project without claiming something you did not verify?
- What assumptions would you validate before introducing a queue?
- What would you tell a nontechnical customer if the requested automation is unsafe without manual review?
E1. ĐÁP ÁN VÀ RUBRIC — KHÔNG XEM TRƯỚC KHI LÀM
Đáp án 20 câu MCQ + reasoning
| # | Đáp án | Tại sao phương án đúng hơn các phương án gần đúng |
|---|---|---|
| 1 | B | Phải có concurrency control ở nguồn dữ liệu; @Transactional đơn lẻ không tự làm điều kiện read-then-write an toàn. |
| 2 | C | Timeout tạo uncertainty; tránh retry mù khi không có idempotency/status contract. |
| 3 | D | One operation/key; payload khác nên báo conflict thay vì âm thầm replay kết quả không liên quan. |
| 4 | B | HTTP resource creation khác business confirmation. |
| 5 | C | Query plan/workload trước khi chọn index; composite index là ứng viên chứ không phải cam kết luôn tốt. |
| 6 | B | HAVING lọc nhóm; WHERE lọc hàng trước aggregation. |
| 7 | A | Cache TTL có cửa sổ quyền cũ. Cần quyết định invalidation/shorter TTL/DB check cho action nhạy cảm. |
| 8 | C | Local DB transaction không bao phủ provider side effect; phải đối soát trạng thái. |
| 9 | B | Requirements và constraints đi trước kiến trúc; microservices có operational cost. |
| 10 | A | Filter trên right-side trong WHERE loại các NULL unmatched rows. |
| 11 | B | Quy tắc quyền phải được enforcement ở server; UI hiding không đủ. |
| 12 | B | At-least-once có duplicate; cần idempotent effect. |
| 13 | A | equals/hashCode contract rất quan trọng trong HashMap/HashSet. |
| 14 | B | volatile hỗ trợ visibility/order, không làm thao tác read-modify-write atomic. |
| 15 | B | Reconciliation cần cutoff/delta và phân biệt sale hợp lệ; không mặc định chênh lệch là lỗi. |
| 16 | B | Coverage không chứng minh correctness trên interleavings. |
| 17 | A | Availability của cache khác correctness/freshness. |
| 18 | B | LEAST là hiệu quả ít nhất; phải đọc đúng điều kiện. |
| 19 | A | Vi phạm yêu cầu chức năng/workflow; phải sửa states/approval. |
| 20 | B | Idempotency chỉ được bảo đảm trong scope/window tài liệu nêu. |
Ngưỡng học: ≥16/20 và giải thích được tối thiểu 5 câu scenario không nhìn đáp án là tín hiệu tốt; nếu câu dễ vẫn sai, quay lại mô-đun tương ứng. Không suy ra điểm mock = xác suất pass.
Rubric phần B — Code reading
Flow: find member → if already admin return → set role → save → publish event. Questions: who may promote? does workspace/member access get validated? Is repo.save committed before event is published? Is there transaction/outbox? A failure in publication may leave state/event out of sync depending on transaction boundaries not shown; cannot conclude chính xác chỉ từ snippet. Tests: unauthorized promotion must be rejected where policy is enforced; publishing failure should be simulated and expected DB/event behavior asserted based on agreed consistency contract. Also test duplicate promotions and nonexistent member.
Rubric phần C — Equipment Loan
Questions: item-level vs model-level? maximum loan length? damage policy? who can borrow/record return? Actors employee/IT. Entities Employee, EquipmentItem, Loan, DamageReport (và optional audit). APIs POST /loans, POST /loans/{id}/return, POST /items/{id}/damage-reports. States AVAILABLE/LOANED/MAINTENANCE/LOST; loan active/returned. Invariant: một thiết bị vật lý không có hai active loans; transaction/lock/constraint đúng nguồn dữ liệu. Errors: invalid item, already loaned, unauthorized; tests concurrent last-item borrow, return twice, mark damaged then deny borrowing. Trade-off: một monolith + SQL đủ cho MVP, không cần tách hệ thống phân tán. English: 3–5 câu có actor/data/rule/test.
Rubric phần D — Data Cleanup Decomposition
Goal là giảm time spent và error rate, chưa giả định tự động hóa 100% an toàn. Hỏi sample data/schema/encoding/volume, existing mapping, current manual steps, rule for duplicates/conflicts, source-of-truth, corrections, validation owners. MVP: connectors một vài supplier → staging + normalization/mapping → reject/exception queue → review UI/report → controlled apply. Entities: Supplier, SourceRecord, CanonicalProduct, Mapping, ImportJob, Correction/Version. Correction days later cần stable source identity, lineage, effective time và recompute/reconcile thay vì append vĩnh viễn. Acceptance: số hàng hợp lệ/không hợp lệ có giải thích, không trùng canonical ID, rerun cùng batch không có duplicate effect, thời gian xử lý giảm khi đo so baseline. Không bịa % tăng năng suất.
Rubric phần E — Oral
Mỗi câu chấm correctness (0–2), structure (0–2), clarification/follow-up (0–2), understandable English (0–2). Không trừ nặng accent nếu vẫn hiểu. Một trả lời tốt nêu một ý chính → cơ chế → ví dụ → hạn chế hoặc test. Câu (2) chỉ nói chi tiết project đã tự kiểm chứng và thuộc đóng góp của mình. Câu (4) nêu rủi ro, đề xuất human review và acceptance, không hứa automation hoàn toàn.
E2. Chấm lỗi theo nguyên nhân để quyết định học tiếp
| Khi sai | Không cần làm | Cần làm |
|---|---|---|
Không hiểu từ LEAST, assuming, unless |
Học thêm UML | Ôn Mô-đun 02, nghe lại D2 |
| Lẫn transaction với external side effect | Học mạng toàn bộ | Mô-đun SQL + LAB B + một project flow |
| Không chia được entities/state/API | Học thêm design patterns | LAB A → Registration → Booking |
| Chọn tech trước requirement | Vẽ thêm architecture | FDE C0 + cold case C1/C2 |
| Biết nhưng không nói được bằng English | Chép 100 từ vựng | Mô-đun English + D1/D2 10 phút/ngày |
| Bị code lạ làm đứng hình | Chỉ luyện LeetCode thêm | LAB D3–D6: read→trace→modify→test |
Chốt: Đây chỉ là kiểm tra các phần học chung. Vẫn cần duy trì DSA Medium có chọn lọc, một project deep dive có bằng chứng, Java/Spring practical và Applied AI nếu vị trí FDE có vòng AI-focused.
PHỤ LỤC A — QUICK REVIEW P0 (15–20 PHÚT TRƯỚC PHỎNG VẤN)
Đây là phiên bản active recall thay cho đọc thuộc. Che cột phải/đáp án; nói trước khi mở.
A1. 10 câu tiếng Anh phải hiểu ngay (2–3 phút)
| Interviewer hỏi | Bạn phải làm gì |
|---|---|
| What is ...? | định nghĩa + ví dụ |
| How does ... work? | từng bước |
| Why did you choose ...? | lý do + trade-off |
| What if ... fails? | failure + recovery |
| Compare X and Y. | 2–3 điểm khác nhau |
| Walk me through ... | input → components → output |
| What assumptions ...? | giả định + cách kiểm chứng |
| Clarify the requirements. | hỏi ai/cái gì/điều kiện/dữ liệu |
| MOST/LEAST/EXCEPT | kiểm tra hướng chọn đáp án |
| How would you verify ...? | tests/metrics |
A2. 12 flashcards CS phải tự nói (4 phút)
- Process vs Thread? — Address-space isolation vs shared process resources.
- Concurrency vs Parallelism? — Overlap of progress vs actually simultaneous execution.
- Deadlock vs Race condition? — Wait cycle vs wrong outcome due to interleaving.
- TCP vs UDP? — Reliable ordered byte stream vs unguaranteed datagrams.
- 401 vs 403 vs 409? — Auth / permission / state conflict.
- WHERE vs HAVING? — Rows before groups / groups after aggregation.
- Index trade-off? — Eligible reads vs write/storage maintenance.
- Atomicity vs Isolation? — All-or-nothing / interaction of concurrent transactions.
==vsequals()? — Object identity vs logical equality.- Unit vs integration test? — Isolated unit behavior vs component interaction.
- Idempotent operation? — Repeated calls same intended effect within semantics.
- Cache hit vs stale data? — Fast read vs risk outdated state.
A3. Nhớ thứ tự trả lời design (4 phút)
LLD: Actors → Entities → Rules → States → APIs → Classes → Edge cases → Tests.
System design: Requirements → APIs/Data → Components/Flow → Failures → Trade-offs/Tests.
Problem decomposition: GOAL → CLARIFY → SCOPE → BREAK DOWN → DESIGN → VALIDATE.
Không đảo thứ tự: đừng chọn Redis/queue/microservices trước khi hiểu pain point.
A4. Một mini-case nói 4 phút
Customers complain that booking confirmations are unreliable. What would you investigate and propose?
- 1 câu Goal.
- 3 câu hỏi Clarify.
- 2 root causes có thể xảy ra (chưa khẳng định).
- 1 MVP fix / measurement.
- 1 câu trình bày bằng tiếng Anh.
Đáp án nhắc nhanh
Hỏi: lỗi gửi email hay booking chưa được lưu? Tỷ lệ lỗi và logs? Lỗi chỉ lúc peak hay mọi lúc? Các nguồn dữ liệu là gì?
Giả thuyết: external email provider down, race condition, request timeout.
Đề xuất đo: tracking booking_id–notification_event_id, logs, success/delivery rate, pending status, retries có kiểm soát.
Không được tự kết luận “thêm queue là hết lỗi” khi chưa biết nguyên nhân.
LỘ TRÌNH 16 BUỔI — ĐI TỪ DỄ ĐẾN KHÓ (KHÔNG ÉP DEADLINE)
Bổ sung V3.2 cho ứng viên Java: sau buổi 7, xen thêm 2–4 buổi tự học 08A → 08B → LAB 08C tùy kết quả PRETEST; bảng 16 buổi dưới đây là tuyến CS/LLD/FDE gốc, không bao gồm các buổi Java bổ sung.
Một "buổi" là một đơn vị học 30–60 phút, không bắt buộc một buổi một ngày. Mỗi buổi thực hiện
WATCH → COMPLETE → DO → EXPLAIN. Khi đã làm được cold test thì chuyển nhanh; khi chưa đạt thì dừng đúng chỗ vướng.
| Buổi | Học gì | Bằng chứng đã hiểu (tự làm, không nhìn bài) |
|---|---|---|
| 1 | Mô-đun 01–02 (request flow + interview verbs) | 1 request flow + phân loại 10 câu hỏi |
| 2 | LAB A: entity, state, rule, API | tự thiết kế note/enrollment/leave request |
| 3 | Mô-đun 03: Registration LLD | 1 biến thể password reset có entity + 2 API |
| 4 | Mô-đun 04: SQL, transactions | 1 JOIN + giải thích race/rollback |
| 5 | Mô-đun 05–06: HTTP và OS | diễn giải timeout/concurrency với 3 failure scenarios |
| 6 | Mô-đun 07: Booking states/API | 1 sequence + 2 concurrent tests |
| 7 | Mô-đun 08: Testing/Cloud/Java recap | pretest/MCQ, chỉ đọc các mục sai |
| 8 | Mô-đun 09: System Design | MVP → components → reliability → 3 trade-offs |
| 9 | LAB B: Integration/Debug | 1 scenario timeout + 1 CSV scenario |
| 10 | Mô-đun 10: FDE decomposition | worked case + 5 discovery questions |
| 11 | LAB C: case 1–2 | case không nhìn gợi ý + requirement change |
| 12 | LAB C: case 3–4 | 1 case bằng tiếng Anh 90 giây |
| 13 | Mô-đun 11: English & project | tự nói một project 2 phút, nhận follow-up |
| 14 | LAB D: nghe và đọc code lạ | 6 listening prompts + Java parsing exercise |
| 15 | Mô-đun 12: 4 case tích hợp | 2 case không gợi ý; tự sửa 3 lỗi điển hình |
| 16 | Mô-đun 13 + HARD MOCK | làm bài không tra cứu; phân loại lỗi và chọn mục ôn |
Cách dùng ba tài liệu project mà bạn đã cung cấp
- V-Market là project chính phù hợp cho Backend/FDE integration: checkout, stock consistency, CSV vendor import, reconciliation. Học 1 flow → 3 follow-ups → 1 failure case, rồi mở code thật.
- V-Core chỉ cần khi luyện LLD/invariant: move task, WIP, version/idempotency, access control.
- V-Pulse dùng bổ sung nếu được hỏi reliability: timeout, circuit breaker, replay, trạng thái không chắc kết quả; gateway trong tài liệu project là simulator, không gọi là payment provider production thực.
Bằng chứng cần phân loại rõ: Confirmed in code = nội dung của báo cáo đọc code, Inferred = suy luận, Not verified = chưa xác minh; việc có test trong source không chứng minh đã chạy lại hoặc CI hiện đang xanh. Giải thích trung thực phần bạn trực tiếp làm; không tự nhận ownership không có chứng cứ.
Error log template — copy sau mỗi mock
Date:
Question / situation:
What I answered (2 sentences):
What I missed:
Cause: [term] [knowledge] [reasoning] [code] [English/listening] [time]
One correction:
Retest on (tomorrow / +3 days / +7 days):
Tiêu chuẩn dừng ôn một chủ đề
- Bạn hiểu câu hỏi tiếng Anh, hoặc có thể xác nhận lại nếu mơ hồ.
- Bạn nêu assumptions, kể được input → components → outcome, một failure và một test.
- Bạn tự giải case tương tự nhưng thay dữ kiện, không phụ thuộc đáp án cũ.
- Bạn nói ngắn bằng tiếng Anh ở tốc độ dễ hiểu, không cần văn phong phức tạp.
Nếu đạt bốn điều này ở một nhóm, chuyển sang lỗ hổng tiếp theo. Tránh cố học mọi tài liệu đến mức như Senior mới dám apply.
Nguồn và giới hạn áp dụng
Phương pháp học: Dunlosky và cộng sự (2013), Improving Students' Learning With Effective Learning Techniques: https://doi.org/10.1177/1529100612453266 (practice testing, distributed practice); Renkl & Atkinson (worked examples / fading guidance) — xem tài liệu nghiên cứu giáo dục có cùng chủ đề. Đây là cơ sở cho cách bố trí học, không phải bảo đảm hiệu quả cho từng người hoặc định lượng thời gian chuẩn.
Kinh nghiệm phỏng vấn: Các ví dụ coding, decomposition, learning, client-facing, project deep dive đã được đối chiếu với tự thuật ứng viên FDE/FDSE và Java Backend trong quá trình biên soạn V3; không phải một blueprint chung cho mọi công ty. Câu hỏi được soạn trong V3.1 là mô phỏng phục vụ luyện tập, không phải bản sao câu hỏi tuyển dụng thực tế.
Phạm vi: Không thay thế luyện LeetCode Medium, Java/Spring implementation sâu, spoken English có feedback từ người thật, Applied AI/RAG/agents (khi vị trí FDE chuyên AI), hoặc phỏng vấn riêng từng công ty.
Nguồn tham khảo — phân biệt tài liệu gốc và phần bổ sung
Nghiên cứu phương pháp học (được dùng để thiết kế cách học, không phải chứng minh 16 buổi chắc chắn đủ):
- Dunlosky et al. (2013), Improving Students' Learning With Effective Learning Techniques, Psychological Science in the Public Interest — nhấn mạnh practice testing và distributed practice: https://www.psychologicalscience.org/journals/pspi/1529100612453266/
- The Learning Scientists, Six Strategies for Effective Learning — spacing, retrieval, elaboration, interleaving, concrete examples, dual coding: https://www.learningscientists.org/blog/2016/8/18-1
- Pooja K. Agarwal, How can we maximize students' learning with feedback? — retrieval practice + feedback: https://www.retrievalpractice.org/strategies/2018/5/25/feedback
- Van Gog & Rummel (2010/2011), Effects of worked examples, example-problem, and problem-example pairs on novices' learning: https://doi.org/10.1016/j.cedpsych.2010.10.004
- Shin et al. (2023), The Effects of Worked-Out Example and Metacognitive Scaffolding on Problem-Solving Programming — hướng dẫn bằng ví dụ trong học lập trình: https://doi.org/10.1177/07356331231174454
Trải nghiệm ứng viên (được dùng để chọn dạng bài thực hành, không phải dự đoán chính xác đề từng công ty):
- Glassdoor — FDE interview reports có API design, API data processing, retry logging, LeetCode: https://www.glassdoor.com/Interview/foward-deployed-engineer-interview-questions-SRCH_KO0%2C24.htm
- Glassdoor — FDE New Grad reports có DSA/SQL/API questions: https://www.glassdoor.com/Interview/forward-deployed-engineer-new-grad-interview-questions-SRCH_KO0%2C34.htm
- Reddit r/cscareerquestionsEU (09/10/2026) — một ứng viên đang phỏng vấn FDE kể về JSON parsing, Kubernetes ingress, project/design và client-facing case: https://www.reddit.com/r/cscareerquestionsEU/comments/1x1nuyb/forward_deployed_engineer_interviews/
- Reddit r/developersIndia (21/01/2026) — ứng viên 6 năm kinh nghiệm được hỏi Spring transactions, index, concurrency; không dùng làm chuẩn độ sâu cho Fresher: https://www.reddit.com/r/developersIndia/comments/1qiqpyn/recent_java_backend_developer_interview_experience/
Tài liệu kỹ thuật tham chiếu (mở khi muốn kiểm tra chi tiết, không cần học tất cả):
- Oracle Java —
Object.equals()/hashCode(): https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/lang/Object.html - MDN — HTTP overview: https://developer.mozilla.org/en-US/docs/Web/HTTP/Overview
- PostgreSQL — Transactions: https://www.postgresql.org/docs/current/tutorial-transactions.html
- PostgreSQL — Transaction Isolation: https://www.postgresql.org/docs/current/transaction-iso.html
- Microsoft SQL Server data type families: https://learn.microsoft.com/en-us/sql/t-sql/data-types/data-types-transact-sql
- ISTQB Foundation syllabus (testing terms): https://istqb.org/wp-content/uploads/2024/11/ISTQB_CTFL_Syllabus_v4.0.1.pdf
KẾT THÚC — THẾ NÀO LÀ ĐỦ ĐỂ BẮT ĐẦU ĐI PHỎNG VẤN?
Bạn không cần đợi thuộc hết tài liệu. Hãy bắt đầu phỏng vấn khi tự làm được những việc sau không nhìn mẫu:
- [ ] Đọc/nghe hiểu 8/10 câu hỏi về kiến thức đã học, biết hỏi lại khi mơ hồ.
- [ ] Giải thích OS/network/DB/Java fundamentals P0 ngắn gọn bằng tiếng Anh.
- [ ] Tự thiết kế một API + data model + state machine + sequence flow cơ bản.
- [ ] Biết lý giải ít nhất 3 trade-offs thay vì chỉ nêu tool names.
- [ ] Làm được một case FDE lạ với đầy đủ Goal → Clarify → Scope → Break Down → Design → Validate.
- [ ] Giải thích được 1 project thật của mình: contribution, request flow, errors, decisions, tests.
- [ ] Duy trì live coding Java/SQL/DSA phù hợp từng vòng tuyển dụng ở tài liệu riêng.
Nhớ câu này: A strong junior answer is not the most complicated architecture. It is a clear explanation of the problem, a sensible simple solution, its limitations, and how to verify that it works.
Cập nhật V3.2 cho Java Backend: trước khi coi phần Java đã xong, hãy hoàn thành 08A.6 (Java Mock), 08B.6–7 (Spring scenario + Mock) và LAB 08C. Đọc/hiểu code trong project thực tế quan trọng hơn thuộc lòng sample answer. Các bài thực hành tự soạn trong 08A–08C là đề luyện, không phải câu hỏi chính thức của công ty nào.
PHỤ LỤC V4 — LUYỆN PHẢN XẠ THỰC TẾ, KHÔNG HỌC SCRIPT
1. Bài luyện nghe không nhìn chữ: 15 prompt theo mức độ
Cách dùng: đưa các prompt cho người khác hoặc AI Voice, yêu cầu đọc ngẫu nhiên từng câu, không đọc đáp án. Trong 5 giây, phân loại dạng hỏi; sau đó trả lời 20–90 giây. Đánh dấu L nếu không bắt được âm, T nếu không hiểu thuật ngữ, S nếu hiểu mà không bật ra câu nói.
| Cấp | Prompt | Loại đáp án cần có |
|---|---|---|
| 1 | What is a database transaction? | Definition + one example |
| 1 | What does a controller do? | Responsibility + flow |
| 1 | What's the difference between 401 and 403? | Comparison |
| 1 | How do you validate a request body in Spring? | Mechanism |
| 1 | Why do we use indexes? | Reason + cost |
| 2 | Could you walk me through a registration request? | Input → components → output |
| 2 | How would you avoid duplicate orders after retries? | Failure + prevention |
| 2 | Why doesn't volatile guarantee atomic increments? | Mechanism + example |
| 2 | What would you test if two clients reserve the last item? | Concurrent test + invariant |
| 2 | Which assumption would you clarify before creating a booking API? | Clarification |
| 3 | The request timed out. Can you prove that the operation was rolled back? | Resist incorrect premise |
| 3 | Your SQL query is still slow despite an index. What would you inspect? | Diagnosis |
| 3 | The business changes the approval rule. What needs to change in the design? | Requirement change |
| 3 | What's the trade-off between caching availability and strong consistency? | Trade-off |
| 3 | Explain your approach again to someone who isn't an engineer. | Simplification |
2. 5 cuộc hội thoại mô phỏng — nói phần Candidate trước khi xem gợi ý
Dialogue A — Java Core
Interviewer: What is the difference between equals and == in Java?
Your turn: tự trả lời 20–30 giây.
Interviewer: What can go wrong if a HashMap key changes after insertion?
Gợi ý sau khi tự nói
== thường so sánh identity của object reference; equals có thể biểu diễn logical equality. Mutable key thay đổi thông tin được dùng trong equality/hash có thể làm map không tìm lại key theo cách mong đợi. Không phải mọi object đều override equals.
Dialogue B — Spring Boot
Interviewer: Walk me through what happens when a POST request reaches a Spring controller.
Your turn: giải thích Controller → DTO validation → Service → Repository → response.
Interviewer: If @Valid passes, can we assume the email is unique?
Gợi ý sau khi tự nói
@Valid kiểm annotation validation tương ứng, nhưng không thay thế ràng buộc dữ liệu và concurrency control ở DB. Unique constraint của DB là cơ chế bảo vệ quan trọng khi có các request chồng lấn.
Dialogue C — SQL / reliability
Interviewer: A payment-like operation times out. What would you do?
Your turn: tránh kết luận đã thất bại; nói về xác minh status, idempotency, log, reconciliation theo contract. Không tự giả định provider hỗ trợ idempotency.
Interviewer: What if the downstream API has no idempotency key support?
Gợi ý sau khi tự nói
Điều tra trạng thái theo operation/reference nếu API hỗ trợ, thiết kế workflow với trạng thái UNKNOWN/PENDING, có reconciliation/đối soát; tránh retry mù gây duplicate side effects. Giới hạn của các biện pháp tùy hợp đồng external API.
Dialogue D — Project deep dive
Interviewer: Tell me about a project where you handled a difficult backend scenario.
Your turn: nói đúng contribution thật trong V-Market, V-Core, V-Pulse hoặc sản phẩm internship; không nhận implement khi chỉ thấy trong repo.
Interviewer: What is one test that proves the important business rule?
Gợi ý sau khi tự nói
Dùng cấu trúc: The main risk was... The invariant was... I checked... The test sent... I expected... Cần kiểm tra test có thực sự tồn tại và kết quả chạy trước khi nói “the test passed”.
Dialogue E — FDE discovery
Customer: Our staff waste time updating bookings every day. Can you build an AI system?
Your turn: đặt câu hỏi về workflow, loại thay đổi, volume, errors, nguồn dữ liệu, người phê duyệt và success metric trước khi đề xuất AI.
Customer: We only have two weeks, and our source data is sometimes wrong.
Gợi ý sau khi tự nói
Khoanh MVP nhỏ, làm rõ source of truth, quy trình kiểm dữ liệu và human review, đặt acceptance criteria khả thi. Không tự kết luận “AI solution” là phù hợp chỉ vì khách hàng gọi tên AI.
3. 4 phiên General English 7 phút (xen giữa buổi kỹ thuật)
General English là điều kiện hỗ trợ hội thoại tự nhiên, không thay thế các Speaking Lab chuyên môn.
| Phiên | Câu gợi mở | Follow-up |
|---|---|---|
| A — Routine | What did you work on today? | What was easier or harder than expected? |
| B — Experience | Tell me about a difficult task you completed. | How did you decide what to do first? |
| C — Opinion | Do you prefer working alone or with a team? | Can you describe a time this mattered? |
| D — Plans | What do you want to improve next month? | How will you measure your progress? |
Quy tắc: nhờ AI/partner hỏi ngẫu nhiên 3–5 câu, đừng đọc lại câu trả lời đã chuẩn bị. Nếu ngừng quá lâu, trả lời bằng câu ngắn và được phép tự sửa: What I mean is... / Let me say that more clearly.
4. Speaking project drill — đừng biến thành bản quảng cáo CV
Chỉ chọn một project chính để luyện sâu cho đến khi tự giải thích được bằng tiếng Anh; với Java Backend thường phù hợp dùng V-Market, mở chính source thật để xác minh. Bộ câu hỏi:
- What problem does the project solve, and who uses it?
- What was your personal contribution?
- Walk me through one request from API to database.
- What invariant does the backend have to protect?
- What can go wrong when two requests arrive together?
- Why did you choose this approach instead of an alternative?
- Which test did you actually write or run? What result can you confirm?
- What would you improve if you had more time?
Story format (90 giây): Problem (15s) → Flow (25s) → Challenge (20s) → Choice/trade-off (15s) → Verification (15s). Đây là mốc luyện, không phải thời lượng chuẩn hóa. Không nói “production-ready”, “deployed”, “tested in CI”, “I built” nếu không kiểm chứng/không đúng vai trò. Có thể nói trung thực: I can explain this code path, but I haven't personally deployed that component.
5. Lịch 20 buổi tích hợp (tự điều chỉnh theo checkpoint)
Một buổi không đồng nghĩa một ngày. Nếu kiến thức quá khó, tách buổi; nếu đã đạt checkpoint, chuyển nhanh. Với Java Backend tập trung 08A/08B/08C trước; với FDE tăng thời lượng 10/LAB C.
| Buổi | Core lesson | Nhiệm vụ speaking tối thiểu |
|---|---|---|
| 1 | 01 Requirements / flow | Explain actor → rules → flow 40s |
| 2 | 02 Question recognition | Nghe 10 prompts; phân loại ≥8/10 |
| 3 | LAB A | Describe entities and invariant 45s |
| 4 | 03 Registration LLD | Explain two responsibilities and one race 60s |
| 5 | 04 SQL/transactions | Compare JOIN/index/lock; 1 follow-up |
| 6 | 05 HTTP | Explain uncertain timeout 60s |
| 7 | 06 Concurrency | Explain lost increment 60s |
| 8 | 07 Booking | Present state + one failure 90s |
| 9 | 08 Testing/security | Explain 3 tests and authorization 60s |
| 10 | 08A Java Core | Answer 5 random oral Java prompts |
| 11 | 08B Spring/JPA | Walk through a request; one N+1 follow-up |
| 12 | LAB 08C | Fix code/query and defend in 60–90s |
| 13 | 09 System Design | Explain simple MVP + trade-off 90s |
| 14 | LAB B | Diagnose 504 using evidence 90s |
| 15 | 10 FDE | Clarify/scope/metric 90s |
| 16 | LAB C | Cold case + mid-answer requirement change |
| 17 | 11 Project/English | Explain own project 90s; 2 follow-ups |
| 18 | LAB D | 5 blind listening questions + unfamiliar code |
| 19 | 12 Integrated cases | One independent system design 90s |
| 20 | 13 Mock + HARD MOCK | 5–8 min unscripted oral with K/S/L scoring |
Tuyến rút gọn Java Backend: 02 → 04 → 08A → 08B → LAB 08C → 05/06 → 11 + project → LAB D → 13. Tuyến FDE: 02 → 01 → LAB A → 03/07 → 09 → LAB B → 10 → LAB C → 11 → LAB D → 13. Nhánh khác vẫn ở cùng file khi cần.
6. Error log hai chiều — copy sau mỗi buổi
Date / lesson:
Task and question:
Technical score K (0–3):
Speaking score S (0–3):
Listening score L (0–3):
Technical misconception (if any):
What I actually said (short transcript or summary):
1 pronunciation / word-choice correction:
1 technical / clarity correction:
Sentence I can now say without looking:
New follow-up question I answered:
Review on +1 / +3 / +7 / +14:
Cách phân loại để không học lan man: K thấp, S cao = đang nói trôi chảy nhưng sai → quay lại code/concept. K cao, S thấp = hiểu nhưng chưa nói được → luyện retrieval/speaking repetitions. K cao, L thấp = nghe không nhận ra câu hỏi → luyện nghe ẩn transcript. K/S/L đều tốt = tiếp tục bài mới.
7. Kết thúc: tiêu chuẩn “đã học được” chứ không chỉ “đã đọc xong”
- [ ] Tôi có thể giải thích một khái niệm Java/Spring/SQL bằng 3–5 câu dễ hiểu mà không nhìn đáp án.
- [ ] Tôi nghe hiểu các dạng what/how/why/compare/what if/verify và có thể hỏi lại tự nhiên.
- [ ] Tôi giải một bài DO/cold case đúng bằng code/model/SQL chứ không chỉ nói.
- [ ] Tôi có thể kể về một project 60–120 giây, đúng contribution và đúng evidence.
- [ ] Tôi xử lý một follow-up thay dữ kiện; tôi có thể sửa câu trả lời khi nhận phản hồi.
- [ ] Tôi ghi lỗi, ôn câu sai theo khoảng cách, không học thuộc câu mẫu dài.
Nguyên tắc: Understand it → Build it → Explain it → Defend it → Explain it again in simpler English.