← Back to All Questions
Easy~35 minE-Commerce

Design Parts Compatibility System

AmazonAutoZonePCPartPickerNeweggRockAuto

📝 Problem Description

Design a system that determines if parts are compatible with each other or with a specific vehicle/device. Like PCPartPicker for computers or AutoZone's "fits your vehicle" feature. Support complex compatibility rules and recommendations.

👤 Use Cases

1.
User wants to enters vehicle info so that sees only compatible parts
2.
User wants to adds part to cart so that system checks compatibility with other parts
3.
User wants to builds a PC so that gets warnings for incompatible components
4.
Admin wants to uploads fitment data so that parts catalog is updated

✅ Functional Requirements

  • Check if part fits specific vehicle/device
  • Check compatibility between multiple parts
  • Show compatible alternatives
  • Handle partial compatibility (may require adapter)
  • Bulk compatibility data import

⚡ Non-Functional Requirements

  • Compatibility check < 100ms
  • Support 10M parts
  • Handle 10K compatibility checks/sec
  • Data freshness < 24 hours

⚠️ Constraints & Assumptions

  • Fitment data comes from multiple sources
  • Some compatibility rules are complex (if X then Y unless Z)
  • Must handle OEM and aftermarket parts

📊 Capacity Estimation

👥 Users
1M DAU on e-commerce site
💾 Storage
50GB (parts) + 500GB (compatibility mappings)
⚡ QPS
Reads: 10K/sec, Data imports: nightly batch
📐 Assumptions
  • 10M unique parts
  • 100M compatibility mappings
  • Average part compatible with 50 vehicles/devices

💡 Key Concepts

CRITICAL
Graph Relationships
Parts and vehicles as nodes, FITS/COMPATIBLE_WITH as edges.
HIGH
Compatibility Matrix
Pre-compute and cache common vehicle-to-parts mappings.
HIGH
Rule-based Compatibility
Some checks need logic: RAM speed must match motherboard.

💡 Interview Tips

  • 💡Start with the graph data model
  • 💡Discuss the fitment relationship types
  • 💡Emphasize the caching strategy
  • 💡Be prepared to discuss data quality
  • 💡Know the tradeoffs between graph and relational
  • 💡Understand the automotive parts domain