Intermediate interview questions in Backend Dev, page 5
Embed or reference likes in a document database?
Embedding is fast for small bounded lists but unbounded likes hit document size limits; referencing scales for high-cardinality, write-heavy likes.
What are eventual consistency and the BASE model?
Eventual consistency means replicas converge given no new writes; BASE is Basically Available, Soft state, Eventually consistent.
Modularize routes with express.Router
Create a Router per resource in its own file, define routes on it, export it, and mount with app.use('/products', router).
Why fit Cassandra to a high-read, high-write workload?
Consistent-hash partitioning spreads load, replication and no single master give availability, log-structured writes are fast, tunable consistency balances per query.
Idempotency: PUT vs POST in REST
Idempotent means repeated identical requests leave the same server state; PUT is idempotent, POST is not. Use PUT to overwrite a resource at a known URL.
404 vs 500: missing resource vs server failure
A missing resource returns 404 Not Found (client asked for something absent); a database failure returns 500 Internal Server Error (server-side fault).
Sharing mutable state: Go mutex vs Rust Arc Mutex
Go uses sync.Mutex by convention; Rust wraps data in Arc<Mutex<T>> so locking is mandatory, enforced by Send/Sync and the borrow checker.

How do you safely execute blocking code from an async function
Tests whether you know how to prevent event loop blocking by offloading sync work. Name asyncio.to_thread or run_in_executor, explain ThreadPoolExecutor scheduling, and note when processes beat threads.
Rust async/await vs Go goroutines
Go schedules goroutines on a built-in runtime transparently; Rust futures are inert until polled by an external runtime like Tokio, and async colors functions.

Explain the asyncio event loop and cooperative multitasking
Tests if you view the event loop as a single-threaded orchestrator, not magic parallelism. Strong answers note it runs tasks and callbacks, manages a ready queue, and yields control at await. Red flag: calling it multithreading or parallel execution.
asyncio.gather vs asyncio.wait
Gather returns ordered results and propagates the first exception (or captures them); wait returns done/pending sets and never raises, you inspect each.
What is Go's context package and how do you use WithCancel?
This tests cancellation propagation. A good answer says Context carries deadlines, signals; derive a child with WithCancel, pass it to worker, then call cancel to unblock ctx.Done. Bad: storing context in structs, leaking cancel functions, or ignoring Done.
Mongoose populate() for referenced documents
Populate() replaces stored ObjectIds with the referenced documents, needs a ref in the schema, called via .populate('author').
Star schema vs snowflake schema trade-offs?
Star keeps dimensions denormalized for fewer joins and faster simpler queries; snowflake normalizes dimensions into sub-tables saving space and easing maintenance but adding joins.

When should you use asyncio.Lock over threading.Lock?
This tests cooperative multitasking knowledge: asyncio.Lock yields to the event loop via await, while threading.Lock blocks the OS thread and freezes the loop. A red flag is claiming threading.Lock works because locks are universal.
Go select vs Rust select! fairness and determinism
This tests runtime fairness in concurrent primitives. Contrast Go's pseudo-random case selection with Tokio's randomized default and its opt-in biased; top-down mode. Red flag: claiming Go uses source order or that Rust randomization is unavoidable.
Database migrations with the Sequelize CLI
Migrations are version-controlled scripts with up/down so teams apply identical schema changes; use sequelize-cli to generate, edit with addColumn, then db:migrate.
How does columnar storage speed up analytics?
Columnar stores each column contiguously, so aggregations read only needed columns, scan far less data, and compress better with vectorized execution.
Mongoose pre('save') hooks for password hashing
Pre('save') runs before persistence; use it to hash the password, guarding with isModified, calling next() or returning.
What is a Type 2 slowly changing dimension?
An SCD handles dimension attributes that change over time; Type 2 inserts a new row per change with a surrogate key and validity dates, marking one current.
We are hiring for this. Every open role lists the topics its interview covers, so you can prepare for the real thing rather than guessing.
See open roles