Walmart interview question

What's the difference between composition and inheritance? The coding question was about manipulating data