Fortinet Interview Question

Paper coding question in C. Given a template like "int malloc(void* pointer, size_t ptr_size)", write a malloc implementation inside the function block. No external libraries allowed.