Caterpillar Interview Question

they gave me an expression and asked me to implement it using flip flop.