Performance
508 bites tagged Performance — interview questions with model answers, and 60-second explainers.
How do you display a large list efficiently in Jetpack Compose?
This tests understanding of Compose lazy versus eager layout. A strong answer names LazyColumn or LazyRow, notes visible-only composition, and contrasts Column which lays out everything upfront.
Explain Jetpack Compose recomposition, its triggers, and optimizations.
This tests grasp of Compose's reactive model. A strong answer defines recomposition as recomputing composables when state changes, notes State triggers it, and explains Compose skips unchanged subtrees via smart tracking.
How does ConstraintLayout enable flat responsive UIs with chains and barriers?
It tests constraint-based positioning and flat hierarchy performance. A strong answer covers relative constraints replacing nested layouts, chains for distributing groups, and barriers for dynamic alignment to extreme edges.
Explain the difference between LinearLayout, RelativeLayout, and FrameLayout
Understanding of ViewGroup measurement and simplicity versus flexibility tradeoffs. LinearLayout for 1D lists, RelativeLayout for complex sibling rules, FrameLayout for single-child or overlap.
Which Android Studio Profiler tool diagnoses high memory usage and leaks?
Heap dump, check retained size for leaked Activities, trace reference chains to root retainer. Memory Profiler expertise and systematic leak diagnosis. Naming CPU profiler or saying "look for big objects."
How do you build a performant visualization for millions of time-series points?
Tests end-to-end data reduction: backend bucket downsampling like LTTB preserves visual shape, frontend uses level-of-detail rendering and viewport culling. Red flag: naive every-Nth sampling that drops peaks or sending raw millions to the browser.
Design client-side event batching and prevent unload data loss
It tests balancing network efficiency and data reliability in browser analytics. Strong answers cover in-memory batching with size or time triggers, sendBeacon or fetch keepalive on visibilitychange, and a retry queue.
How do you diagnose and fix excessive recomposition in Jetpack Compose?
This tests your grasp of Compose's stability system. First, use Layout Inspector to find high-recomposition areas. Then, enable and analyze the Compose compiler report to diagnose unstable parameters (like List) or lambdas.
How to implement efficient large lists in Jetpack Compose?
This tests your grasp of Compose performance. Use `LazyColumn` to compose only visible items, unlike a `Column` which renders all items at once. A red flag is suggesting a scrollable `Column`, which has severe performance costs for large lists.
Explain Recomposition in Jetpack Compose
This tests your core understanding of Compose's declarative model. Explain that recomposition is re-running composables when state they read changes. Mention that Compose optimizes by only recomposing the nearest scope and skipping composables with stable…
LinearLayout vs. RelativeLayout vs. FrameLayout
This tests your knowledge of fundamental View layouts and performance trade-offs. Define LinearLayout (single axis), RelativeLayout (relative positioning), and FrameLayout (stacking), giving a clear use case for each.
Explain `inline` and `reified` in Kotlin
Tests your grasp of JVM performance costs and type erasure. A great answer explains how `inline` avoids object allocation for lambdas, and how this enables `reified` to bypass type erasure for runtime checks. A red flag is just saying 'it's for performance'.
Strategy for Visualizing Millions of Time-Series Points
Tests your strategy for balancing performance and visual fidelity with large datasets. Propose backend downsampling with an algorithm like LTTB to preserve peaks, then discuss multi-resolution data fetching on the frontend.
How to diagnose a slow dashboard query?
This tests systematic debugging of a data problem. A good answer investigates the query plan first, then the table's physical layout (partitioning/clustering), and finally the BI tool and warehouse load. A red flag is jumping to a solution without diagnosis.
Diagnosing Out-of-Memory Errors in a Spark Job
This tests your systematic debugging of distributed systems. A great answer first diagnoses the failure location via the Spark UI, then investigates data skew and code inefficiencies, and finally tunes memory configs.
What is data partitioning in a cloud data warehouse?
Tests your grasp of physical data layout optimization. A good answer defines partitioning as dividing a table by a column (e.g., date), then explains how this enables partition pruning to improve query speed and reduce cost by scanning less data.
Design a Client-Side Event Batching System
Tests your grasp of client-side performance, network optimization, and data loss edge cases. A great answer batches events in memory, sends them with `fetch()`, and uses `navigator.sendBeacon()` on `pagehide` to reliably send the final batch.
How do you manage performance in a self-organizing team?
This tests your ability to shift from individual performance management to fostering team-based career development. A great answer reframes the goal, uses frequent 1-on-1s for coaching, and decouples raises from feedback.
How do you diagnose and fix excessive recomposition in Jetpack Compose?
This tests your understanding of Compose's stability system for performance. Use the Layout Inspector and Compiler Metrics to find unstable composables, then fix them with immutable data types and stable lambdas.
Implement an efficient list in Jetpack Compose
Tests your grasp of UI virtualization in Compose. Answer: Use `LazyColumn` as it only composes visible items. Contrast this with `Column`, which composes all items at once, causing poor performance. Mention the `items` DSL.
Explain Recomposition in Jetpack Compose
Tests your grasp of Compose's declarative model. A good answer defines recomposition, explains state-read triggers, and details how stability and positional memoization enable skipping. A red flag is assuming any state change redraws the entire UI.
How does ConstraintLayout enable complex, responsive UIs?
Tests your grasp of modern Android UI performance and responsiveness. Explain how relative positioning flattens hierarchies, then define chains for distributing space and barriers for handling dynamic content size.
How would you optimize a slow, expensive data warehouse?
Tests your diagnostic approach to performance issues. A good answer first analyzes query patterns, then applies partitioning by date, clustering by high-cardinality keys, and materialized views for aggregations.
How would you diagnose a slow dashboard query?
This tests your systematic approach to performance tuning. A great answer investigates query optimization, strategic indexing/partitioning, and the data model (like star schema).
Get Performance bites daily.
Five a day, five minutes, offline. With quizzes so it sticks.
Open testing — you’ll join as an early tester.