← 返回 bytedance 的题目列表CAP / DB Indexing / Concurrency / Logging Oral 八股
类型:qbank
Backend oral cluster covering project data-schema choices, CAP trade-offs, database indexing, concurrency and locking, and logging practices.
Requirements
Be ready to answer a backend oral cluster spanning five connected topics:
Explain a project's data schema and justify its indexing choices against the actual query patterns.
Explain the CAP theorem and the consistency / availability decision a system makes during a network partition.
Compare database index choices, including their read benefit and write / storage cost.
Discuss concurrency control and locking, including how contention and deadlocks can arise.
Describe logging practices that make a production service diagnosable without exposing sensitive data.
Notes
Start schema and index answers from the workload: access paths, selectivity, ordering, update rate, and latency target. An index is only useful when it serves a concrete query pattern, and every additional index adds write amplification and storage cost.
State CAP precisely: when a network partition occurs, a distributed operation cannot guarantee both linearizable consistency and availability for every request. Avoid the misleading shorthand that a healthy system permanently chooses only two of three properties.
For composite indexes, connect column order to the query's equality, range, and ordering predicates. Be ready to explain why a plausible index can still be unused or non-selective.
Frame concurrency choices around invariants. Compare pessimistic locking with optimistic version checks, name the isolation anomaly being prevented, and use consistent lock ordering or bounded retries to handle deadlocks.
Prefer structured logs with timestamp, severity, service, operation, correlation identifier, and outcome. Keep secrets and raw personal data out of logs; use sampling and level discipline so high-volume paths remain useful during incidents.
Preparation
Draw one project schema, list its three most important queries, and defend every index against those queries and the write cost.
Rehearse a two-minute CAP answer around one concrete partition scenario, explicitly separating normal operation from partition behavior.
Walk through one lost-update or deadlock example and explain how locking, isolation, ordering, or optimistic retries preserve the invariant.
Instrument a toy endpoint with structured success and failure logs, then review the fields for correlation value, noise, and accidental sensitive-data exposure.