Given:
The mass of the object is,

The speed of the object is,

The compression of the spring is,

To find:
The spring constant
Step-by-step explanation:
The kinetic energy of the box provides the potential energy of the spring.
If the spring constant of the spring be 'k', the potential energy is,

The kinetic energy of the mass is,

Now we can write,

Substituting the values we get,

Hence, the spring constant is 250 N/m.