A) 
The minimum speed of the electron occurs when the electron loses the maximum energy: this occurs when the electron excites the atom from 0.0 eV to 4.0 eV, because in this case the energy given to the atom is maximum.
The energy given by the electron to the atom is equal to the difference between the two energy levels:

This is equal to the kinetic energy lost by the electron:

where
m is the electron's mass
v is the final speed of the electron after the collision
is the speed of the electron before the collision
Solving for v, we find

B) 
The maximum speed of the electron occurs when the electron loses the minimum amount of energy: this occurs when the electron excites the atom from 3.0 eV to 4.0 eV, because in this case the energy given to the atom is minimum.
The energy given by the electron to the atom is equal to the difference between the two energy levels, so in this case we have:

And so, this time the final speed of the electron after the collision will be given by:
