bp Interview Question

DSA question medium difficulty. and system design.