Ekata interview question

How would pivot if X happened