Interview questions with answer breakdowns — Page 45 of 52
Browse page 45 of Offer.cc interview question and answer breakdowns with reasoning, implementation details, follow-ups, and public sources.
Coding Interview: How Do You Search a Pattern with a Suffix Array?
Turn fixed-text substring queries into two binary searches over a suffix array, with construction, complexity, and edge cases.
System Design Interview: How Do You Isolate Noisy Tenants and Schedule Fairly?
Design a multi-tenant service around tenant identity, resource budgets, and isolation tiers, using quotas, fair queues, and shuffle sharding to bound a noisy tenant’s blast radius.
Implement an Event Emitter in JavaScript
Derive a JavaScript EventEmitter from an explicit contract, handling duplicate registrations, listener mutation during dispatch, reentrant once listeners, and error propagation, then verify the semantics with boundary cases.
Backend Interview: How Do You Protect a Service from Overload?
Design overload protection with saturation signals, bounded concurrency, selective load shedding, graceful degradation, and a controlled recovery loop that preserves useful work under excess demand.
SQL Interview: Sessionize User Events with a 30-Minute Inactivity Gap
Use PostgreSQL LAG, boundary flags, and a running window sum to sessionize events while handling the exact 30-minute boundary, deterministic ordering, query ranges, late data, and verification.
How to Answer ‘What Is Your Favorite Product and How Would You Improve It?’
Build a product thesis from a user journey and explicit tradeoff, then derive one improvement from a testable user problem with an outcome metric and risk guardrails.
Linux Interview: How Do You Diagnose an OOM Kill?
Confirm the OOM scope from exit status, cgroup events, and kernel logs, then separate memory charges, distinguish a leak from an undersized limit, and remediate safely.
Coding interview: Implement a monotone integer radix heap
Use the nondecreasing extracted-key invariant and highest-differing-bit buckets to build an integer priority queue and explain amortized cost.
System Design Interview: Design a Subscription Billing System
Design recurring billing with a subscription state machine, immutable invoice snapshots, idempotent payment attempts, webhook ordering, proration, dunning, reconciliation, and entitlement recovery.
How Do You Implement Promise.all with Correct Ordering and Failure Semantics?
Derive a Promise.all implementation from the iterable contract, covering plain values, thenables, empty input, ordered results, and fail-fast rejection, then validate it with boundary cases.
Backend Interview: How Do You Solve the Database-and-Message-Broker Dual-Write Problem?
Design a transactional outbox that makes event intent durable, then reason through relay crashes, duplicate delivery, per-aggregate ordering, idempotent consumers, and failure-injection tests.
Data Science Interview: How Do You Validate a Time-Series Forecasting Model Without Leakage?
Work backward from the real forecast origin to design rolling-origin backtests, enforce feature availability, score horizons and cities separately, and reserve a final holdout for the selected pipeline.
Product Manager Interview: How Would You Diagnose a 15% Drop in DAU?
Use metric validation, absolute contribution analysis, a nested funnel, and timeline evidence to locate a DAU anomaly and decide whether to repair data, halt a rollout, or roll back.
Linux Interview: Why Is Load Average High When CPU Usage Is Low, and How Do You Diagnose It?
Start with Linux's runnable and uninterruptible-task accounting, then use R/D states, PSI, wchan, and subsystem metrics to diagnose high load with low CPU usage and verify the fix.
Coding Interview: How Do You Solve Offline Dynamic Connectivity with DSU Rollback?
Derive an offline dynamic-connectivity solution from union-find using a segment tree over time and rollback, including deletions, invariants, edge cases, and complexity.
System Design Interview: Design a Multi-Region API Gateway
Design an API gateway for 300 services and 500,000 peak requests per second, covering routing, authentication, configuration rollout, regional failure, overload, and observability.
Backend Interview: How Do You Store Passwords Securely and Migrate Legacy Hashes?
Start with the offline-cracking threat, then design Argon2id parameters, versioned credentials, login-time migration, inactive-account handling, pepper rotation, and capacity protection.
SQL Interview: Calculate Rolling 7-Day Active Users
Calculate exact rolling 7-day active users with a calendar spine, timezone-correct user-day deduplication, and a distinct union across each trailing window, then handle gaps, late events, and scale.
How Would You Prioritize Competing Feature Requests?
Compare competing requests through goals, hard constraints, evidence quality, cost of delay, and opportunity cost; make one decision; and document commitments, fallback plans, and triggers for reconsideration.
Networking Interview: How Does HTTP/3 Solve HTTP/2 Head-of-Line Blocking?
Use a packet-loss timeline to explain HTTP/2 cross-stream TCP blocking, HTTP/3 QUIC stream isolation, and the waits that remain in retransmission, congestion control, flow control, and QPACK.
Coding interview: Implement an interval tree for overlap queries
Augment a balanced tree with subtree maximum endpoints to answer overlap queries online and explain rotations, deletion, and complexity.
System Design Interview: Design a Proximity Service for Nearby Places
Derive a geospatial candidate set, exact-distance verification, and stable pagination for a nearby-place service that handles cell boundaries, hot regions, cache invalidation, and shard failures.
PostgreSQL Interview: How Do MVCC and VACUUM Work Together?
Trace PostgreSQL row visibility from MVCC snapshots through cleanup horizons, autovacuum, disk reuse, bloat diagnosis, HOT updates, and XID freezing.
Data Engineering Interview: When Should You Use Batch, Micro-Batch, or Stream Processing?
Derive when to use batch, micro-batch, or continuous stream processing from business action deadlines, then prove the choice with latency budgets, result revisions, cost, and shadow verification.