Microsoft Interview Question

they asked two DSA question