Architecture
376 bites tagged Architecture — interview questions with model answers, and 60-second explainers.
ADR: Capture Context, Not Just Conclusions
An Architecture Decision Record captures why a significant technical choice was made, so teams understand trade-offs without relitigating them. Use it when a decision is costly to reverse or crosses team boundaries.
Federated Docs: One Hub, Many Authors
A federated documentation strategy treats your design system docs like a network, not a monolith. Each team maintains docs in their own repo, and a central hub aggregates them.
Explain ACID properties and why they matter for banking or e-commerce
Define each as a failure-handling guarantee; show how partial commits cause double-spending. Mapping ACID to real failure modes in finance. Vague definitions that skip Isolation levels or Durability details.
Backpressure: Slow the Producer or Crash
Backpressure is a feedback signal telling upstream to slow down when downstream cannot keep up. You see it in stream processors like Flink or Kafka where a slow consumer risks memory exhaustion. Ignore it and queues grow until the service crashes.
Stream-Table Duality: Two Views of One Dataset
A table is a snapshot; a stream is the changelog that built it. The same data can be viewed either way: tables answer what is true now, while streams capture every change that led there. Treating them as separate systems is the expensive footgun.
Volcano Model: Pipelined Query Execution
Volcano makes every query operator a generator yielding one tuple per call. Scans, joins, and sorts stream data upward through open-next-close interfaces without materializing intermediates. The hidden cost is millions of virtual calls that stall modern CPUs.
ORM: The Virtual Object Database Layer
ORM converts data between relational databases and object-oriented program memory, creating a virtual object database inside your code. The footgun is designing object models that ignore the relational structure, forcing awkward translations you never see.
Describe Transformer architecture and why self-attention beats recurrence
This tests parallelization and long-range dependencies. A strong answer outlines the encoder-decoder stack with multi-head self-attention, contrasts O(1) sequential steps versus RNNs' O(n) unrolling, and warns that describing it as averaging misses key ideas.
Semantic vs. Primitive Design Tokens
Semantic tokens give meaning to raw values so components bind to intent, not hex codes. They let you rebrand or theme by changing aliases, not component code.
BEM: Scoped CSS Naming by Convention
BEM is a naming convention that scopes CSS classes like postal addresses, preventing specificity wars in component systems. It shines in large codebases with many developers. The footgun is deep element nesting, which bloats markup into unreadable strings.
Design an A/B test system for homepage headlines without deployments
Tests decoupling experiment configuration from deploys via a headless CMS and feature flagging. A strong answer covers variation containers, server-side bucketing, conversion tracking, and marketer-controlled copy swaps.
How does cookie clearing affect A/B results and consistency?
This tests bucketing integrity when state changes re-randomize users. Explain that re-bucketing contaminates the sample and triggers SRM; propose deterministic server-side assignment, fingerprinting, or authenticated IDs.
Design architecture for multi-channel article distribution from a single source of truth
Tests separation of content and presentation via headless CMS. Strong answers cite a central structured CMS, content API, channel-specific rendering layers, and webhook push. Red flag: manual duplication or direct database sharing without API abstraction.
What is Dependency Injection and Hilt's benefit over manual instantiation?
Tests your grasp of inversion of control and why frameworks matter. A good answer defines DI as supplying dependencies from outside, states Hilt automates object graph creation and scoping, and notes manual instantiation scatters construction logic.
How do you navigate between feature modules without direct dependencies?
This tests architectural decoupling in multi-module Android apps. A great answer describes a shared navigation contract or deep-link router that lets features stay independent. Recommending direct Gradle dependencies between features is a major red flag.
Explain the purpose of a UseCase and how it fits into MVVM
UseCases encapsulate single business rules between ViewModel and Repository, keeping ViewModels lean and Repositories focused on data. Separation of concerns beyond basic MVVM.
How do you share a ViewModel across multiple Fragments?
Tests ViewModel scoping and Fragment communication. A strong answer names activityViewModels or navGraphViewModels, warns about Activity memory retention and hidden coupling, and suggests a parent Fragment or data flow alternative.
Why is LiveData<Boolean> problematic for one-time ViewModel events?
State is not events; suggest an Event wrapper with a consumed flag, or SharedFlow or Channel with no replay. LiveData replays one-time events after rotation. Praising SingleLiveEvent or onCleared resets as fix.
Explain the roles of ViewModel, Repository, and data source in MVVM
Tests your grasp of unidirectional data flow and separation of concerns in Android MVVM. A strong answer maps ViewModel to UI state, Repository to data coordination, and Room or Retrofit to I/O.
When should cross-cutting concerns use a shared versus duplicated solution?
Weigh change frequency and blast radius; decide via fitness function or ADR, not default shared code. Judging coupling versus duplication in emergent design. Mandating one shared library for all cross-cutting concerns.
Navigate between feature modules without direct dependencies?
Tests dependency inversion in modular apps. Answer by defining navigation interfaces in a shared module, implementing them in the :app module, and using DI to connect them. A red flag is suggesting direct module dependencies or using reflection for navigation.
Combine two network sources using Coroutines and Flow
Tests your grasp of async data combination and state management. A good answer uses Flow.combine in a ViewModel, fed by a Repository, emitting a sealed class for UI state (Loading, Success, Error). A red flag is trying to combine state in the UI layer itself.
Explain the purpose of a UseCase or Interactor layer
Tests your grasp of separation of concerns. A great answer defines a UseCase as a single, reusable business operation that sits between the ViewModel and Repository. It keeps other layers clean and focused.
How do you share a ViewModel between Fragments?
Tests your understanding of ViewModel lifecycle scoping beyond a single screen. To share, scope the ViewModel to the parent Activity or a navigation graph using `activityViewModels()` or `navGraphViewModels()`.
Get Architecture bites daily.
Five a day, five minutes, offline. With quizzes so it sticks.
Open testing — you’ll join as an early tester.