NVIDIA interview question

Implement simple malloc function.