Material Interview Question

Basic Javascript Questions about Higher Order Functions and asked to code it.