Architecture
376 bites tagged Architecture — interview questions with model answers, and 60-second explainers.
Client-side versus server-side A/B testing
Client-side flickers and is bypassable; server-side assigns before response, hides logic, suits backend changes. Where variant assignment and rendering happen.
The legacy React Native Bridge architecture
JS, native, and shadow threads communicate via an async, batched, JSON-serialized Bridge. knowing the old three-thread Bridge model. calling the Bridge synchronous, ignoring serialization cost, or confusing it with JSI.
Web DOM elements vs React Native core components
View maps to UIView/ViewGroup, Text to native text, no HTML or CSS, all text must be inside Text. understanding RN renders to native views, not the DOM. claiming RN runs in a webview or uses real div and CSS.
The JS thread and why it bottlenecks performance
A single thread runs your JS, React reconciliation, and event handling; blocking it delays updates and gestures, and it is separate from the UI thread. RN threading basics.
Push notification data flow with APNs and FCM
Device registers and gets a token, server sends to FCM, FCM routes to APNs for iOS and directly for Android, the OS delivers to the app. End-to-end push architecture. thinking your server pushes straight to the device.
What is a worklet in Reanimated
A worklet is a JS function marked to run on the UI thread runtime with a captured snapshot of its scope, enabling synchronous per-frame work. Reanimated's execution model.
Animated API versus Reanimated architecture
Animated declares animations that the native driver runs, but logic and gestures cross the bridge; Reanimated runs worklets directly on the UI thread. Where animation work runs. saying both run fully on JS.
Designing a native map UI component
Wrap each platform's native view, expose props mapped to native setters and events as bubbling callbacks, unify behind one JS API. native UI component architecture and bridging.
Platform files versus Platform.OS checks
Use platform files for large divergence and platform-only deps, use Platform.OS for small inline tweaks. choosing the right platform-divergence tool.
State normalization for relational data
Store entities by id in lookup tables, reference relationships by id, avoid nesting and duplication. modeling relational data in a flat store. deeply nested arrays that force cascading updates and stale duplicates.
Feature-based vs layer-based project structure
Layer-based groups by technical role and is simple early but scatters a feature across folders; feature-based groups by domain, improving cohesion and ownership at the cost of some duplication and… Structuring code for scale.
Resolving power-vs-simplicity product tension
Progressive disclosure, a stable core with optional advanced layers, escape hatches; or pick one if the audiences truly diverge. Whether you resolve a strategy conflict with layered architecture.
Framing a build debate with the mission
Separate user simplicity from internal complexity, weigh new-framework risk, decide via mission and reversibility. Whether mission guides architecture, not just features.
Evaluate a high-risk full rewrite
Surface rewrite risk with POCs, propose incremental displacement like Strangler Fig, quantify the cost of stalled features. judgment on big-bang rewrites. endorsing an 18-month freeze with no phased alternative.
Resolve a low-code versus custom-build conflict
Build a spike testing real constraints, surface lock-in and exit cost, propose a hybrid scoped by differentiation. principal judgment under a strategic disagreement. picking a side ideologically instead of de-risking.
Modularize routes with express.Router
Create a Router per resource in its own file, define routes on it, export it, and mount with app.use('/products', router). structuring a growing app.
Centralized error-handling middleware
Error middleware takes four args err, req, res, next, is defined last, and runs when next(err) is called or sync errors throw. Express error flow. omitting the err parameter so Express treats it as normal middleware.
Modularizing routes with express.Router
Create a Router instance in users.js, attach routes to it, export it, then mount it under a base path with app.use in the main file. structuring a growing app. duplicating the base path on every route instead of mounting.
Monorepo workspaces vs private npm packages
Workspaces give atomic cross-service changes and instant local linking but couple release cadence; private packages give versioned isolation but add publish overhead and version drift. tradeoffs of code-sharing strategies.
Layered structure for a scalable Express API
Routes map URLs, controllers handle HTTP, services hold business logic, data layer talks to the DB; keep each layer ignorant of HTTP except controllers. separation of concerns and testability.
OpenTelemetry agent and gateway architecture
Agents run per-node for local collection and host enrichment; gateways are central, horizontally scaled pools for batching, tail sampling, and routing. Whether you can architect a scalable telemetry pipeline.
Resource faults versus network faults: when each matters?
Resource faults probe local saturation and autoscaling; network faults probe distributed-call resilience like timeouts and retries. Matching fault type to a system's real risks.
Serving for online and batch predictions
A low-latency online path (synchronous, autoscaled, real-time features) and a high-throughput batch path (parallel, cost-optimized, large jobs) sharing one model artifact and feature definitions. dual serving modes.
AWS Bedrock versus a direct provider API
Bedrock unifies many models with IAM, VPC, and cloud integration; a direct provider API gives earliest models, full feature parity, and simpler vendor terms. build-versus-aggregate LLM sourcing.
Get Architecture bites daily.
Five a day, five minutes, offline. With quizzes so it sticks.
Open testing — you’ll join as an early tester.