X interview question

Solve this problem, demonstrating your thought process