JAVA BACKEND / LISTEN & LEARN
Đến TTS 001 ↓
Mục lục bài học

V5.2 — 261 Question–Answer theo đúng thứ tự học xen kẽ

Cùng 261 Q&A từ V5.1, không thêm/bớt/sửa nội dung chuyên môn. Sắp xếp lại theo vị trí nằm trong giáo trình V5.2. Câu trả lời chỉ dùng sau khi tự nói.

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.


01 — Requirements, rules và request flow

Q001 · MECHANISM / WHY · BASE V4

TTS 001 · Q: What is the difference between a requirement and a business rule?

TTS 001 · Câu hỏi
Tải MP3 001
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.

TTS 002 · Đáp án
Tải MP3 002

Q002 · MECHANISM / WHY · BASE V4

TTS 003 · Q: Walk me through a simple booking request.

TTS 003 · Câu hỏi
Tải MP3 003
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.

TTS 004 · Đáp án
Tải MP3 004

Q003 · FOUNDATION · ADD V5

TTS 005 · Q: What is a functional requirement?

TTS 005 · Câu hỏi
Tải MP3 005
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.

TTS 006 · Đáp án
Tải MP3 006

Q004 · FOUNDATION · ADD V5

TTS 007 · Q: What is a business invariant?

TTS 007 · Câu hỏi
Tải MP3 007
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.

TTS 008 · Đáp án
Tải MP3 008

Q005 · SCENARIO / FOLLOW-UP · BASE V4

TTS 009 · Q: Why would you ask about staff approval before writing code?

TTS 009 · Câu hỏi
Tải MP3 009
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.

TTS 010 · Đáp án
Tải MP3 010

Q006 · SCENARIO / FOLLOW-UP · BASE V4

TTS 011 · Q: What changes if customers can cancel a booking?

TTS 011 · Câu hỏi
Tải MP3 011
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.

TTS 012 · Đáp án
Tải MP3 012

Q007 · SCENARIO / FOLLOW-UP · BASE V4

TTS 013 · Q: What would you test before releasing the feature?

TTS 013 · Câu hỏi
Tải MP3 013
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.

TTS 014 · Đáp án
Tải MP3 014

02 — Nghe và phân loại câu hỏi phỏng vấn

Q008 · MECHANISM / WHY · BASE V4

TTS 015 · Q: What kind of answer does “How does an index work?” require?

TTS 015 · Câu hỏi
Tải MP3 015
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.

TTS 016 · Đáp án
Tải MP3 016

Q009 · MECHANISM / WHY · BASE V4

TTS 017 · Q: Which action is LEAST likely to prevent duplicate bookings? Explain what LEAST changes.

TTS 017 · Câu hỏi
Tải MP3 017
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.

TTS 018 · Đáp án
Tải MP3 018

Q010 · MECHANISM / WHY · BASE V4

TTS 019 · Q: Could you compare a requirement and an assumption?

TTS 019 · Câu hỏi
Tải MP3 019
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.

TTS 020 · Đáp án
Tải MP3 020

Q011 · FOUNDATION · ADD V5

TTS 021 · Q: What does the word EXCEPT mean in a multiple-choice question?

TTS 021 · Câu hỏi
Tải MP3 021
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.

TTS 022 · Đáp án
Tải MP3 022

Q012 · SCENARIO / FOLLOW-UP · BASE V4

TTS 023 · Q: What would you say if you did not hear a technical term?

TTS 023 · Câu hỏi
Tải MP3 023
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.

TTS 024 · Đáp án
Tải MP3 024

Q013 · SCENARIO / FOLLOW-UP · BASE V4

TTS 025 · Q: How would you clarify a question about a “best” solution with missing constraints?

TTS 025 · Câu hỏi
Tải MP3 025
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.

TTS 026 · Đáp án
Tải MP3 026

Q014 · SCENARIO / FOLLOW-UP · ADD V5

TTS 027 · Q: What would you say if you did not know the answer to a technical question?

TTS 027 · Câu hỏi
Tải MP3 027
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.

TTS 028 · Đáp án
Tải MP3 028

A — Entities → Rules → APIs

Q015 · FOUNDATION · BASE V4

TTS 029 · Q: Design a small course enrollment feature. What are the entities?

TTS 029 · Câu hỏi
Tải MP3 029
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.

TTS 030 · Đáp án
Tải MP3 030

Q016 · FOUNDATION · BASE V4

TTS 031 · Q: Should the same student be allowed to enroll twice?

TTS 031 · Câu hỏi
Tải MP3 031
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.

TTS 032 · Đáp án
Tải MP3 032

Q017 · MECHANISM / WHY · ADD V5

TTS 033 · Q: What is the difference between an entity and a service?

TTS 033 · Câu hỏi
Tải MP3 033
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.

TTS 034 · Đáp án
Tải MP3 034

Q018 · SCENARIO / FOLLOW-UP · BASE V4

TTS 035 · Q: Two students take the last seat. How do you keep the capacity rule?

TTS 035 · Câu hỏi
Tải MP3 035
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.

TTS 036 · Đáp án
Tải MP3 036

Q019 · SCENARIO / FOLLOW-UP · BASE V4

TTS 037 · Q: How would you test unauthorized approval of a leave request?

TTS 037 · Câu hỏi
Tải MP3 037
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.

TTS 038 · Đáp án
Tải MP3 038

Q020 · SCENARIO / FOLLOW-UP · BASE V4

TTS 039 · Q: What if a student drops a course?

TTS 039 · Câu hỏi
Tải MP3 039
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.

TTS 040 · Đáp án
Tải MP3 040

Q021 · SCENARIO / FOLLOW-UP · ADD V5

TTS 041 · Q: How would you represent the lifecycle of a leave request?

TTS 041 · Câu hỏi
Tải MP3 041
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.

TTS 042 · Đáp án
Tải MP3 042

03 — Registration LLD

Q022 · MECHANISM / WHY · BASE V4

TTS 043 · Q: Explain the responsibilities of a registration controller and service.

TTS 043 · Câu hỏi
Tải MP3 043
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.

TTS 044 · Đáp án
Tải MP3 044

Q023 · MECHANISM / WHY · BASE V4

TTS 045 · Q: Why should the email comparison policy be defined explicitly?

TTS 045 · Câu hỏi
Tải MP3 045
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.

TTS 046 · Đáp án
Tải MP3 046

Q024 · MECHANISM / WHY · ADD V5

TTS 047 · Q: Why should passwords be hashed instead of encrypted for storage?

TTS 047 · Câu hỏi
Tải MP3 047
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.

TTS 048 · Đáp án
Tải MP3 048

Q025 · MECHANISM / WHY · ADD V5

TTS 049 · Q: What is the difference between validation and authorization in registration?

TTS 049 · Câu hỏi
Tải MP3 049
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.

TTS 050 · Đáp án
Tải MP3 050

Q026 · SCENARIO / FOLLOW-UP · BASE V4

TTS 051 · Q: How do you prevent two concurrent registrations with the same email?

TTS 051 · Câu hỏi
Tải MP3 051
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.

TTS 052 · Đáp án
Tải MP3 052

Q027 · SCENARIO / FOLLOW-UP · BASE V4

TTS 053 · Q: What happens if the email provider fails after the user is saved?

TTS 053 · Câu hỏi
Tải MP3 053
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.

TTS 054 · Đáp án
Tải MP3 054

Q028 · SCENARIO / FOLLOW-UP · BASE V4

TTS 055 · Q: How would you protect password-reset tokens?

TTS 055 · Câu hỏi
Tải MP3 055
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.

TTS 056 · Đáp án
Tải MP3 056

Q029 · SCENARIO / FOLLOW-UP · ADD V5

TTS 057 · Q: How would you handle verification-email delivery reliably?

TTS 057 · Câu hỏi
Tải MP3 057
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.

TTS 058 · Đáp án
Tải MP3 058

04 — SQL, indexes, ACID và locking / tiểu mục 04.1

Q030 · FOUNDATION · ADD V5

TTS 059 · Q: What is a primary key?

TTS 059 · Câu hỏi
Tải MP3 059
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.

TTS 060 · Đáp án
Tải MP3 060

Q031 · FOUNDATION · ADD V5

TTS 061 · Q: What is a foreign key?

TTS 061 · Câu hỏi
Tải MP3 061
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.

TTS 062 · Đáp án
Tải MP3 062

04 — SQL, indexes, ACID và locking / tiểu mục 04.2

Q032 · MECHANISM / WHY · BASE V4

