Siemens Interview Question

Why do we use gates and Flip Flops?