This paper considers two minimal-time control problems for a mechanical system that consists of a material point and an obstacle interacting with each other through a spring with elastic or viscoelastic properties. The interaction interval is determined by physical conditions of contact. It is studied how interaction time and the coefficient of restitution depend on the viscoelastic properties of the spring. A program module is developed in Python and the behavior of this material point-obstacle system is simulated.