TTS 063 · Q: Explain INNER JOIN versus LEFT JOIN with customer bookings.

TTS 063 · Câu hỏi
Tải MP3 063
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.

TTS 064 · Đáp án
Tải MP3 064

Q033 · MECHANISM / WHY · ADD V5

TTS 065 · Q: What is the difference between WHERE and HAVING?

TTS 065 · Câu hỏi
Tải MP3 065
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.

TTS 066 · Đáp án
Tải MP3 066

Q034 · MECHANISM / WHY · ADD V5

TTS 067 · Q: What is the difference between COUNT(*) and COUNT(column)?

TTS 067 · Câu hỏi
Tải MP3 067
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.

TTS 068 · Đáp án
Tải MP3 068

Q035 · MECHANISM / WHY · ADD V5

TTS 069 · Q: What is the difference between UNION and UNION ALL?

TTS 069 · Câu hỏi
Tải MP3 069
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.

TTS 070 · Đáp án
Tải MP3 070

04 — SQL, indexes, ACID và locking / tiểu mục 04.3

Q036 · FOUNDATION · ADD V5

TTS 071 · Q: What is a database index?

TTS 071 · Câu hỏi
Tải MP3 071
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.

TTS 072 · Đáp án
Tải MP3 072

Q037 · MECHANISM / WHY · ADD V5

TTS 073 · Q: Why can an index slow down INSERT and UPDATE operations?

TTS 073 · Câu hỏi
Tải MP3 073
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.

TTS 074 · Đáp án
Tải MP3 074

Q038 · SCENARIO / FOLLOW-UP · BASE V4

TTS 075 · Q: Would you add an index on a low-selectivity status column?

TTS 075 · Câu hỏi
Tải MP3 075
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.

TTS 076 · Đáp án
Tải MP3 076

Q039 · SCENARIO / FOLLOW-UP · ADD V5

TTS 077 · Q: How would you investigate a slow SQL query that already has an index?

TTS 077 · Câu hỏi
Tải MP3 077
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.

TTS 078 · Đáp án
Tải MP3 078

04 — SQL, indexes, ACID và locking / tiểu mục 04.5

Q040 · MECHANISM / WHY · BASE V4

TTS 079 · Q: What is the difference between atomicity and isolation?

TTS 079 · Câu hỏi
Tải MP3 079
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.

TTS 080 · Đáp án
Tải MP3 080

Q041 · FOUNDATION · ADD V5

TTS 081 · Q: What does ACID stand for?

TTS 081 · Câu hỏi
Tải MP3 081
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.

TTS 082 · Đáp án
Tải MP3 082

Q042 · MECHANISM / WHY · ADD V5

TTS 083 · Q: What is the difference between a dirty read and a non-repeatable read?

TTS 083 · Câu hỏi
Tải MP3 083
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.

TTS 084 · Đáp án
Tải MP3 084

Q043 · FOUNDATION · ADD V5

TTS 085 · Q: What is a phantom read?

TTS 085 · Câu hỏi
Tải MP3 085
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.

TTS 086 · Đáp án
Tải MP3 086

04 — SQL, indexes, ACID và locking / tiểu mục 04.6

Q044 · MECHANISM / WHY · BASE V4

TTS 087 · Q: Why is a transaction not always enough to prevent overselling?

TTS 087 · Câu hỏi
Tải MP3 087
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.

TTS 088 · Đáp án
Tải MP3 088

Q045 · MECHANISM / WHY · ADD V5

TTS 089 · Q: What is the difference between optimistic and pessimistic locking?

TTS 089 · Câu hỏi
Tải MP3 089
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.

TTS 090 · Đáp án
Tải MP3 090

Q046 · SCENARIO / FOLLOW-UP · BASE V4

TTS 091 · Q: How would you test a lost update with two requests?

TTS 091 · Câu hỏi
Tải MP3 091
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.

TTS 092 · Đáp án
Tải MP3 092

05 — HTTP request, timeout và retry

Q047 · MECHANISM / WHY · BASE V4

TTS 093 · Q: Walk me through an HTTPS request from browser to backend.

TTS 093 · Câu hỏi
Tải MP3 093
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.

TTS 094 · Đáp án
Tải MP3 094

Q048 · MECHANISM / WHY · BASE V4

TTS 095 · Q: What is the difference between HTTP 401 and 403?

TTS 095 · Câu hỏi
Tải MP3 095
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.

TTS 096 · Đáp án
Tải MP3 096

Q049 · FOUNDATION · BASE V4

TTS 097 · Q: Should a client automatically retry a booking POST after a timeout?

TTS 097 · Câu hỏi
Tải MP3 097
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.

TTS 098 · Đáp án
Tải MP3 098

Q050 · MECHANISM / WHY · ADD V5

TTS 099 · Q: What is the difference between GET and POST?

TTS 099 · Câu hỏi
Tải MP3 099
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.

TTS 100 · Đáp án
Tải MP3 100

Q051 · MECHANISM / WHY · ADD V5

TTS 101 · Q: What is the difference between PUT and PATCH?

TTS 101 · Câu hỏi
Tải MP3 101
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.

TTS 102 · Đáp án
Tải MP3 102

Q052 · FOUNDATION · ADD V5

TTS 103 · Q: What do HTTP 200, 201, and 204 mean?

TTS 103 · Câu hỏi
Tải MP3 103
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.

TTS 104 · Đáp án
Tải MP3 104

Q053 · FOUNDATION · ADD V5

TTS 105 · Q: What do HTTP 400, 404, 409, and 500 mean?

TTS 105 · Câu hỏi
Tải MP3 105
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.

TTS 106 · Đáp án
Tải MP3 106

Q054 · MECHANISM / WHY · ADD V5

TTS 107 · Q: What is the difference between a timeout and a connection refusal?

TTS 107 · Câu hỏi
Tải MP3 107
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.

TTS 108 · Đáp án
Tải MP3 108

Q055 · MECHANISM / WHY · ADD V5

TTS 109 · Q: Why is an idempotency key useful for a payment or booking API?

TTS 109 · Câu hỏi
Tải MP3 109
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.

TTS 110 · Đáp án
Tải MP3 110

Q056 · SCENARIO / FOLLOW-UP · BASE V4

TTS 111 · Q: What if the first response is lost after a successful commit?

TTS 111 · Câu hỏi
Tải MP3 111
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.

TTS 112 · Đáp án
Tải MP3 112

Q057 · SCENARIO / FOLLOW-UP · BASE V4

TTS 113 · Q: How would you expose the status of an uncertain operation?

TTS 113 · Câu hỏi
Tải MP3 113
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.

TTS 114 · Đáp án
Tải MP3 114

06 — Threads, shared state và race conditions

Q058 · MECHANISM / WHY · BASE V4

TTS 115 · Q: What is the difference between a process and a thread?

TTS 115 · Câu hỏi
Tải MP3 115
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.

TTS 116 · Đáp án
Tải MP3 116

Q059 · MECHANISM / WHY · BASE V4

TTS 117 · Q: Why can count++ lose increments under concurrent requests?

TTS 117 · Câu hỏi
Tải MP3 117
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.

TTS 118 · Đáp án
Tải MP3 118

Q060 · MECHANISM / WHY · BASE V4

TTS 119 · Q: Why might synchronized be insufficient in a multi-instance backend?

TTS 119 · Câu hỏi
Tải MP3 119
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.

TTS 120 · Đáp án
Tải MP3 120

Q061 · FOUNDATION · BASE V4

TTS 121 · Q: Does volatile make count++ atomic?

TTS 121 · Câu hỏi
Tải MP3 121
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.

TTS 122 · Đáp án
Tải MP3 122

Q062 · FOUNDATION · ADD V5

TTS 123 · Q: What is a race condition?

TTS 123 · Câu hỏi
Tải MP3 123
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.

TTS 124 · Đáp án
Tải MP3 124

Q063 · FOUNDATION · ADD V5

TTS 125 · Q: What is a deadlock?

TTS 125 · Câu hỏi
Tải MP3 125
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.

TTS 126 · Đáp án
Tải MP3 126

Q064 · MECHANISM / WHY · ADD V5

TTS 127 · Q: What is the difference between concurrency and parallelism?

TTS 127 · Câu hỏi
Tải MP3 127
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.

TTS 128 · Đáp án
Tải MP3 128

Q065 · MECHANISM / WHY · ADD V5

TTS 129 · Q: What is the difference between a thread's stack and the JVM heap?

TTS 129 · Câu hỏi
Tải MP3 129
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.

