This is a standard textbook problem:
A bullet of mass m and speed v embeds in a block of mass M suspended by a string.
The block and bullet, of total mass m+M, then moves as a pendulum and the maximum height it reaches can easily be measured. This apparatus ca be used to measure the speed of the bullet. In this applet, you can change the initial speed and find of the maximum height it reaches. Does it get heighter with heigher bullet speed? What if the bullet pass through the box?
The force between bullet and the box is assumed to be a fixed value in this simulation.
Is this a good assumption?