Ooyala interview question

Write an algorithm for malloc and free.