There are a couple of snakes that could fit the description you have given, the most likely contenders are the Eastern Black King Snake or the Speckled King Snake.
Which specific snake it is will depend on where you live and a few other recognizable traits. To find the most accurate description of the snake it is worth taking a photograph and uploading it onto a snake forum where the image can be viewed by experts.
The eastern black king snake is found quite commonly across the south of the United States and in Mexico. They can be found in open areas and tend to look for oak woodland, abandoned farms, desert and areas with stagnant water. Adult snakes can reach up to 78 inches in length and the biggest has been recorded at eight and a half feet long.
They are often glossy black, blue black or dark brown and, as adults, have white rings. The baby form has not yet developed these rings and they often look like yellow spots. The snakes are harmless and are very popular with collectors.
Another sub species of the king snake, the speckled king snake can be found in similar locations to the Eastern Black. However it does tend to prefer wetter habitats and is mostly found between Iowa and the Gulf of Mexico. Sometimes referred to as the 'salt and pepper' snake, the Speckled King Snake is black with a yellow or white speckle on every scale. The snake is harmless and quite docile, this makes it a preferred pet by many.
While the snake that you have described could be either of the two above, if you live along the very south coast of America it is most likely that you have spotted a Speckled King Snake.