Explain Go concurrency and database choices
Company: TripStack
Role: Software Engineer
Category: System Design
Difficulty: hard
Interview Round: Technical Screen
In Go, explain synchronous vs asynchronous execution and blocking vs non-blocking I/O. Compare OS threads and goroutines, including the scheduler model, stack growth, memory overhead, context-switch cost, and communication patterns (channels vs shared memory). Contrast Go's concurrency model with at least one other language (e.g., Java, Python, or C++): how do threads, async/await, and the GIL (if applicable) affect throughput and latency? For databases, compare relational, document, columnar, and key-value stores in terms of data modeling flexibility, transactions (ACID vs BASE), indexing and joins, scalability via sharding/replication, and typical use cases. Given a flight-booking platform that supports complex search and high write concurrency, propose an end-to-end storage design (primary database choice, schema or document design, caching layer, and read/write paths) and justify the trade-offs.
Quick Answer: This question evaluates a candidate's understanding of Go concurrency primitives and scheduler behavior, cross-language concurrency comparisons, database model trade-offs (relational, document, columnar, key–value), and end-to-end storage design for high-concurrency systems.