Serious Eats: We recommend buying individually frozen (IQF), head-off, peel-on shrimp for most preparations. But here is the advice for fresh first.
First off, you don't want any shrimp that smell like ammonia—this is a telltale sign of spoilage, and it's worth asking your fishmonger if you can take a sniff before buying. You'll also want to avoid shrimp that are limp, slimy, or falling apart, all of which are signs of decay.
A more advanced sign if you're buying head-on fresh shrimp: look for black spots on the head first, then the body. "That's a pretty good indicator that it's not at peak freshness," says Davis Herron, the retail director at The Lobster Place, one of New York's best seafood markets. The black spots are called melanosis; it's the result of the same oxidation process that turns your apples and avocados brown.
That display of "fresh" shrimp you see at the counter? Those are the same bags of frozen shrimp you find in the freezer that have simply been allowed to thaw out in the store before going on display. There's no way to know how long they've been there defrosted, so you're better off buying the frozen shrimp and defrosting them yourself at home where you have more control over the process and can guarantee that your shrimp don't spend too long out of the freezer before being cooked.
The one exception to the always-buy-frozen rule is when you have access to live shrimp, either fresh from the ocean, or stored in tanks at the shop. In those cases, cook the shrimp as soon as possible after purchasing for best flavor and texture.
Frozen shrimp should always be thawed before cooking. To thaw frozen shrimp take them out of their bag and place them in a bowl under cold (not warm) running water. They'll be good to go in just a few minutes.
Unless you can get your shrimp live you're better off going with the headless version.
Shell-on shrimp are what we recommend. Shelled shrimp are often mangled and unappetizing. Shell-on shrimp also tend to be much cheaper. Finally, those shells pack a sweet, flavorful punch, whether you grill the shrimp directly in the shell, or use the shells to add flavor to the final dish like in this Spanish-style shrimp.
"Pre-cooked" shrimp should almost universally be labeled "overcooked" shrimp. They're usually rubbery and bland, and since they're already cooked, offer no room for flavor improvement and will end up dry when added to dishes. Leave them be.
Pink and white shrimp are a bit tastier than Gulf brown shrimp but fresher is better if you go down to the docks on Galveston Bay. Large Tiger Shrimp escaped from growers are now also caught off the United States coast. Rock Shrimp are deep cold water variety more like lobster.
At the end of the day, stick with labels stating that an independent organization has examined and approved of the shrimp if you want its provenance, sustainability, and authenticity assured if you buy from a market or grocery store.