TTS 130 · Đáp án
Tải MP3 130

Q066 · MECHANISM / WHY · ADD V5

TTS 131 · Q: What is the difference between synchronized and ReentrantLock?

TTS 131 · Câu hỏi
Tải MP3 131
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.

TTS 132 · Đáp án
Tải MP3 132

Q067 · FOUNDATION · ADD V5

TTS 133 · Q: What can cause memory leaks in a Java application even with garbage collection?

TTS 133 · Câu hỏi
Tải MP3 133
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.

TTS 134 · Đáp án
Tải MP3 134

Q068 · SCENARIO / FOLLOW-UP · BASE V4

TTS 135 · Q: When would you choose an atomic SQL update over an in-memory lock?

TTS 135 · Câu hỏi
Tải MP3 135
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.

TTS 136 · Đáp án
Tải MP3 136

07 — Hotel Booking LLD + state machine

Q069 · FOUNDATION · BASE V4

TTS 137 · Q: Design a booking module where staff must approve requests.

TTS 137 · Câu hỏi
Tải MP3 137
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.

TTS 138 · Đáp án
Tải MP3 138

Q070 · MECHANISM / WHY · BASE V4

TTS 139 · Q: Should pending bookings hold inventory? What is the trade-off?

TTS 139 · Câu hỏi
Tải MP3 139
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.

TTS 140 · Đáp án
Tải MP3 140

Q071 · FOUNDATION · ADD V5

TTS 141 · Q: What is a state transition in a booking system?

TTS 141 · Câu hỏi
Tải MP3 141
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.

TTS 142 · Đáp án
Tải MP3 142

Q072 · SCENARIO / FOLLOW-UP · BASE V4

TTS 143 · Q: How do you handle two requests for the same room and night?

TTS 143 · Câu hỏi
Tải MP3 143
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.

TTS 144 · Đáp án
Tải MP3 144

Q073 · SCENARIO / FOLLOW-UP · BASE V4

TTS 145 · Q: What changes if a customer can cancel before check-in?

TTS 145 · Câu hỏi
Tải MP3 145
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.

TTS 146 · Đáp án
Tải MP3 146

Q074 · SCENARIO / FOLLOW-UP · BASE V4

TTS 147 · Q: What if a booking contains multiple nights and allocation fails halfway through?

TTS 147 · Câu hỏi
Tải MP3 147
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.

TTS 148 · Đáp án
Tải MP3 148

Q075 · SCENARIO / FOLLOW-UP · ADD V5

TTS 149 · Q: How would you prevent double booking for overlapping date ranges?

TTS 149 · Câu hỏi
Tải MP3 149
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.

TTS 150 · Đáp án
Tải MP3 150

Q076 · SCENARIO / FOLLOW-UP · ADD V5

TTS 151 · Q: What happens if an external hotel provider confirms a room but our database update fails?

TTS 151 · Câu hỏi
Tải MP3 151
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.

TTS 152 · Đáp án
Tải MP3 152

08 — Testing, Cloud, Security và DSA recap

Q077 · MECHANISM / WHY · BASE V4

TTS 153 · Q: How do unit tests differ from integration tests?

TTS 153 · Câu hỏi
Tải MP3 153
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.

TTS 154 · Đáp án
Tải MP3 154

Q078 · FOUNDATION · BASE V4

TTS 155 · Q: Does high test coverage guarantee there are no bugs?

TTS 155 · Câu hỏi
Tải MP3 155
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.

TTS 156 · Đáp án
Tải MP3 156

Q079 · MECHANISM / WHY · BASE V4

TTS 157 · Q: What is the difference between authentication and authorization?

TTS 157 · Câu hỏi
Tải MP3 157
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.

TTS 158 · Đáp án
Tải MP3 158

Q080 · FOUNDATION · ADD V5

TTS 159 · Q: What is mocking in unit testing?

TTS 159 · Câu hỏi
Tải MP3 159
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.

TTS 160 · Đáp án
Tải MP3 160

Q081 · MECHANISM / WHY · ADD V5

TTS 161 · Q: What is the difference between authentication and role-based authorization?

TTS 161 · Câu hỏi
Tải MP3 161
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.

TTS 162 · Đáp án
Tải MP3 162

Q082 · MECHANISM / WHY · ADD V5

TTS 163 · Q: What is the difference between symmetric and asymmetric encryption?

TTS 163 · Câu hỏi
Tải MP3 163
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.

TTS 164 · Đáp án
Tải MP3 164

Q083 · MECHANISM / WHY · ADD V5

TTS 165 · Q: What is the difference between a virtual machine and a container?

TTS 165 · Câu hỏi
Tải MP3 165
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.

TTS 166 · Đáp án
Tải MP3 166

Q084 · FOUNDATION · ADD V5

TTS 167 · Q: What does Big O notation describe?

TTS 167 · Câu hỏi
Tải MP3 167
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.

TTS 168 · Đáp án
Tải MP3 168

Q085 · MECHANISM / WHY · ADD V5

TTS 169 · Q: What is the difference between a stack and a queue?

TTS 169 · Câu hỏi
Tải MP3 169
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.

TTS 170 · Đáp án
Tải MP3 170

Q086 · MECHANISM / WHY · ADD V5

TTS 171 · Q: What is the difference between BFS and DFS?

TTS 171 · Câu hỏi
Tải MP3 171
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.

TTS 172 · Đáp án
Tải MP3 172

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)?

TTS 173 · Câu hỏi
Tải MP3 173
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.

TTS 174 · Đáp án
Tải MP3 174

Q088 · FOUNDATION · ADD V5

TTS 175 · Q: How can you prevent SQL injection in a Java backend?

TTS 175 · Câu hỏi
Tải MP3 175
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.

TTS 176 · Đáp án
Tải MP3 176

Q089 · SCENARIO / FOLLOW-UP · BASE V4

TTS 177 · Q: How would you test that only staff can approve a booking?

TTS 177 · Câu hỏi
Tải MP3 177
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.

TTS 178 · Đáp án
Tải MP3 178

Q090 · SCENARIO / FOLLOW-UP · BASE V4

TTS 179 · Q: An application is slow. Would you add more servers immediately?

TTS 179 · Câu hỏi
Tải MP3 179
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.

TTS 180 · Đáp án
Tải MP3 180

Q091 · SCENARIO / FOLLOW-UP · ADD V5

TTS 181 · Q: How would you explain the time complexity of binary search?

TTS 181 · Câu hỏi
Tải MP3 181
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.

TTS 182 · Đáp án
Tải MP3 182

08A — Java Core + OOP / tiểu mục 08A.1

Q092 · MECHANISM / WHY · BASE V4

TTS 183 · Q: Does static imply thread safety? Why not?

TTS 183 · Câu hỏi
Tải MP3 183
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.

TTS 184 · Đáp án
Tải MP3 184

Q093 · FOUNDATION · ADD V5

TTS 185 · Q: What does static mean, and does it imply thread safety?

TTS 185 · Câu hỏi
Tải MP3 185
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.

TTS 186 · Đáp án
Tải MP3 186

Q094 · MECHANISM / WHY · ADD V5

TTS 187 · Q: What happens when you invoke a static method through a superclass reference to a subclass object?

TTS 187 · Câu hỏi
Tải MP3 187
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.

TTS 188 · Đáp án
Tải MP3 188

Q095 · MECHANISM / WHY · ADD V5

TTS 189 · Q: What is the difference between final, finally, and finalize?

TTS 189 · Câu hỏi
Tải MP3 189
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.

TTS 190 · Đáp án
Tải MP3 190

08A — Java Core + OOP / tiểu mục 08A.2

Q096 · MECHANISM / WHY · BASE V4

TTS 191 · Q: What is the difference between == and equals for objects?

TTS 191 · Câu hỏi
Tải MP3 191
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.

TTS 192 · Đáp án
Tải MP3 192

Q097 · MECHANISM / WHY · BASE V4

TTS 193 · Q: Why can mutable HashMap keys cause problems?

TTS 193 · Câu hỏi
Tải MP3 193
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.

TTS 194 · Đáp án
Tải MP3 194

Q098 · MECHANISM / WHY · BASE V4

TTS 195 · Q: What does Java pass when you pass an object to a method?

TTS 195 · Câu hỏi
Tải MP3 195
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.

TTS 196 · Đáp án
Tải MP3 196

Q099 · MECHANISM / WHY · ADD V5

TTS 197 · Q: Why do HashMap keys need a stable hashCode and equals contract?

