Practice
Solution
Step 1: Understand OT engine's role at concurrent operation receipt
The OT engine must handle concurrent operations arriving out of order or simultaneously and merge them without losing user intent.Step 2: Recognize OT transformation process
OT transforms one operation against another to adjust positions and effects, preserving both users' intentions and maintaining consistency.Final Answer:
Option A -> Option AQuick Check:
OT transforms concurrent ops to preserve intention and order [check]
Solution
Step 1: Identify index type for high-write equality lookups
Hash indexes provide O(1) equality lookups and have simpler insertions compared to B-Trees, improving write throughput.Step 2: Eliminate other options
B-Tree indexes have higher write overhead due to tree balancing. Composite indexes add complexity and overhead without query need. Bitmap indexes are inefficient for high-cardinality columns and high write rates.Final Answer:
Option A -> Option AQuick Check:
Hash index optimizes equality lookups and write speed [check]
Solution
Step 1: Understand Kafka's role in fan-out delivery
Kafka acts as a durable queue for fan-out messages. If it crashes, Delivery Workers cannot fetch new messages, causing stale feeds.Step 2: Evaluate failure modes
Posts are not lost immediately (A) due to Kafka's durability; writes are asynchronous so no blocking (B); duplicates (D) occur only on replay, not crash.Final Answer:
Option D -> Option DQuick Check:
Kafka crash stalls delivery, causing stale feeds [check]
Solution
Step 1: Compare update latency and query freshness trade-offs
Batch rebuilds have high latency; synchronous writes hurt write throughput; static monthly refresh is too stale.Step 2: Identify near-real-time indexing benefits
Streaming updates asynchronously balances freshness and throughput, allowing queries to see recent changes with low delay.Final Answer:
Option A -> Option AQuick Check:
Near-real-time streaming -> balanced freshness and update latency [check]
Solution
Step 1: Analyze scaling challenges
Matching Engine partitions order books per stock symbol, but large cross-symbol or large orders require coordination, causing latency and bottlenecks at scale.Step 2: Evaluate other components
Market Data Feed scales with multicast or sharding; Order Book storage uses scalable Kafka or NoSQL; network layer scales with load balancers and horizontal scaling.Final Answer:
Option D -> Option DQuick Check:
Cross-partition coordination -> Matching Engine bottleneck at scale [check]
