IBM Interview Question

DSA question and cs fundamentals