Autofocus systems, as good as they are these days, aren't perfect. A modern camera's AF is a complex opto-electro-mechanical system, and while they are manufactured to incredible tolerances, there is usually some final calibration that must be done by the photographer to account for the quirks of his particular equipment. Here's how to do that calibration.
First up: How would you know if your AF system is off? Chipmunks! They're small and fairly high-contrast (so you know what your focus point should be hitting), they like dark areas (so you shoot them wide-open at f/2 or so, where depth of field is at a minimum) and they're usually set against complex backgrounds (so you'll be able to see whether your focus is in front of or behind the critter).
In the (cropped) photo above, the AF point was centred on the chipmunk's eye, but the focus plane ended up about five centimetres behind him. (By the way- you're not required to use chipmunks for this. Anything small and high-contrast, shot wide-open against a complex background, will work.)
To correct this, we'll take a few test shots under controlled conditions, then tell the camera what the error in the focus system is with that particular lens. We want a finely pointed object for the AF sensor to find, and we want a textured background so we can see where the focus plane ends up. A fork sitting on a couch will do nicely:
The procedure, which takes only a few minutes, is:
- Set the aperture near wide open (f/1.8 in this case) to minimize depth of field, and set the shutter fast enough to eliminate motion blur. Use only the centre focus sensor, and set the resolution to maximum. Leave the UV filter in place if you normally shoot with it; don't use the filter if you normally shoot with a bare lens.
- Focus on your sharp pointy object- in this case, I had it target the highlight on the first tine of the fork- and take a picture.
- Zoom way in on the centre of the picture. Is the point of sharpest focus in line with the tine of the fork, or is it in front of (or behind) the target point?
- Pull up the camera's AF Fine-Tune menu. (On Nikon DSLRs, it's in Menu > Setup > AF fine tune > Saved value.) If it focused behind your target, dial in a few points of negative AF fine-tune (i.e. move the marker closer to the camera).
- Try the exact same shot again, zoom in, and repeat as necessary.
The camera maker can't do this for you; the point of AF fine-tuning is to correct for the manufacturing tolerances in your particular combination of lens and body. Your 35mm f/1.8 and your D7000 will probably yield a different value than my 35mm f/1.8 on my D7000. With most cameras, you only have to do this when you buy a new lens; the camera should remember that lens the next time you use it.
Having to measure and set an AF fine-tune value for each lens is normal and expected. A lens is not defective simply because it has a slight back or front focus bias. And it's not uncommon to find a slightly different result at f/1.4 versus f/2, or when zoomed to wide-angle versus telephoto, or when looking at very close versus very distant subjects. However, if such a bias cannot be corrected as I've described here even with the AF fine-tune control maxed out, the lens was almost certainly built incorrectly, and no reasonable camera store would refuse an exchange in this case.