DXC Technology Interview Question

factory method