TTS 197 · Câu hỏi
Tải MP3 197
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.

TTS 198 · Đáp án
Tải MP3 198

Q100 · MECHANISM / WHY · ADD V5

TTS 199 · Q: Why doesn't changing a method's object parameter reference replace the caller's reference?

TTS 199 · Câu hỏi
Tải MP3 199
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.

TTS 200 · Đáp án
Tải MP3 200

Q101 · MECHANISM / WHY · ADD V5

TTS 201 · Q: What is the difference between String, StringBuilder, and StringBuffer?

TTS 201 · Câu hỏi
Tải MP3 201
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.

TTS 202 · Đáp án
Tải MP3 202

Q102 · MECHANISM / WHY · ADD V5

TTS 203 · Q: What is the difference between stack memory and heap memory in Java?

TTS 203 · Câu hỏi
Tải MP3 203
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.

TTS 204 · Đáp án
Tải MP3 204

Q103 · MECHANISM / WHY · ADD V5

TTS 205 · Q: What is the difference between equals and hashCode contracts?

TTS 205 · Câu hỏi
Tải MP3 205
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.

TTS 206 · Đáp án
Tải MP3 206

08A — Java Core + OOP / tiểu mục 08A.3

Q104 · MECHANISM / WHY · ADD V5

TTS 207 · Q: What's the difference between interface and abstract class?

TTS 207 · Câu hỏi
Tải MP3 207
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.

TTS 208 · Đáp án
Tải MP3 208

Q105 · MECHANISM / WHY · ADD V5

TTS 209 · Q: What's the difference between an overloaded and an overridden method?

TTS 209 · Câu hỏi
Tải MP3 209
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.

TTS 210 · Đáp án
Tải MP3 210

Q106 · FOUNDATION · ADD V5

TTS 211 · Q: What is encapsulation in object-oriented programming?

TTS 211 · Câu hỏi
Tải MP3 211
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.

TTS 212 · Đáp án
Tải MP3 212

Q107 · MECHANISM / WHY · ADD V5

TTS 213 · Q: What is inheritance, and when could composition be better?

TTS 213 · Câu hỏi
Tải MP3 213
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.

TTS 214 · Đáp án
Tải MP3 214

Q108 · FOUNDATION · ADD V5

TTS 215 · Q: What is polymorphism in Java?

TTS 215 · Câu hỏi
Tải MP3 215
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.

TTS 216 · Đáp án
Tải MP3 216

Q109 · FOUNDATION · ADD V5

TTS 217 · Q: What is abstraction in OOP?

TTS 217 · Câu hỏi
Tải MP3 217
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.

TTS 218 · Đáp án
Tải MP3 218

Q110 · SCENARIO / FOLLOW-UP · BASE V4

TTS 219 · Q: When would you use an interface rather than an abstract class?

TTS 219 · Câu hỏi
Tải MP3 219
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.

TTS 220 · Đáp án
Tải MP3 220

08A — Java Core + OOP / tiểu mục 08A.4

Q111 · FOUNDATION · ADD V5

TTS 221 · Q: Can garbage collection replace closing a database connection?

TTS 221 · Câu hỏi
Tải MP3 221
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.

TTS 222 · Đáp án
Tải MP3 222

Q112 · MECHANISM / WHY · ADD V5

TTS 223 · Q: What is the difference between checked and unchecked exceptions?

TTS 223 · Câu hỏi
Tải MP3 223
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.

TTS 224 · Đáp án
Tải MP3 224

Q113 · MECHANISM / WHY · ADD V5

TTS 225 · Q: What is the difference between List, Set, and Map?

TTS 225 · Câu hỏi
Tải MP3 225
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.

TTS 226 · Đáp án
Tải MP3 226

Q114 · MECHANISM / WHY · ADD V5

TTS 227 · Q: What is the difference between HashMap and ConcurrentHashMap?

TTS 227 · Câu hỏi
Tải MP3 227
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.

TTS 228 · Đáp án
Tải MP3 228

Q115 · MECHANISM / WHY · ADD V5

TTS 229 · Q: What is the difference between HashSet and TreeSet?

TTS 229 · Câu hỏi
Tải MP3 229
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.

TTS 230 · Đáp án
Tải MP3 230

Q116 · FOUNDATION · ADD V5

TTS 231 · Q: What is a generic type in Java?

TTS 231 · Câu hỏi
Tải MP3 231
Mở đáp án mẫu Q116 — sau khi tự trả lời

TTS 232 · A: Generics let me express type constraints, such as List, at compile time. They improve type safety and reduce casts. Java implements most generic type checks through type erasure.

TTS 232 · Đáp án
Tải MP3 232

Q117 · MECHANISM / WHY · ADD V5

TTS 233 · Q: What is the difference between Comparable and Comparator?

TTS 233 · Câu hỏi
Tải MP3 233
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.

TTS 234 · Đáp án
Tải MP3 234

Q118 · MECHANISM / WHY · ADD V5

TTS 235 · Q: What is the difference between map and filter in Java Streams?

TTS 235 · Câu hỏi
Tải MP3 235
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.

TTS 236 · Đáp án
Tải MP3 236

Q119 · SCENARIO / FOLLOW-UP · ADD V5

TTS 237 · Q: When would you choose ArrayList instead of LinkedList?

TTS 237 · Câu hỏi
Tải MP3 237
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.

TTS 238 · Đáp án
Tải MP3 238

Q120 · SCENARIO / FOLLOW-UP · ADD V5

TTS 239 · Q: When would you use Optional rather than returning null?

TTS 239 · Câu hỏi
Tải MP3 239
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. I would not automatically use Optional for every field or parameter.

TTS 240 · Đáp án
Tải MP3 240

08A — Java Core + OOP / tiểu mục 08A.5

Q121 · SCENARIO / FOLLOW-UP · ADD V5

TTS 241 · Q: Two requests increment a shared counter. What can go wrong?

TTS 241 · Câu hỏi
Tải MP3 241
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.

TTS 242 · Đáp án
Tải MP3 242

08B — Spring Boot + JPA/Hibernate / tiểu mục 08B.1

Q122 · MECHANISM / WHY · ADD V5

TTS 243 · Q: What is the difference between Spring and Spring Boot?

TTS 243 · Câu hỏi
Tải MP3 243
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.

TTS 244 · Đáp án
Tải MP3 244

Q123 · MECHANISM / WHY · ADD V5

TTS 245 · Q: What is a bean, and how does constructor injection work?

TTS 245 · Câu hỏi
Tải MP3 245
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.

TTS 246 · Đáp án
Tải MP3 246

Q124 · MECHANISM / WHY · ADD V5

TTS 247 · Q: What's the difference between @Component, @Service, and @Repository?

TTS 247 · Câu hỏi
Tải MP3 247
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.

TTS 248 · Đáp án
Tải MP3 248

Q125 · FOUNDATION · ADD V5

TTS 249 · Q: What is inversion of control in Spring?

TTS 249 · Câu hỏi
Tải MP3 249
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.

TTS 250 · Đáp án
Tải MP3 250

Q126 · MECHANISM / WHY · ADD V5

TTS 251 · Q: Why is constructor injection often preferred over field injection?

TTS 251 · Câu hỏi
Tải MP3 251
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.

TTS 252 · Đáp án
Tải MP3 252

Q127 · FOUNDATION · ADD V5

TTS 253 · Q: What is Spring Boot auto-configuration?

TTS 253 · Câu hỏi
Tải MP3 253
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.

TTS 254 · Đáp án
Tải MP3 254

Q128 · SCENARIO / FOLLOW-UP · ADD V5

TTS 255 · Q: What happens if two beans have the same type?

TTS 255 · Câu hỏi
Tải MP3 255
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.

TTS 256 · Đáp án
Tải MP3 256

08B — Spring Boot + JPA/Hibernate / tiểu mục 08B.2

Q129 · MECHANISM / WHY · BASE V4

TTS 257 · Q: Walk me through Controller → Service → Repository in Spring Boot.

TTS 257 · Câu hỏi
Tải MP3 257
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.

TTS 258 · Đáp án
Tải MP3 258

Q130 · FOUNDATION · BASE V4

TTS 259 · Q: Can @Valid enforce uniqueness across concurrent requests?

TTS 259 · Câu hỏi
Tải MP3 259
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.

TTS 260 · Đáp án
Tải MP3 260

Q131 · FOUNDATION · ADD V5

TTS 261 · Q: Can @Valid prevent two users from registering the same email concurrently?

