systems_design_patterns

Guide data-structure selection and systems-level design decisions for performance-critical software.

Updated Aug 23, 2026
One-click install
npx skills add https://github.com/tnn1t1s/iterator --skill systems-design-patterns
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: systems_design_patterns
Source: https://github.com/tnn1t1s/iterator/tree/main/.claude/skills/CS500/systems_design_patterns
Command: npx skills add https://github.com/tnn1t1s/iterator --skill systems-design-patterns

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Encodes classic systems design heuristics including heap vs tree selection, merge strategies, and cache-aware design.

Core Features & Use Cases

  • Pattern Identification: Recognize problem class and map to canonical patterns.
  • Data Structure Selection: Evaluate cache behavior and access patterns.
  • Algorithm Strategy: Lazy vs eager evaluation, in-place vs allocation-heavy.
  • Era-Appropriate Idioms: Keep data hot in cache, profile before optimizing.

Quick Start

Choose a priority-queue strategy for a multi-way merge given k and dataset characteristics.

Frequently Asked Questions about systems_design_patterns

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I choose between heap and tree structures for a priority queue in a multi-way merge?

Heap vs tree selection depends on dataset characteristics and access patterns. Heaps minimize memory overhead and cache misses for sequential access, while trees offer better balance for skewed distributions. Profile your merge pattern—number of streams (k), element size, and working set—to determine which structure keeps data hot in cache and reduces dispatch costs.

What's the best way to optimize data structure selection for cache performance?

Cache-aware design prioritizes data locality, alignment, and prefetch efficiency. Evaluate memory layout, access patterns, and how your structure interacts with CPU cache lines. Consider in-place algorithms over allocation-heavy approaches, and choose structures that cluster frequently accessed data to reduce cache misses and improve throughput.

When should I use lazy evaluation versus eager evaluation in system design?

Lazy evaluation defers computation until needed, reducing upfront cost and memory allocation but increasing latency per access. Eager evaluation precomputes results, consuming more resources initially but providing consistent performance. Choose based on your workload: lazy suits sparse or infrequent access patterns; eager suits streaming or batching scenarios where amortization pays off.

How do lock contention and false sharing affect data structure performance?

Lock contention and false sharing degrade multi-threaded performance when threads compete for the same memory region or cache line. Mitigate contention through lock-free structures or partitioning; address false sharing by padding or separating hot fields. Profile concurrent access patterns to identify bottlenecks before optimizing.

Can I apply these system design patterns to streaming and batching pipelines?

Yes. These patterns apply across streaming, batching, composition, and aggregation problem classes. Map each pipeline stage to the appropriate data structure—heap for priority ordering, tree for hierarchical aggregation, hash for fast lookup—and evaluate trade-offs in throughput, latency, and memory footprint for your specific workload.

What are the limitations of in-place algorithms versus allocation-heavy approaches?

In-place algorithms minimize memory overhead and GC pressure but constrain flexibility and may require complex index management. Allocation-heavy approaches simplify logic and enable parallelization but increase latency and memory fragmentation. Trade-off depends on your scale, latency budget, and whether memory or CPU is the bottleneck.