Đang mở hậu trường...
A Spring Boot platform requires failed order attempts to roll back all order changes while still committing an audit record. The current service calls its own `writeAudit()` method annotated with `@Transactional(propagation = REQUIRES_NEW)`, but the audit record is rolled back with the order transaction. What should the lead establish as the preferred platform-wide design?
A Java service stores customer records in a HashSet<Customer>. Two Customer objects with the same customerId must be treated as duplicates, but the set currently keeps both objects. What is the most appropriate fix?
An application uses an in-memory cache with a fixed capacity. When the cache becomes full, it should remove the item that has not been accessed for the longest time. Which eviction policy matches this requirement?
A team is considering replacing HTTP long polling with WebSockets for a high-traffic chat service deployed behind multiple load balancers. What is the most accurate assessment of the operational trade-off?
An Order service commits orders to its database and then publishes OrderCreated events to a message broker used by inventory, billing, and analytics teams. Production incidents show both missing events when the service crashes after the database commit and duplicate deliveries during broker retries. Without introducing distributed two-phase commit, which design best preserves business consistency at scale?
An order service must publish an OrderCreated event after committing an order to its database. The current implementation writes to the database and then sends directly to a message broker, occasionally losing events when the broker call fails after the commit. Which design best improves reliability while keeping the service scalable?
A company must provide an exact global top-K dashboard over events distributed across S disjoint shards, with a strict two-second latency target. Scores have a deterministic total ordering, while network bandwidth and coordinator memory are the main constraints; which architecture should the lead engineer select?