TTS 261 · Câu hỏi
Tải MP3 261
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.

TTS 262 · Đáp án
Tải MP3 262

Q132 · FOUNDATION · ADD V5

TTS 263 · Q: What does @RestController do?

TTS 263 · Câu hỏi
Tải MP3 263
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.

TTS 264 · Đáp án
Tải MP3 264

Q133 · MECHANISM / WHY · ADD V5

TTS 265 · Q: What is the difference between @RequestParam, @PathVariable, and @RequestBody?

TTS 265 · Câu hỏi
Tải MP3 265
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.

TTS 266 · Đáp án
Tải MP3 266

Q134 · MECHANISM / WHY · ADD V5

TTS 267 · Q: How does validation work with @Valid in a Spring controller?

TTS 267 · Câu hỏi
Tải MP3 267
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.

TTS 268 · Đáp án
Tải MP3 268

Q135 · SCENARIO / FOLLOW-UP · ADD V5

TTS 269 · Q: How would you secure a Spring REST endpoint?

TTS 269 · Câu hỏi
Tải MP3 269
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.

TTS 270 · Đáp án
Tải MP3 270

08B — Spring Boot + JPA/Hibernate / tiểu mục 08B.3

Q136 · MECHANISM / WHY · BASE V4

TTS 271 · Q: What is the difference between flush and commit in JPA?

TTS 271 · Câu hỏi
Tải MP3 271
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.

TTS 272 · Đáp án
Tải MP3 272

Q137 · MECHANISM / WHY · BASE V4

TTS 273 · Q: Why can an ORM loop cause an N+1 query problem?

TTS 273 · Câu hỏi
Tải MP3 273
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.

TTS 274 · Đáp án
Tải MP3 274

Q138 · MECHANISM / WHY · ADD V5

TTS 275 · Q: What is the difference between JPA and Hibernate?

TTS 275 · Câu hỏi
Tải MP3 275
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.

TTS 276 · Đáp án
Tải MP3 276

Q139 · MECHANISM / WHY · ADD V5

TTS 277 · Q: What happens when you modify a managed JPA entity inside a transaction?

TTS 277 · Câu hỏi
Tải MP3 277
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.

TTS 278 · Đáp án
Tải MP3 278

Q140 · MECHANISM / WHY · ADD V5

TTS 279 · Q: What is lazy loading, and when can it fail?

TTS 279 · Câu hỏi
Tải MP3 279
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.

TTS 280 · Đáp án
Tải MP3 280

Q141 · MECHANISM / WHY · ADD V5

TTS 281 · Q: What is the difference between a JPA entity and a DTO?

TTS 281 · Câu hỏi
Tải MP3 281
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.

TTS 282 · Đáp án
Tải MP3 282

Q142 · FOUNDATION · ADD V5

TTS 283 · Q: What is the persistence context in JPA?

TTS 283 · Câu hỏi
Tải MP3 283
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.

TTS 284 · Đáp án
Tải MP3 284

Q143 · MECHANISM / WHY · ADD V5

TTS 285 · Q: What is the difference between persist and merge in JPA?

TTS 285 · Câu hỏi
Tải MP3 285
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.

TTS 286 · Đáp án
Tải MP3 286

Q144 · MECHANISM / WHY · ADD V5

TTS 287 · Q: What is the difference between LAZY and EAGER fetching?

TTS 287 · Câu hỏi
Tải MP3 287
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.

TTS 288 · Đáp án
Tải MP3 288

Q145 · SCENARIO / FOLLOW-UP · ADD V5

TTS 289 · Q: When would you use a fetch join or an EntityGraph?

TTS 289 · Câu hỏi
Tải MP3 289
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.

TTS 290 · Đáp án
Tải MP3 290

08B — Spring Boot + JPA/Hibernate / tiểu mục 08B.4

Q146 · FOUNDATION · BASE V4

TTS 291 · Q: Does @Transactional automatically prevent all inventory races?

TTS 291 · Câu hỏi
Tải MP3 291
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.

TTS 292 · Đáp án
Tải MP3 292

Q147 · FOUNDATION · ADD V5

TTS 293 · Q: What is the default rollback behavior of @Transactional?

TTS 293 · Câu hỏi
Tải MP3 293
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.

TTS 294 · Đáp án
Tải MP3 294

Q148 · SCENARIO / FOLLOW-UP · ADD V5

TTS 295 · Q: Does @Transactional guarantee that two requests won't oversell inventory?

TTS 295 · Câu hỏi
Tải MP3 295
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.

TTS 296 · Đáp án
Tải MP3 296

Q149 · SCENARIO / FOLLOW-UP · ADD V5

TTS 297 · Q: Why might @Transactional not work on a method called from within the same class?

TTS 297 · Câu hỏi
Tải MP3 297
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.

TTS 298 · Đáp án
Tải MP3 298

08B — Spring Boot + JPA/Hibernate / tiểu mục 08B.5

Q150 · SCENARIO / FOLLOW-UP · ADD V5

TTS 299 · Q: What is the N+1 query problem and how would you detect it?

TTS 299 · Câu hỏi
Tải MP3 299
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.

TTS 300 · Đáp án
Tải MP3 300

Q151 · SCENARIO / FOLLOW-UP · ADD V5

TTS 301 · Q: How would you test a service that uses DB transactions and external APIs?

TTS 301 · Câu hỏi
Tải MP3 301
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.

TTS 302 · Đáp án
Tải MP3 302

08C — Java + SQL + English integrated case

Q152 · MECHANISM / WHY · BASE V4

TTS 303 · Q: Explain the main bug you found in the LAB 08C code.

TTS 303 · Câu hỏi
Tải MP3 303
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.

TTS 304 · Đáp án
Tải MP3 304

Q153 · FOUNDATION · BASE V4

TTS 305 · Q: What SQL query or constraint would support your fix?

TTS 305 · Câu hỏi
Tải MP3 305
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.

TTS 306 · Đáp án
Tải MP3 306

Q154 · FOUNDATION · BASE V4

TTS 307 · Q: Which part of your fix is guaranteed by a database transaction, and which part is not?

TTS 307 · Câu hỏi
Tải MP3 307
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.

TTS 308 · Đáp án
Tải MP3 308

Q155 · MECHANISM / WHY · ADD V5

TTS 309 · Q: How do you explain a concurrent inventory bug in one minute?

TTS 309 · Câu hỏi
Tải MP3 309
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.

TTS 310 · Đáp án
Tải MP3 310

Q156 · FOUNDATION · ADD V5

TTS 311 · Q: What should a database integration test assert after two simultaneous bookings?

TTS 311 · Câu hỏi
Tải MP3 311
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.

TTS 312 · Đáp án
Tải MP3 312

Q157 · SCENARIO / FOLLOW-UP · BASE V4

TTS 313 · Q: How would you explain the solution to a teammate in under one minute?

TTS 313 · Câu hỏi
Tải MP3 313
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.

TTS 314 · Đáp án
Tải MP3 314

Q158 · SCENARIO / FOLLOW-UP · BASE V4

TTS 315 · Q: What happens if a retry arrives with the same operation ID?

TTS 315 · Câu hỏi
Tải MP3 315
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.

TTS 316 · Đáp án
Tải MP3 316

CASE LAB — V-Market

Q159 · P0 · PROJECT-SPECIFIC V5.1

TTS 317 · Q: What problem does V-Market solve?

TTS 317 · Câu hỏi
Tải MP3 317
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.

TTS 318 · Đáp án
Tải MP3 318

Q160 · P0 · PROJECT-SPECIFIC V5.1

TTS 319 · Q: Walk me through a V-Market checkout request.

TTS 319 · Câu hỏi
Tải MP3 319
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.

TTS 320 · Đáp án
Tải MP3 320

Q161 · P0 · PROJECT-SPECIFIC V5.1

TTS 321 · Q: Two customers each buy twenty items when only twenty-seven are in stock. What happens?

TTS 321 · Câu hỏi
Tải MP3 321
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.

TTS 322 · Đáp án
Tải MP3 322

Q162 · P0 · PROJECT-SPECIFIC V5.1

TTS 323 · Q: Why does V-Market need both an operation-key lock and stock locks?

TTS 323 · Câu hỏi
Tải MP3 323
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.

TTS 324 · Đáp án
Tải MP3 324

Q163 · P0 · PROJECT-SPECIFIC V5.1

TTS 325 · Q: How does V-Market handle a repeated checkout with the same key?

TTS 325 · Câu hỏi
Tải MP3 325
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.

