Onebill software interview question

Some random product related solution to be solved