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.

8668 bites

Page 164

TCP Listeners: Go vs Rust
Go & Rust2 min read

TCP Listeners: Go vs Rust

Go spins up TCP listeners and handles connections with lightweight goroutines—1 million costs ~500MB—but GC pauses introduce 2-5ms latency. Rust trades boilerplate for zero-cost safety and consistent sub-100µs response times without garbage collection.

Go & Rust2 min read

go vet: Catch Bugs Compilers Allow

go vet catches suspicious constructs the compiler ignores, like Printf argument mismatches. Run it in CI to spot concurrency and formatting bugs early. It relies on heuristics, so a clean report does not guarantee correctness and false positives can occur.

Go & Rust2 min read

CSP: Model Concurrency with Message Passing

CSP treats concurrency as isolated processes talking through channels, not threads fighting over shared memory. It shaped Go, Erlang, and occam. Engineers often retrofit shared-state patterns into channel-based code and reintroduce race conditions.

Go & Rust2 min read

go.mod: Root of Go Module Identity

A go.mod file anchors a Go module, declaring its canonical path and dependencies to turn a directory into a versioned unit. Every project needs one at its root, and the path dictates how others import your packages.

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.

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

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

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

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

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 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 & 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

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

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

How do you synchronize app state with GoRouter navigation?

Read auth state in top-level redirect; rebuild GoRouter via refreshListenable on changes; handle deep links in page builders.

Flutter & Dart2 min read

How do you handle CPU-bound tasks without freezing the Flutter UI?

Tests whether you know async/await yields for I/O but cannot parallelize CPU work. A strong answer defines Isolates as isolated heaps with message-passing, contrasts them with threads, and shows how compute() wraps Isolate.spawn.

Flutter & Dart2 min read

How do you test Flutter platform channels and mock native responses?

Tests MethodChannel mocking in widget tests. Strong answers intercept calls via TestDefaultBinaryMessengerBinding, encode replies with StandardMessageCodec, pump the widget, and assert UI state.

Flutter & Dart2 min read

Set up an integration test for a multi-screen login flow

This tests your grasp of integration_test's device runtime versus headless widget tests. A strong answer covers the integration_test directory, ensureInitialized, driving a login flow end-to-end on device.

Flutter & Dart2 min read

Compare sqflite and Drift: trade-offs and when to choose Drift

This tests Flutter persistence trade-offs. Contrast sqflite's raw maps and raw SQL with Drift's typed code, streams, and migrations; choose Drift for complex schemas or web targets. Red flag: calling Drift bloat or claiming raw sqflite is always faster.

Flutter & Dart2 min read

Fix UI jank from file reads and SQLite inserts using Isolates

This tests whether you know heavy synchronous work blocks Dart's UI event loop past the 16ms frame budget. A strong answer offloads parsing and SQLite inserts to a worker isolate via compute, returning results.