CS FundamentalsVery hardProduct-company system-design interview
Assertion (A): Writing the same 'Order' entity into both an orders database and a search index inside one request handler can leave them inconsistent. Reason (R): Without a distributed transaction or an outbox, a crash between the two writes commits one and not the other.
- A. A is true but R is false
- B. A is false but R is true
- C. Both A and R are true, but R does not explain A
- D. Both A and R are true and R explains A
Correct answer: D. Both A and R are true and R explains A
This 'dual write' problem is solved by the transactional outbox pattern: write the event to an outbox table in the same database transaction, then publish it reliably to update the index.
Practise more Software Engineering, Git and Cloud Basics questionsSoftware Engineering, Git and Cloud Basics: notes and key points
More Software Engineering, Git and Cloud Basics questions
- A team's code review guideline says reviewers should check that each pull request has tests for new behaviour, follows the style guide…
- Logs from 40 service instances arrive in a central store. Support needs to find every log line for one customer request that crossed 5…
- A team builds a hiring form. QA notices the form can be submitted with all fields blank; developers say 'validation is the back-end's…
- A client can fund only 120 person-months. Using basic COCOMO for a semi-detached project (Effort = 3.0 x KLOC^1.12), what is the largest…
- For the function below, what is its cyclomatic complexity, and how many times is a[i] + a[j] == target evaluated for findpair([1, 2, 3, 4…
- For the same findpair function (two nested for loops, an if that returns (i, j) when a pair matches, and return None after the loops)…