I don't think I can overstate this: Building, and keeping, a great team is the most important thing you do as CEO. That applies whether you're a five person start-up or a 50,000-head megacorporation. Having launched three companies, I can offer a few tips on hiring great people. I'll save the most important one for last, because you're not going to want to hear it.

Recommendations from close friends (or just hiring close friends) is the best way to start. When that supply is exhausted, switch to recommendations from existing employees. We constantly encourage our employees to refer their friends to Evernote and we pay a generous bonus if we wind up hiring a referred candidate.

Hire people smarter than you (or at least smarter about their particular job than you are). If you do this, not only will everyone be happier, but your employee-referrer pipeline will continue to bring in great candidates for years to come. Once you start hiring mediocre people, you can no longer trust their references.

Make them write. When I'm interviewing people, I like to give them a writing test. I ask them to write a few paragraphs in normal English, or whatever language they're going to be working in the most, about a topic I assign. I try to keep the topics short and useful. For example, I asked recent candidates to write a short letter to Evernote ambassadors (volunteers who help represent us to our users in particular verticals) to thank them for their service and invite them to our annual conference. I find that you can tell a lot more about a person's personality from a few paragraphs of their writing than from a lengthy verbal interview. Many people can pretend to be something they're not in person, but very few people can do so in writing.

Make sure they talk sense. Communication is the most important qualification for any position. Don't hire anyone who you can't completely understand, even if it's for a very technical job. This is a fast rule at Evernote.

Be generous with benefits that help your team get stuff done Assume that your employees want to be productive, and eliminate any obstacles that you can that stand in the way of their productivity. Buy your employees lunch, make sure they have the best equipment, be flexible in your work schedule, keep the spouses and families happy, etc. We've thought about this a lot at Evernote and have many benefits specifically structured to enhance productivity.

However, one thing about hiring  is more important than everything else put together:

The most important thing to know about hiring people is how to fire people.

This is unpleasant, but it's true. Don't hire anyone unless you're confident that you'll be able to fire them.

In a small company, one person in the wrong position can ruin the entire team. In a big company, one person in the wrong position can poison the culture, and recruit another 10,000 wrong people, and ruin the entire team. You will never, no matter how good you get at interviewing, be able to identify every wrong person before they get a job. Therefore, the only way to be confident when hiring people is being confident that you can fire them. Hopefully, you won't have to do it often. But you will have to do it.

When do you know whether or not you should fire someone? The truth is that by the time you're asking yourself that question, you should almost certainly fire them. By the time someone has screwed up enough that you're actually thinking about firing them, they've probably screwed up much more than you know. You're not going to find out the full extent of the problems they've caused until after they're gone.

In the past 20 years, I have never once regretted firing someone. I've never looked back on a close decision that resulted in someone getting fired and thought, "Maybe we should have kept that person." One hundred percent of the time, I look back on a close decision and think, "we should have fired him much earlier." I've often felt very bad about firing someone. Terrible, even. But I've never regretted it.

This is the sad but inevitable truth in firing people. If there is any doubt, there is no doubt.

How do you actually fire someone? Well, that varies a lot by country and industry, but I've found it best to be firm and direct and compassionate. Remember that you're not firing someone because they're a bad person. You're firing them because they are the wrong person for the job. There does not need to be any animosity between you and, as long as the employee behaves in a professional manner, the company should be fair with severance pay, benefits, etc.

Regardless of how long you prepare, firing someone is a deeply unpleasant process. It's especially bad if you follow my earlier advice and hire your close friends. Because, sooner or later, you'll wind up firing a close friend. And no matter what you both say, you probably won't be friends anymore.

This is worth repeating: almost every successful entrepreneur I know has had to fire a close friend at some point. This is probably the worst part of being an entrepreneur. The alternative is to never work with your friends in the first place, but that's much, much worse.

Look at it this way: if you're confident that you can fire one person, you can be much more confident about hiring lots of people. The knowledge that you can do one unpleasant thing gives you the freedom to do a hundred great things! You can give many people a chance that they would never have gotten otherwise. If you're good at hiring, most of those people will succeed, and they'll thank you for the opportunity.

And you'll make many new friends.