Siemens Interview Question

How does inheritance work in programming?