He crammed at the eleventh hour, reviewing three books overnight.
Tips
history
The phrase appears in《红楼梦》ch. 70: '临阵磨枪,也不中用!' — the idea being that polishing your spear when the enemy is already at the gate is too late. The full proverb is sometimes 临阵磨枪,不快也光 ('even if it isn't sharp, at least it's shiny') — a wry note that last-minute prep at least looks like effort.
usage
Slightly negative — describes someone who didn't prepare in time. Pair it with exams (考试), interviews (面试), or competitions. Compare with 临渴掘井 (línkějuějǐng, dig the well only when thirsty), which is even harsher.