Is this D Flip Flop positive edge triggered or negative edge triggered?
Homework. Either it must be done to pass a course or you are trying to learn digital basics by yourself. Nobody would get things like this as a paid work. Some guidance is available.

Check what should Y be to make A follow X. Then think when the state of A is transferred to Q and what's needed to happen until Q can get changed again.
Another useful thing to know: Every circuit has some delay. For ex. the output of the inverter stays stable few nanoseconds after the input has changed. Also the output of the multiplexer changes few nanoseconds later than the inputs if the new input states should cause some change in the output. But the delay in a mux is longer than in an inverter due more complex circuit.  Without delays the circuit couldn't work nor understood.
Halt.