Skip to content
tezvyn:

All bites

The whole library, newest first. Filter by what you are here for, or pick a topic if you already know.

4330 bites

Page 14

Flutter & Dart2 min read

Persist a custom Dart object using shared_preferences

Tests JSON serialization bridging custom objects to primitive-only key-value storage. Strong answer: add toJson/fromJson on User, jsonEncode into SharedPreferences as String, jsonDecode on read. Red flag: proposing direct storage or toString hacks.

Flutter & Dart2 min read

Explain the difference between tester.pump and tester.pumpAndSettle

This tests your grasp of Flutter frame scheduling. pump draws one frame; pumpAndSettle loops until idle, failing on infinite animations. A red flag is treating pumpAndSettle as universally safe or missing why a loading spinner causes timeouts.

Flutter & Dart2 min read

Explain map() vs where() on a List and chain them

This tests Dart Iterable laziness and correct chaining. A strong answer states where filters and map transforms, both return Iterables, then chains where before map and converts with toList. A red flag is claiming the original list mutates or omitting toList.

Flutter & Dart2 min read

Design an immutable UserSettings class with copyWith for Flutter state

Tests immutability as Flutter's state foundation. A great answer shows final fields, a const constructor, copyWith with nullable named params and null-aware fallback, and explains how immutability prevents accidental shared mutations during rebuilds.

Flutter & Dart1 min read

Dart reduce versus fold on collections

Reduce combines same-type elements and throws on empty; fold takes an initial value and accumulator of any type, safe on empty.

Flutter & Dart2 min read

Riverpod providers are objects, not widgets. What are the practical advantages?

Tests architectural decoupling of state and UI in Flutter. Strong answers hit compile-time safety, unit testing without widget trees, and logic that survives outside BuildContext. Red flag: praising syntax sugar without explaining the coupling problem.

Flutter & Dart2 min read

Design a BLoC solution for an API call that updates multiple UIs

Decoupled BLoC orchestration for multi-surface updates. Use a coordinator stream so each BLoC subscribes independently while keeping loading and error states local per widget. Directly nesting one BLoC inside another or using global variables for shared state.

Flutter & Dart2 min read

Structure a POST request to send a Dart object as JSON

Set Content-Type application/json, serialize to Map via toJson, encode with dart:convert jsonEncode, and pass the string as body.

Flutter & Dart2 min read

Propose a Dart FFI approach to share camera frames and its risks

Tests zero-copy frame sharing via Dart FFI plus ownership and thread hazards. Propose native allocation, pass pointer to Dart as external TypedData, use ring buffer, then free; cite use-after-free and races.

Flutter & Dart2 min read

Securely inject secrets for build flavors in CI/CD

Contrast CI environment variable injection with runtime secrets-manager fetches via CLI, comparing rotation overhead and blast radius.

Flutter & Dart2 min read

How would you optimize Flutter CI build times beyond caching?

Tests platform build pipeline knowledge and CI design. Answers hit Gradle parallelism and R8 config for Android, Xcode derived data, target thinning on iOS, plus Dart AOT flags and sharding.

React & Next.js1 min read

What is JSX and how does the browser run it?

JSX is XML-like syntax compiled to React.createElement calls; it differs from HTML via className and camelCase; browsers never see JSX, only transpiled JS.

Explain props in React and how parent components pass data to children
React & Next.js2 min read

Explain props in React and how parent components pass data to children

Define props as the single object argument; show destructuring; stress immutability and downward flow; note defaults.

What are the two main ways to define a component in React?
React & Next.js2 min read

What are the two main ways to define a component in React?

Tests fluency in function and class syntax. Outline: show a function returning an h1; show a class with render() returning an h1; note functions are the React 19 default. Red flag: offering arrow vs function declaration as the two ways, or omitting render().

What is the purpose of React's key prop and index key risks?
React & Next.js2 min read

What is the purpose of React's key prop and index key risks?

This tests React reconciliation. Keys give stable identity to match components across renders and preserve state. Indices break on reorder or delete, causing state bugs. A red flag: saying keys are only for performance or indices are harmless.

Describe two patterns for conditional rendering in JSX
React & Next.js2 min read

Describe two patterns for conditional rendering in JSX

First, early return with if/else for branches; second, ternary or logical AND inside JSX for inline toggles.

What is a React Fragment and why use it over a div?
React & Next.js2 min read

What is a React Fragment and why use it over a div?

This tests JSX semantics and DOM hygiene. A strong answer says Fragments group children without wrapper nodes, preventing extra DOM and invalid HTML like divs in tables. A red flag is citing performance without mentioning DOM structure or semantics.

Explain prop drilling and why it's a problem
React & Next.js2 min read

Explain prop drilling and why it's a problem

Tests coupling in deep React trees. Good answers define prop drilling as forwarding props through unused intermediaries, cite coupling and refactor pain, and name Context or composition as fixes. Red flag: calling props bad or jumping to Redux without Context.

Write the React.createElement() equivalent for this JSX
React & Next.js2 min read

Write the React.createElement() equivalent for this JSX

Tests JSX-to-JS compilation mechanics. Answer: createElement('a', {href: '/home', className: 'link'}, 'Go Home'). Children must be the third argument, not inside props. Red flag: nesting children in props or using an unquoted tag variable.

How does React use keys in reconciliation? When do keys cause bugs?
React & Next.js2 min read

How does React use keys in reconciliation? When do keys cause bugs?

Tests reconciliation identity semantics. Answer: keys give scoped identity for O(n) diffing; stable keys preserve state, but indices during reordering make React reuse DOM nodes wrongly, polluting state. Red flag: saying keys are 'just for performance'.