TTS 326 · Đáp án
Tải MP3 326

Q164 · P0 · PROJECT-SPECIFIC V5.1

TTS 327 · Q: The client times out after checkout. Should it create a new request key?

TTS 327 · Câu hỏi
Tải MP3 327
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.

TTS 328 · Đáp án
Tải MP3 328

Q165 · P0 · PROJECT-SPECIFIC V5.1

TTS 329 · Q: Why does V-Market use Redis, and can the cache cause overselling?

TTS 329 · Câu hỏi
Tải MP3 329
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.

TTS 330 · Đáp án
Tải MP3 330

Q166 · P0 · PROJECT-SPECIFIC V5.1

TTS 331 · Q: What happens if a database error occurs while creating an order?

TTS 331 · Câu hỏi
Tải MP3 331
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.

TTS 332 · Đáp án
Tải MP3 332

Q167 · P0 · PROJECT-SPECIFIC V5.1

TTS 333 · Q: What evidence and limitations can you discuss for V-Market?

TTS 333 · Câu hỏi
Tải MP3 333
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.

TTS 334 · Đáp án
Tải MP3 334

Q168 · P1 · PROJECT-SPECIFIC V5.1

TTS 335 · Q: How does V-Market validate Japanese legacy CSV imports?

TTS 335 · Câu hỏi
Tải MP3 335
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.

TTS 336 · Đáp án
Tải MP3 336

Q169 · P1 · PROJECT-SPECIFIC V5.1

TTS 337 · Q: Why can't an old CSV stock snapshot restore inventory that has already been sold?

TTS 337 · Câu hỏi
Tải MP3 337
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.

TTS 338 · Đáp án
Tải MP3 338

CASE LAB — V-Core

Q170 · P0 · PROJECT-SPECIFIC V5.1

TTS 339 · Q: What problem does V-Core solve?

TTS 339 · Câu hỏi
Tải MP3 339
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.

TTS 340 · Đáp án
Tải MP3 340

Q171 · P0 · PROJECT-SPECIFIC V5.1

TTS 341 · Q: Walk me through a task move in V-Core.

TTS 341 · Câu hỏi
Tải MP3 341
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.

TTS 342 · Đáp án
Tải MP3 342

Q172 · P0 · PROJECT-SPECIFIC V5.1

TTS 343 · Q: Why does V-Core use both a column lock and a task version?

TTS 343 · Câu hỏi
Tải MP3 343
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.

TTS 344 · Đáp án
Tải MP3 344

Q173 · P0 · PROJECT-SPECIFIC V5.1

TTS 345 · Q: Two users move tasks into the last free slot. How does V-Core prevent overflow?

TTS 345 · Câu hỏi
Tải MP3 345
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.

TTS 346 · Đáp án
Tải MP3 346

Q174 · P0 · PROJECT-SPECIFIC V5.1

TTS 347 · Q: What does V-Core do when the same task move request is retried?

TTS 347 · Câu hỏi
Tải MP3 347
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.

TTS 348 · Đáp án
Tải MP3 348

Q175 · P0 · PROJECT-SPECIFIC V5.1

TTS 349 · Q: What does the task-move transaction guarantee, and what does it not guarantee?

TTS 349 · Câu hỏi
Tải MP3 349
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.

TTS 350 · Đáp án
Tải MP3 350

Q176 · P0 · PROJECT-SPECIFIC V5.1

TTS 351 · Q: How does V-Core prevent a user from changing tasks in another workspace?

TTS 351 · Câu hỏi
Tải MP3 351
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.

TTS 352 · Đáp án
Tải MP3 352

Q177 · P0 · PROJECT-SPECIFIC V5.1

TTS 353 · Q: How would you verify V-Core's WIP concurrency rule?

TTS 353 · Câu hỏi
Tải MP3 353
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.

TTS 354 · Đáp án
Tải MP3 354

Q178 · P1 · PROJECT-SPECIFIC V5.1

TTS 355 · Q: What is the purpose of SSE in V-Core, and is delivery guaranteed?

TTS 355 · Câu hỏi
Tải MP3 355
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.

TTS 356 · Đáp án
Tải MP3 356

Q179 · P1 · PROJECT-SPECIFIC V5.1

TTS 357 · Q: What happens to an existing SSE stream when a user's access is revoked?

TTS 357 · Câu hỏi
Tải MP3 357
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.

TTS 358 · Đáp án
Tải MP3 358

Q180 · P1 · PROJECT-SPECIFIC V5.1

TTS 359 · Q: Can an administrator lower a WIP limit below the current task count?

TTS 359 · Câu hỏi
Tải MP3 359
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.

TTS 360 · Đáp án
Tải MP3 360

09 — Basic System Design

Q181 · FOUNDATION · BASE V4

TTS 361 · Q: Design a simple booking service for an MVP.

TTS 361 · Câu hỏi
Tải MP3 361
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.

TTS 362 · Đáp án
Tải MP3 362

Q182 · MECHANISM / WHY · BASE V4

TTS 363 · Q: When might you add Redis caching, and what should not rely on a stale cache?

TTS 363 · Câu hỏi
Tải MP3 363
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.

TTS 364 · Đáp án
Tải MP3 364

Q183 · FOUNDATION · ADD V5

TTS 365 · Q: What is a load balancer?

TTS 365 · Câu hỏi
Tải MP3 365
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.

TTS 366 · Đáp án
Tải MP3 366

Q184 · FOUNDATION · ADD V5

TTS 367 · Q: What is eventual consistency?

TTS 367 · Câu hỏi
Tải MP3 367
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.

TTS 368 · Đáp án
Tải MP3 368

Q185 · SCENARIO / FOLLOW-UP · BASE V4

TTS 369 · Q: Why would you choose a modular monolith before microservices?

TTS 369 · Câu hỏi
Tải MP3 369
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.

TTS 370 · Đáp án
Tải MP3 370

Q186 · SCENARIO / FOLLOW-UP · BASE V4

TTS 371 · Q: What changes if an external provider is frequently slow?

TTS 371 · Câu hỏi
Tải MP3 371
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.

TTS 372 · Đáp án
Tải MP3 372

Q187 · SCENARIO / FOLLOW-UP · BASE V4

TTS 373 · Q: How would you measure whether scaling actually helped?

TTS 373 · Câu hỏi
Tải MP3 373
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.

TTS 374 · Đáp án
Tải MP3 374

B — Debugging và external integration

Q188 · FOUNDATION · BASE V4

TTS 375 · Q: Which evidence would tell you that a retry is safe?

TTS 375 · Câu hỏi
Tải MP3 375
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.

TTS 376 · Đáp án
Tải MP3 376

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?

TTS 377 · Câu hỏi
Tải MP3 377
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.

TTS 378 · Đáp án
Tải MP3 378

Q190 · SCENARIO / FOLLOW-UP · BASE V4

TTS 379 · Q: How would you investigate duplicate product imports?

TTS 379 · Câu hỏi
Tải MP3 379
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.

TTS 380 · Đáp án
Tải MP3 380

Q191 · SCENARIO / FOLLOW-UP · BASE V4

TTS 381 · Q: What if logs show the same request ID twice?

TTS 381 · Câu hỏi
Tải MP3 381
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.

TTS 382 · Đáp án
Tải MP3 382

Q192 · SCENARIO / FOLLOW-UP · BASE V4

TTS 383 · Q: How would you design a regression test for the root cause?

TTS 383 · Câu hỏi
Tải MP3 383
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.

TTS 384 · Đáp án
Tải MP3 384

Q193 · SCENARIO / FOLLOW-UP · ADD V5

TTS 385 · Q: How would you trace an HTTP request across multiple services?

TTS 385 · Câu hỏi
Tải MP3 385
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.

TTS 386 · Đáp án
Tải MP3 386

Q194 · SCENARIO / FOLLOW-UP · ADD V5

TTS 387 · Q: What would you do if an external API returned an unfamiliar error?

TTS 387 · Câu hỏi
Tải MP3 387
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.

TTS 388 · Đáp án
Tải MP3 388

Q195 · SCENARIO / FOLLOW-UP · ADD V5

TTS 389 · Q: How would you prevent duplicate records during a CSV import?

TTS 389 · Câu hỏi
Tải MP3 389
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.

TTS 390 · Đáp án
Tải MP3 390

CASE LAB — V-Pulse

Q196 · P0 · PROJECT-SPECIFIC V5.1

TTS 391 · Q: What is V-Pulse, and does it connect to real banks?

TTS 391 · Câu hỏi
Tải MP3 391
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.

