Let’s say total number of beer bottles in box are x. then we can say

x = 4m + 4, where m is integer greater than or equal to 0.

x = 5n + 3, where n is integer greater than or equal to 0.

From above two eequations

4m+4 = 5n + 3 = x

=> 5n – 4m = 1, where m and n are integers greater or equal to 0.

For bottles to be minimum, lets assume m and n are 0

thus from above equation 0 = 1, which is not true, so they cant be both 0 at same time.

If you observe neither of them can be zero at a time, so Now lets take next case where m and n are 1.

5m -4n = 1

5 – 4 = 1

1 = 1, which is true

thus total number of bottles are 5+3 or 4 + 4, i.e. 8

and if divided between 7 friends, 1 bottle will be extra.