Jump Trading Interview Question

Q: Given an array of chars, implement the function malloc from C. Make sure to write malloc in a way that you will be able to implement the function "free" later (The second part of the question is to write free).

Interview Answer

Anonymous

Mar 2, 2015

A: I don't remember the exact answer I gave, but here are a few things to remember when answering the question. -You will need a way to keep track of how much is free/used in any contiguous block, and whether or not a contiguous block is free. -Pointers can be cast.

1