Microsoft Interview Question

Please implement a memory allocate function