The default sniper rifle deals 50 damage un-charged, and 150 damage when fully charged. It takes 1.5 seconds to reload the sniper rifle after the first shot, and a further 3.3 seconds to fully charge it. A level 3 sentry has 216 hit points.
The quickest way to destroy a level 3 sentry is one fully charged shot, followed by a one-sixth charged shot. It takes 3.3 seconds to fully charge one shot (150 damage), 1.5 seconds to reload, and 0.528 seconds to charge it 16% of the way (66 damage), for a total of 5.328 seconds. Slightly slower is five uncharged shots, requiring four reloads taking a total of 6 seconds.
The quickest way to destroy a level 1 or 2 sentry is a series of quick shots. A level 2 sentry has 180 hit points, and will be destroyed by one charged shot and one quick shot (total 4.8 seconds) or four quick shots (total 4.5 seconds). A level 1 sentry has only 150 hit points and will be destroyed in one charged shot (3.3 seconds) or three normal shots (3 seconds).
If an engineer starts repairing the sentry, he can heal 105 damage per hit, every 0.8 seconds. If the engineer is continually healing his sentry, you can't fire the second shot quickly enough to destroy it. If he has no dispenser, he will run out of metal before you run out of ammo, but it will take around thirty seconds.
Alternate weapons: Two weapons are even faster than the default sniper rifle for taking out sentries. The Machina deals 173 damage instead of 150 when fully charged, and can take out a level 3 sentry in one charged hit plus one uncharged (4.8 seconds). The Sydney Sleeper charges 25% faster and can take out a level 3 sentry in 4.748 seconds.