System Design Masterclass
E-Commercecompatibilityvalidationrules-enginegraph-databaseecommerceintermediate

Design Parts Compatibility Validation

Design a system to validate product compatibility for eCommerce

Millions of products, billions of compatibility rules|Similar to PCPartPicker, Amazon, AutoZone, NewEgg, Dell|45 min read

Summary

A parts compatibility system validates whether products work together before purchase - like PCPartPicker checking if a CPU fits a motherboard, or AutoZone verifying a part fits your car. The core challenges are modeling complex compatibility relationships, handling millions of product combinations efficiently, keeping compatibility data accurate as products evolve, and providing real-time validation during checkout. This is asked at Amazon, PCPartPicker, AutoZone, and any eCommerce company with configurable products.

Key Takeaways

Core Problem

This is fundamentally a graph problem with rule evaluation. Products have compatibility relationships that can be direct, transitive, or conditional.

The Hard Part

With 1M products and 100 attributes each, brute-force compatibility checking is O(n^2). You need smart indexing and rule structures to make this fast.

Scaling Axis

Scale by product category. PC parts, car parts, and furniture have independent compatibility domains that can be sharded separately.

The Question: Design a system that validates whether products are compatible with each other, like PCPartPicker for computer builds or AutoZone for car parts.

Real-world examples: - PCPartPicker: Will this RAM work with this motherboard? Does the GPU fit in this case? - AutoZone: Does this oil filter fit my 2019 Honda Civic? - Dell Configurator: Can I add this GPU to this laptop model? - IKEA: Will this countertop work with this cabinet frame?

What to say first

Before I design, let me understand the compatibility domain. Are we talking about PC parts, automotive, furniture, or a general-purpose system? The domain significantly affects the data model.

Hidden requirements interviewers test: - Can you model complex relationships (direct, transitive, conditional)? - Do you understand the difference between positive and negative compatibility? - Can you handle rule conflicts and priorities? - How do you keep compatibility data accurate over time?

Premium Content

Sign in to access this content or upgrade for full access.