2 Questions that were asked at Amazon for a SW Engineer position:

1 - You should write malloc32+free32 function:

* malloc32 should always returns an address that is dividable by 32.

* you can't use (modulus operator) %.

* free32 should free the whole allocated space.

* Time Complexity and space Complexity should be O(1)

* assumption: Time and Space Complexity of malloc is O(1).

2 - given a string you should reduce the number of adjacent spaces as follows:

* if there is more than 1 consecutive spaces it should be reduced to one.

* if there is 1 or 0 space it should stay the same.

Time complexity: O(n)

Space complexity: O(1)