Taking out hard drive from laptop before giving it for upgrade/repair
No, if your hard drive is a standard model, there's no way to protect its contents when someone gains physical access to it by giving it away.
If the shop is updating your ram and/or replacing the battery, there's no need for them to have the hdd in the laptop. You should remove it before giving it away.
There's the possibility of applying a full disc encryption or encrypted partitions storing your data, but since you're asking my guess is it's easier, for now, to simply remove the drive. The process of having your data encrypted on the drive differs with the operating system you're using and this whole process could be another question on superuser ;)
If the problem with the laptop is the memory or CMOS battery then taking the hard drive out shouldn't be a problem. However, if the problem lies somewhere else then who ever is doing the repair won't be able to tell. For example there may be an issue with the video drivers.
If they plug in a new hard drive it may work but when you get the machine back and replace your hard drive it may still fail to boot.
Are you worried that the repair company will format your hard drive? The only solution you have is to back up all of your data and make sure you have the means to reinstall any programs you have before sending it back.
You can do this by taking the hard drive out, putting it into an enclosure and plugging it into any other computer.
Talk to your repair company. As others have said, removing the hard drive is the only way to be certain that your data won't be modified or accessed. Although the work being done mainly involves hardware, having no hard disk may inhibit the repair company's ability to check that their work was successful. Then again, they may have ways of working round this (live CDs, for instance). Discuss their solution and how confident they are in it solving the problem with them.
As a compromise, there are some things you can do. At the lowest level of security, you could add a second (non-administrator) user account to your labtop and use your operating system's file permissions to prevent the second account from accessing any of your files. Only give the repair company the password for the second account. This won't prevent a concerted attack, but it will make idle snooping unlikely.
A more secure solution would be to encrypt any sensitive files with strong encryption. Either encrypt particular files (for instance, your address book) or your entire account. Again, only give the repair company the password for a secondary account.
The final, but most tortuous, solution would be to completely erase anything sensitive from your computer - again, either particular files or wipe the hard disk and put in a clean install of the operating system. Then when your computer comes back from repair you restore your files from backup (you are making one as a matter of course, aren't you? ;-)).