Learn Composition — a key concept for LLD interviews.
Interactive — Try it yourself!
How to use
1See House and Room with a filled diamond (◆)
2Click "Delete House" — Room is destroyed too!
3Room cannot exist without House — dependent lifecycle
4This is the STRONGEST ownership relationship
In a nutshell
Composition is "owns" — child cannot exist without parent. House owns Rooms. Delete the House, Rooms are destroyed. Strongest relationship — child's lifecycle is tied to parent.