Which is the more correct interpretation of Он до полночи думал над проблемой:
1) He was thinking about the problem until midnight.
2) He was thinking about the problem for half the night.
My guess is 1, because до is followed by the genitive case, and the genitive of полночь (midnight), is полночи.
But there is also the word полночи (half a night), so maybe 2 is correct.