Syfe Interview Question

lld design and quick question on basic dsa problem