AMFG interview question

How does reduce function work?