X Interview Question

Solve this problem, demonstrating your thought process