InterviewStack.io LogoInterviewStack.io

Optimization Under Constraints Questions

Technical approaches for optimizing code and systems when operating under constraints such as limited memory, strict frame or latency budgets, network bandwidth limits, or device specific limitations. Topics include profiling and instrumentation to identify bottlenecks, algorithmic complexity improvements, memory and data structure trade offs, caching and data locality strategies, parallelism and concurrency considerations, and platform specific tuning. Emphasize measurement driven optimization, benchmarking, risk of premature optimization, graceful degradation strategies, and communicating performance trade offs to product and engineering stakeholders.

MediumTechnical
0 practiced
Explain the differences between Parquet, ORC, and Avro for BI workloads. Discuss schema evolution, compression, predicate pushdown, and how you would design a benchmark to choose the best format for large analytical scans on your cloud data warehouse.
HardSystem Design
0 practiced
Design a globally distributed BI reporting architecture that must provide a single dashboard showing global totals with an interactivity latency budget of 2 seconds for 95th percentile. Constraints: limited network bandwidth between regions, and occasional regional outages. Describe how you aggregate data across regions, caching strategy, consistency guarantees, and graceful degradation during outages.
HardTechnical
0 practiced
A large ETL job must complete within 30 minutes on a single worker with 8GB of RAM. It currently sorts and deduplicates 200 million rows in memory and fails due to OOM. Describe external-memory algorithmic strategies (eg. external merge sort, streaming dedupe, hash partitioning with spill-to-disk) you would implement to meet the SLA and minimize I/O.
MediumTechnical
0 practiced
Your analytics workload includes both scheduled dashboards and ad-hoc exploratory queries. With 50M rows and heavy user concurrency, discuss the trade-offs between building pre-aggregations (materialized views) and supporting ad-hoc queries on raw data. Provide a decision framework and an example of when you would choose each approach under memory and latency constraints.
MediumTechnical
0 practiced
You have a query that uses window functions and is slow over 200M rows. Schema:
page_views(user_id bigint, page text, ts timestamptz, session_id text)
Original query computes session durations using window lag/lead. Propose an approach to optimize this for a data warehouse (eg. pre-aggregation, partitions, or rewriting), and provide a rewritten SQL sketch and the reasons why it will perform better.

Unlock Full Question Bank

Get access to hundreds of Optimization Under Constraints interview questions and detailed answers.

Sign in to Continue

Join thousands of developers preparing for their dream job.