TTS 392 · Đáp án
Tải MP3 392

Q197 · P0 · PROJECT-SPECIFIC V5.1

TTS 393 · Q: Walk me through creating a payment instruction in V-Pulse.

TTS 393 · Câu hỏi
Tải MP3 393
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.

TTS 394 · Đáp án
Tải MP3 394

Q198 · P0 · PROJECT-SPECIFIC V5.1

TTS 395 · Q: Does a gateway timeout mean that the payment failed?

TTS 395 · Câu hỏi
Tải MP3 395
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.

TTS 396 · Đáp án
Tải MP3 396

Q199 · P0 · PROJECT-SPECIFIC V5.1

TTS 397 · Q: What is the difference between duplicate create and replaying a payment attempt?

TTS 397 · Câu hỏi
Tải MP3 397
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.

TTS 398 · Đáp án
Tải MP3 398

Q200 · P0 · PROJECT-SPECIFIC V5.1

TTS 399 · Q: When is a parked instruction allowed to replay in V-Pulse?

TTS 399 · Câu hỏi
Tải MP3 399
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.

TTS 400 · Đáp án
Tải MP3 400

Q201 · P0 · PROJECT-SPECIFIC V5.1

TTS 401 · Q: Explain timeout, circuit breaker, bulkhead, and rate limit in V-Pulse.

TTS 401 · Câu hỏi
Tải MP3 401
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.

TTS 402 · Đáp án
Tải MP3 402

Q202 · P0 · PROJECT-SPECIFIC V5.1

TTS 403 · Q: Why does V-Pulse call the gateway outside its database transaction?

TTS 403 · Câu hỏi
Tải MP3 403
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.

TTS 404 · Đáp án
Tải MP3 404

Q203 · P0 · PROJECT-SPECIFIC V5.1

TTS 405 · Q: How would you test V-Pulse's timeout and retry behavior?

TTS 405 · Câu hỏi
Tải MP3 405
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.

TTS 406 · Đáp án
Tải MP3 406

Q204 · P0 · PROJECT-SPECIFIC V5.1

TTS 407 · Q: What are the most important limitations of V-Pulse?

TTS 407 · Câu hỏi
Tải MP3 407
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.

TTS 408 · Đáp án
Tải MP3 408

Q205 · P1 · PROJECT-SPECIFIC V5.1

TTS 409 · Q: What happens if an old gateway result arrives after recovery?

TTS 409 · Câu hỏi
Tải MP3 409
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.

TTS 410 · Đáp án
Tải MP3 410

Q206 · P1 · PROJECT-SPECIFIC V5.1

TTS 411 · Q: What happens when Redis rate limiting fails in V-Pulse?

TTS 411 · Câu hỏi
Tải MP3 411
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.

TTS 412 · Đáp án
Tải MP3 412

10 — FDE discovery và problem decomposition

Q207 · FOUNDATION · BASE V4

TTS 413 · Q: What makes an acceptance criterion testable?

TTS 413 · Câu hỏi
Tải MP3 413
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.

TTS 414 · Đáp án
Tải MP3 414

Q208 · MECHANISM / WHY · ADD V5

TTS 415 · Q: What is the difference between a business outcome and a technical output?

TTS 415 · Câu hỏi
Tải MP3 415
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.

TTS 416 · Đáp án
Tải MP3 416

Q209 · SCENARIO / FOLLOW-UP · BASE V4

TTS 417 · Q: A customer says their booking system is slow. What do you ask first?

TTS 417 · Câu hỏi
Tải MP3 417
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.

TTS 418 · Đáp án
Tải MP3 418

Q210 · SCENARIO / FOLLOW-UP · BASE V4

TTS 419 · Q: How would you distinguish symptoms from actual business goals?

TTS 419 · Câu hỏi
Tải MP3 419
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.

TTS 420 · Đáp án
Tải MP3 420

Q211 · SCENARIO / FOLLOW-UP · BASE V4

TTS 421 · Q: What if the customer wants to automate everything in the first release?

TTS 421 · Câu hỏi
Tải MP3 421
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.

TTS 422 · Đáp án
Tải MP3 422

Q212 · SCENARIO / FOLLOW-UP · BASE V4

TTS 423 · Q: How would you respond if the assumed root cause is disproved?

TTS 423 · Câu hỏi
Tải MP3 423
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.

TTS 424 · Đáp án
Tải MP3 424

Q213 · SCENARIO / FOLLOW-UP · ADD V5

TTS 425 · Q: How would you start a discovery meeting with a nontechnical client?

TTS 425 · Câu hỏi
Tải MP3 425
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.

TTS 426 · Đáp án
Tải MP3 426

Q214 · SCENARIO / FOLLOW-UP · ADD V5

TTS 427 · Q: How would you define acceptance criteria for a small MVP?

TTS 427 · Câu hỏi
Tải MP3 427
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.

TTS 428 · Đáp án
Tải MP3 428

C — FDE cold cases + changing requirements

Q215 · MECHANISM / WHY · BASE V4

TTS 429 · Q: Choose one cold case from LAB C and explain your first three discovery questions.

TTS 429 · Câu hỏi
Tải MP3 429
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.

TTS 430 · Đáp án
Tải MP3 430

Q216 · MECHANISM / WHY · BASE V4

TTS 431 · Q: How do you decide what belongs in an MVP?

TTS 431 · Câu hỏi
Tải MP3 431
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.

TTS 432 · Đáp án
Tải MP3 432

Q217 · FOUNDATION · BASE V4

TTS 433 · Q: What is your fallback if the customer data source is unavailable?

TTS 433 · Câu hỏi
Tải MP3 433
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.

TTS 434 · Đáp án
Tải MP3 434

Q218 · FOUNDATION · BASE V4

TTS 435 · Q: Which metric would show business value after deployment?

TTS 435 · Câu hỏi
Tải MP3 435
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.

TTS 436 · Đáp án
Tải MP3 436

Q219 · SCENARIO / FOLLOW-UP · BASE V4

TTS 437 · Q: The interviewer changes one business rule. How do you update the design?

TTS 437 · Câu hỏi
Tải MP3 437
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.

TTS 438 · Đáp án
Tải MP3 438

Q220 · SCENARIO / FOLLOW-UP · ADD V5

TTS 439 · Q: The customer changes the source of truth during the interview. What do you do?

TTS 439 · Câu hỏi
Tải MP3 439
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.

TTS 440 · Đáp án
Tải MP3 440

Q221 · SCENARIO / FOLLOW-UP · ADD V5

TTS 441 · Q: What if the customer needs a working demo next week?

TTS 441 · Câu hỏi
Tải MP3 441
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.

TTS 442 · Đáp án
Tải MP3 442

Q222 · SCENARIO / FOLLOW-UP · ADD V5

TTS 443 · Q: How would you prioritize two competing customer requests?

TTS 443 · Câu hỏi
Tải MP3 443
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.

TTS 444 · Đáp án
Tải MP3 444

11 — Technical English, project story, DSA explanation

Q223 · PROJECT TEMPLATE · BASE V4

TTS 445 · Q: Tell me about one backend project in 60 seconds.

TTS 445 · Câu hỏi
Tải MP3 445

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.

TTS 446 · Đáp án
Tải MP3 446

Q224 · MECHANISM / WHY · BASE V4

TTS 447 · Q: Explain one bug and how you verified the fix.

TTS 447 · Câu hỏi
Tải MP3 447
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.

TTS 448 · Đáp án
Tải MP3 448

Q225 · MECHANISM / WHY · BASE V4

TTS 449 · Q: Walk me through one DSA solution and its time complexity.

TTS 449 · Câu hỏi
Tải MP3 449
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.

TTS 450 · Đáp án
Tải MP3 450

Q226 · PROJECT TEMPLATE · BASE V4

TTS 451 · Q: Which parts did you personally implement?

TTS 451 · Câu hỏi
Tải MP3 451

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.

TTS 452 · Đáp án
Tải MP3 452

Q227 · PROJECT TEMPLATE · ADD V5

TTS 453 · Q: What problem does your project solve?

TTS 453 · Câu hỏi
Tải MP3 453

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.

TTS 454 · Đáp án
Tải MP3 454

Q228 · PROJECT TEMPLATE · ADD V5

TTS 455 · Q: How can you prove which parts you personally implemented?

TTS 455 · Câu hỏi
Tải MP3 455

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.

TTS 456 · Đáp án
Tải MP3 456

Q229 · PROJECT TEMPLATE · ADD V5

