Texas Instruments Interview Question

They asked basic dsa question