Skip to content
tezvyn:

Performance

508 bites tagged Performance — interview questions with model answers, and 60-second explainers.

Go & Rust1 min read

Architecting an L7 proxy in Go versus Rust

Go offers GC and cheap goroutines for fast delivery but tail-latency GC pauses; Rust offers ownership and async/await for predictable latency at higher complexity. ability to weigh systems trade-offs under real constraints.

Go & Rust1 min read

Zero-copy string to []byte conversion via unsafe in Go

Use unsafe.StringData/Slice (or reflect headers) to alias the string's bytes without copying; assumes shared backing array; risk is mutating an immutable string. Go memory layout and unsafe trade-offs.

Go & Rust1 min read

Profiling a Rust hot loop with perf

Build with debuginfo, perf record cycles or cache-misses, perf report then perf annotate to map counters to source/asm; flamegraph for hotspots. low-level performance profiling.

Flutter & Dart1 min read

Isolating and reducing excessive widget rebuilds

Push state down, use const subtrees, rebuild only listeners with ValueListenableBuilder, isolate repaints with RepaintBoundary. narrowing rebuild scope.

Flutter & Dart1 min read

Diagnosing and fixing CustomPainter jank

Avoid work in paint, gate repaints with shouldRepaint, isolate with RepaintBoundary, cache static layers. optimizing custom canvas rendering. blaming the device or repainting everything every frame.

Docker & Kubernetes1 min read

Optimizing Dockerfile layer caching

Order instructions least-to-most volatile, copy dependency manifests and install before copying source, and understand any changed layer busts all later layers. how layer caching invalidation works.

Android & Kotlin2 min read

How do you diagnose and optimize a slow Room query?

Tests SQLite profiling and Room optimization. Isolate the query with Database Inspector, run EXPLAIN QUERY PLAN to spot scans, then add covering indexes, rewrite joins, or use Paging3. Red flag: blindly adding indexes or switching to NoSQL without measuring.

Android & Kotlin2 min read

How do include, merge, and ViewStub optimize deep layout nesting?

This tests Android view inflation and hierarchy flattening. A strong answer covers include for reuse, merge to strip redundant parents during inflation, and ViewStub for lazy-loading heavy views. A red flag is conflating them or citing XML brevity alone.

Android & Kotlin2 min read

What are RecyclerView.Adapter and ViewHolder, and why do they improve scrolling?

This tests RecyclerView's data-to-view separation. A strong answer says Adapter binds data while ViewHolder caches findViewById results, avoiding hierarchy scans on scroll. A red flag is calling ViewHolder a memory saver instead of a lookup cache.

Analytics & Metrics2 min read

Trade-offs between pre-aggregated and raw event data for dashboards

Pre-aggregations trade freshness for speed; raw queries preserve flexibility but spike cost and latency under load. Balancing latency, cost, and freshness in analytics.

Vue, Angular & Svelte2 min read

Angular 21.1 ships with Signal Forms debounce patterns

Angular 21.1 ships with minor fixes. Signal Forms tutorials now show debounced async validators to cut wasted backend API calls. Migration guides for the modern Control Flow syntax are available for apps still on legacy structural directives.

Vue, Angular & Svelte1 min read

Vue 3.4 Cuts Build Times 44%, Stabilizes defineModel

Vue 3.4 cuts SFC compile times 44% and doubles parser speed while stabilizing defineModel for v-model. The refactored reactivity engine skips redundant computed triggers, reducing re-renders. Upgrade requires Volar 1.8.27+ and matching toolchain versions.

Vue, Angular & Svelte1 min read

Vue 3.5 cuts reactivity memory 56%, adds lazy hydration

Vue 3.5 drops reactivity memory 56% and large arrays up to 10x faster with no breaks. Stable reactive props destructure kills withDefaults boilerplate, while lazy hydration and useId() fix SSR pain points.

Vue, Angular & Svelte2 min read

Angular Universal server memory leak: causes and diagnosis

Incomplete platform destruction, global DOM polyfills, unclosed RxJS; use heap snapshots and --inspect. Angular SSR platform lifecycle in Node.js and cross-request retainers. blaming Angular, not citing request cleanup.

Vue, Angular & Svelte2 min read

What is the difference between ChangeDetectionStrategy.Default and ChangeDetectionStrategy.OnPush in Angular?

Default checks components on most async events; OnPush checks on input changes, DOM events, or async pipe emits. Angular change detection and subtree skipping. OnPush is not a free switch; it requires immutable data.

Vue, Angular & Svelte2 min read

How does ngc work in Angular AOT and what artifacts improve performance?

This tests understanding of AOT build-phase compilation and output. Cover efficient JS output, inlined templates and styles cutting AJAX requests, and removal of compiler payload roughly half of Angular. Red flag: conflating AOT and JIT or calling it bundling.

Vue, Angular & Svelte2 min read

How would you implement a memoized selector for expensive derived state?

It tests cache invalidation and pure functions for reactive derived state. A strong answer covers reference tracking on inputs, returning cached results when unchanged, and requiring immutable or stable arguments.

Vue, Angular & Svelte2 min read

What is SSR and what are its advantages over a client-side SPA?

This tests server-client rendering trade-offs. A strong answer defines SSR as server HTML generation plus client hydration, citing faster time-to-content, better SEO for async data, and unified component logic.

Vue, Angular & Svelte2 min read

Explain patch flags and static hoisting in Vue 3's compiler

Tests your grasp of compiler-informed virtual DOM optimizations. A strong answer covers patch flags as bitmap hints for dynamic bindings and static hoisting as extracting static nodes to skip diffing. Red flag: claiming Vue 3 removes the virtual DOM.

Vue, Angular & Svelte2 min read

How would you diagnose and optimize slow Angular component tests?

Tests Angular test economics and runner overhead. Strong answers profile with Vitest, swap Karma for jsdom/happy-dom, mock services, and reduce TestBed recompilation via targeted imports.

Vue, Angular & Svelte2 min read

How do you architect Svelte stores to minimize WebSocket re-renders?

Tests Svelte store granularity and subscription semantics. A great answer splits the monolith into domain stores, uses derived selectors to isolate slices, and leverages readable stores to encapsulate the WebSocket source.

Vue, Angular & Svelte2 min read

Implement virtual scrolling for a large list in Vue

Tests DOM cost awareness and viewport culling. Strong answer: mount only visible nodes plus overscan, recycle DOM on scroll, and preserve total scroll height with a spacer. Red flag: suggesting pagination or naive v-for without keys.

Vue, Angular & Svelte2 min read

How does Svelte surgically update the DOM without VDOM?

Tests VDOM overhead vs compile-time optimization. A strong answer explains that Svelte compiles reactive dependencies into direct DOM API calls, skipping tree creation and diffing. Red flag: claiming VDOM is slow because the DOM itself is slow.

Vue, Angular & Svelte2 min read

Why does an OnPush Angular child not update when its input changes?

Tests OnPush reference equality and manual change detection. Strong answers name: in-place object mutation as the root cause; ChangeDetectorRef.markForCheck or detectChanges to force updates; and Angular Signals as a modern path.

Get Performance bites daily.

Five a day, five minutes, offline. With quizzes so it sticks.

Open testing — you’ll join as an early tester.