Broadcom interview question

implement coding techniques