A basic rule of thumb is that the tank (width + length) shoule be AT LEAST as long as the length of the corn snake.
For a 4 months old, a 10 gallon tank should do find (assuming the snake has a normal growth...some have super fast growth....
I would assume that a yearling with a 20 gallon long tank would do good!
Good Luck and Happy Herping!