Architecture
376 bites tagged Architecture — interview questions with model answers, and 60-second explainers.
Cross-attention versus self-attention in encoder-decoder Transformers
Cross-attention draws Queries from the decoder and Keys/Values from the encoder, letting the decoder condition on the source. Information flow in encoder-decoder models.
How Transformers encode token position
Attention is permutation-invariant, so positional encodings (sinusoidal, learned, or rotary) are added or applied. Why and how positional information is injected.
Self-attention and the Query, Key, Value matrices
Queries score against keys via scaled dot product, softmax yields weights, and those weight the values into the output. Core Transformer mechanics. Confusing the three roles or omitting the scaling and softmax steps.
Encoder, decoder, and encoder-decoder Transformers
Encoder-only uses bidirectional masked-token pretraining for understanding tasks, decoder-only uses causal next-token prediction for generation, encoder-decoder uses span corruption for… mapping architecture to objective and use case.
LLaVA versus Flamingo vision-LLM design
LLaVA projects image features into the LLM input space and feeds them as tokens, keeping the LLM mostly intact; Flamingo inserts gated cross-attention layers inside a frozen LLM. comparing VLM integration strategies.
Designing a Visual Question Answering system
Encode the image with a vision backbone, encode the question with a text encoder, fuse them via cross-attention into a joint representation, then decode or classify the answer. multimodal architecture design.
Temporal consistency in video diffusion
Add temporal layers, such as temporal attention or 3D convolutions across frames, so the model attends across time and frames denoise jointly rather than independently. extending image diffusion to video.
Governance for a multi-brand design system
Brand-agnostic core consuming semantic tokens, per-brand token themes, contribution rules blocking brand conditionals in core. Multi-brand architecture and governance.
Explain token aliasing in design systems
Primitives hold raw values, semantic tokens reference them by intent, components consume only semantic ones. Layered token architecture intuition. Hardcoding hex values in components or skipping the semantic layer entirely.
Sharing logic, native UI across platforms
Shared module (e.g. Kotlin Multiplatform) for state/business rules, platform-native UI consuming it, and a clean interface boundary. separating shared logic from native UI. forcing shared UI and losing native feel.
Architecting global and local theming with context
A top-level provider supplies global tokens, nested providers merge local overrides, components read the nearest theme, often backed by CSS variables. layered theming via context. passing theme through props at every level.
Why choose Kafka over a REST endpoint for ingestion
Kafka buffers spikes, decouples producers from consumers, replays and fans out durably. understanding async decoupling and buffering. thinking a synchronous REST call gives the same back-pressure and durability.
Aurora vs Spanner architecture contrast
Aurora is single-writer with a shared distributed log-based storage and quorum, scaling reads; Spanner shards data with Paxos and TrueTime for global writes. deep architectural contrast.
Leader-follower vs multi-leader replication
Single-writer leader-follower is simple but a write bottleneck; multi-leader accepts writes in many regions for latency and availability. replication topology tradeoffs. ignoring that multi-leader needs conflict resolution.
What is database replication and why use it?
Replication keeps copies of data on multiple servers; primary benefits are high availability through failover and improved read scalability by spreading reads. basics of copying data across nodes.
Why separate storage and compute in a cloud warehouse?
Data lives in cheap shared object storage while independent compute clusters scale separately, enabling elastic, concurrent, isolated workloads and pay-per-use. understanding decoupled warehouse architecture.
What is the difference between OLTP and OLAP?
OLTP handles many short read-write transactions on normalized current data; OLAP runs few large analytical scans over denormalized historical data. understanding two opposite workload profiles.
What are eventual consistency and the BASE model?
Eventual consistency means replicas converge given no new writes; BASE is Basically Available, Soft state, Eventually consistent. trading consistency for availability per feature.
What is the CAP theorem?
Consistency, Availability, Partition tolerance; during a network partition you must choose between staying consistent or staying available. grasp of fundamental distributed-systems limits.
How do you choose between relational and NoSQL databases?
Relational gives schema, joins, and ACID for structured related data; document gives flexible schema and horizontal scale for varied or denormalized data. ability to match a data model to requirements.
Multi-theme infrastructure for a component library
Style components against semantic tokens exposed as CSS custom properties, define per-theme token values, and switch at runtime via a data-theme attribute or class. theming architecture.
Core tokens versus alias semantic tokens
Core tokens are raw values like blue-500; alias tokens reference cores with intent like color-action; semantic aliasing decouples meaning from raw value. token-tier architecture.
Structure CSS layers for reset, vendor, and components
Declare layer order upfront, place reset earliest, vendor next, your components last so they win. applied cascade-layer architecture. relying on source order or !important instead of an explicit layer declaration.
What problem do CSS Cascade Layers solve?
Layers create explicit priority bands, layer order beats specificity inside, and you control override without selector hacks. understanding of the cascade beyond specificity.
Get Architecture bites daily.
Five a day, five minutes, offline. With quizzes so it sticks.
Open testing — you’ll join as an early tester.