In the absence of air resistance, the horizontal velocity of the ball remains constant throughout its motion. Therefore, the horizontal speed of the ball will be the same at any given time.
Given that the ball is projected horizontally from the top of a cliff with a speed of 40 m/s, its horizontal speed will remain 40 m/s after 3 seconds or any other time interval.
Hence, the speed of the ball 3 seconds later will still be 40 m/s.