TTS 457 · Q: Walk me through one important request from UI to database.

TTS 457 · Câu hỏi
Tải MP3 457

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.

TTS 458 · Đáp án
Tải MP3 458

Q230 · PROJECT TEMPLATE · ADD V5

TTS 459 · Q: Why did you choose this database/cache/framework?

TTS 459 · Câu hỏi
Tải MP3 459

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.

TTS 460 · Đáp án
Tải MP3 460

Q231 · PROJECT TEMPLATE · ADD V5

TTS 461 · Q: What happens if an external API times out?

TTS 461 · Câu hỏi
Tải MP3 461

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.

TTS 462 · Đáp án
Tải MP3 462

Q232 · PROJECT TEMPLATE · ADD V5

TTS 463 · Q: How do you protect against duplicate or concurrent operations?

TTS 463 · Câu hỏi
Tải MP3 463

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.

TTS 464 · Đáp án
Tải MP3 464

Q233 · PROJECT TEMPLATE · ADD V5

TTS 465 · Q: What is one difficult bug you encountered? How did you debug it?

TTS 465 · Câu hỏi
Tải MP3 465

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.

TTS 466 · Đáp án
Tải MP3 466

Q234 · PROJECT TEMPLATE · ADD V5

TTS 467 · Q: If you were to build it again, what would you improve?

TTS 467 · Câu hỏi
Tải MP3 467

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.

TTS 468 · Đáp án
Tải MP3 468

Q235 · SCENARIO / FOLLOW-UP · BASE V4

TTS 469 · Q: If you had one more week, what would you improve and why?

TTS 469 · Câu hỏi
Tải MP3 469
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.

TTS 470 · Đáp án
Tải MP3 470

Q236 · SCENARIO / FOLLOW-UP · ADD V5

TTS 471 · Q: How would you explain Two Sum and its time complexity?

TTS 471 · Câu hỏi
Tải MP3 471
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.

TTS 472 · Đáp án
Tải MP3 472

CASE LAB — Cross-project

Q237 · P0 · CROSS-PROJECT V5.1

TTS 473 · Q: How is the concurrency problem different in V-Market and V-Core?

TTS 473 · Câu hỏi
Tải MP3 473
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.

TTS 474 · Đáp án
Tải MP3 474

Q238 · P0 · CROSS-PROJECT V5.1

TTS 475 · Q: How are retries different between V-Market checkout and V-Pulse payment attempts?

TTS 475 · Câu hỏi
Tải MP3 475
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.

TTS 476 · Đáp án
Tải MP3 476

Q239 · P0 · CROSS-PROJECT V5.1

TTS 477 · Q: Which project would you discuss for Java Backend concurrency versus FDE integration?

TTS 477 · Câu hỏi
Tải MP3 477
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.

TTS 478 · Đáp án
Tải MP3 478

D — Listening blind + unfamiliar Java + on-the-job learning

Q240 · MECHANISM / WHY · BASE V4

TTS 479 · Q: Look at a Java method you have never seen. How do you understand it?

TTS 479 · Câu hỏi
Tải MP3 479
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.

TTS 480 · Đáp án
Tải MP3 480

Q241 · MECHANISM / WHY · BASE V4

TTS 481 · Q: How do you distinguish a missing requirement from a bug?

TTS 481 · Câu hỏi
Tải MP3 481
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.

TTS 482 · Đáp án
Tải MP3 482

Q242 · SCENARIO / FOLLOW-UP · BASE V4

TTS 483 · Q: What would you ask before integrating an unfamiliar API?

TTS 483 · Câu hỏi
Tải MP3 483
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.

TTS 484 · Đáp án
Tải MP3 484

Q243 · SCENARIO / FOLLOW-UP · BASE V4

TTS 485 · Q: What if the API documentation contradicts actual behavior?

TTS 485 · Câu hỏi
Tải MP3 485
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.

TTS 486 · Đáp án
Tải MP3 486

Q244 · SCENARIO / FOLLOW-UP · BASE V4

TTS 487 · Q: What test would you write before refactoring the method?

TTS 487 · Câu hỏi
Tải MP3 487
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.

TTS 488 · Đáp án
Tải MP3 488

Q245 · SCENARIO / FOLLOW-UP · ADD V5

TTS 489 · Q: The interviewer speaks too quickly. What would you say?

TTS 489 · Câu hỏi
Tải MP3 489
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.

TTS 490 · Đáp án
Tải MP3 490

Q246 · SCENARIO / FOLLOW-UP · ADD V5

TTS 491 · Q: How would you explain unfamiliar Java code before changing it?

TTS 491 · Câu hỏi
Tải MP3 491
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.

TTS 492 · Đáp án
Tải MP3 492

Q247 · SCENARIO / FOLLOW-UP · ADD V5

TTS 493 · Q: How would you learn a new backend library for an urgent task?

TTS 493 · Câu hỏi
Tải MP3 493
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.

TTS 494 · Đáp án
Tải MP3 494

12 — Integrated design cases

Q248 · MECHANISM / WHY · BASE V4

TTS 495 · Q: Choose one integrated case: explain your assumptions and design.

TTS 495 · Câu hỏi
Tải MP3 495
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.

TTS 496 · Đáp án
Tải MP3 496

Q249 · FOUNDATION · BASE V4

TTS 497 · Q: Which business invariant is most important in your solution?

TTS 497 · Câu hỏi
Tải MP3 497
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.

TTS 498 · Đáp án
Tải MP3 498

Q250 · SCENARIO / FOLLOW-UP · BASE V4

TTS 499 · Q: What would you change if the interviewer added an external system?

TTS 499 · Câu hỏi
Tải MP3 499
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.

TTS 500 · Đáp án
Tải MP3 500

Q251 · SCENARIO / FOLLOW-UP · BASE V4

TTS 501 · Q: Where would you enforce data consistency?

TTS 501 · Câu hỏi
Tải MP3 501
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.

TTS 502 · Đáp án
Tải MP3 502

Q252 · SCENARIO / FOLLOW-UP · BASE V4

TTS 503 · Q: How would you show the solution works without claiming zero bugs?

TTS 503 · Câu hỏi
Tải MP3 503
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.

TTS 504 · Đáp án
Tải MP3 504

Q253 · SCENARIO / FOLLOW-UP · ADD V5

TTS 505 · Q: How would you design a simple course enrollment API from scratch?

TTS 505 · Câu hỏi
Tải MP3 505
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.

TTS 506 · Đáp án
Tải MP3 506

Q254 · SCENARIO / FOLLOW-UP · ADD V5

TTS 507 · Q: What do you do if two services cannot commit atomically?

TTS 507 · Câu hỏi
Tải MP3 507
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.

TTS 508 · Đáp án
Tải MP3 508

13 — Mock interview + oral delivery

Q255 · MECHANISM / WHY · BASE V4

TTS 509 · Q: Explain a technical concept from a randomly selected module in 45 seconds.

TTS 509 · Câu hỏi
Tải MP3 509
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.

TTS 510 · Đáp án
Tải MP3 510

Q256 · MECHANISM / WHY · BASE V4

TTS 511 · Q: Defend a design choice and name one trade-off.

TTS 511 · Câu hỏi
Tải MP3 511
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.

TTS 512 · Đáp án
Tải MP3 512

Q257 · FOUNDATION · BASE V4

TTS 513 · Q: Handle one unexpected follow-up without looking at notes.

TTS 513 · Câu hỏi
Tải MP3 513
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.

TTS 514 · Đáp án
Tải MP3 514

Q258 · FOUNDATION · BASE V4

TTS 515 · Q: What evidence would change your decision?

TTS 515 · Câu hỏi
Tải MP3 515
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.

TTS 516 · Đáp án
Tải MP3 516

Q259 · MECHANISM / WHY · BASE V4

TTS 517 · Q: Could you explain the same answer in simpler English for a non-engineer?

TTS 517 · Câu hỏi
Tải MP3 517
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.

TTS 518 · Đáp án
Tải MP3 518

Q260 · SCENARIO / FOLLOW-UP · ADD V5

TTS 519 · Q: How would you answer a question whose assumptions are incomplete?

TTS 519 · Câu hỏi
Tải MP3 519
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.

TTS 520 · Đáp án
Tải MP3 520

Q261 · SCENARIO / FOLLOW-UP · ADD V5

TTS 521 · Q: How would you respond when an interviewer challenges your design choice?

TTS 521 · Câu hỏi
Tải MP3 521
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. ---

TTS 522 · Đáp án
Tải MP3 522