“I‘m just lucky to be alive.” Mark Zuckerberg, the 22-year-old founder and CEO of social-networking site Facebook, is talking about the time he came face-to-face with the barrel of a gun. It was the spring of 2005, and he was driving from Palo Alto to Berkeley.

Just a few hours earlier, he had signed documents that secured a heady $12.7 million in venture capital to finance his fledgling business. It was a coming-of-age moment, and he was on his way to celebrate with friends in the East Bay. But things turned weird when he pulled off the road for gas. As Zuckerberg got out of the car to fill the tank, a man appeared from the shadows, waving a gun and ranting. “He didn’t say what he wanted,” Zuckerberg says. “I figured he was on drugs.” Keeping his eyes down, Zuckerberg said nothing, got back into his car, and drove off, unscathed.

Today, it is an episode that he talks about only reluctantly. (A former employee spilled the beans.) But it fits the road he has taken–an adventure with unexpected, sometimes harrowing, moments that has turned out better than anyone might have predicted.

Zuckerberg’s life so far is like a movie script. A supersmart kid invents a tech phenomenon while attending an Ivy League school–let’s say, Harvard–and launches it to rave reviews. Big shots circle his dorm to make his acquaintance; he drops out of college to grow his baby and Change The World As We Know It. Just three years in, what started as a networking site for college students has become a go-to tool for 19 million registered users, including employees of government agencies and Fortune 500 companies. More than half of the users visit every day. When a poorly explained new feature brought howls of protests from users–some 700,000–the media old and new jumped to cover the backlash. But Facebook emerged stronger than ever. According to comScore Media Metrix, which tracks Web activity, it is now the sixth most-trafficked site in the United States–1% of all Internet time is spent on Facebook. ComScore also rates it the number-one photo-sharing site on the Web, with 6 million pictures uploaded daily. And it is starting to compete with Google and other tech titans as a destination for top young engineering talent in Silicon Valley. Debra Aho Williamson, a senior analyst at eMarketer, says it is on track to bring in $100 million in revenue this year–serious money indeed.

Yet there is an undercurrent of controversy about whether Mark Zuckerberg is making the right decisions about the juggernaut he has created. Late last year, a blog called TechCrunch posted documents said to be a part of an internal valuation of Facebook by Yahoo. The documents projected that Facebook would generate $969 million in revenue, with 48 million users, by 2010. The New York Times and others reported that Yahoo had made a $1 billion offer to buy Facebook–and Zuckerberg and his partners had turned it down. This followed an earlier rumor of a $750 million offer from Viacom. Yahoo, Viacom, and Facebook would not comment on the deal talk (and they still won’t). But Silicon Valley has been abuzz ever since.

“It’s all been very interesting,” deadpans Zuckerberg, sitting in a conference room in Facebook’s Palo Alto headquarters. He looks every bit the geek in his zippered brown sweatshirt, baggy khakis, and Adidas sandals. He came into the room eating breakfast cereal from a paper bowl with a plastic spoon. He still lives in a rented apartment, with a mattress on the floor and only two chairs and a table for furniture. (“I cooked dinner for a girlfriend once,” he admits at one point. “It didn’t work well.”) He walks or bikes to the office every day.

Zuckerberg’s college-kid style reinforces the doubts of those who see the decision to keep Facebook independent as a lapse in judgment. In less than two years, the two reigning Web 2.0 titans have sold out to major corporations: MySpace accepted $580 million to join News Corp., and YouTube took $1.5 billion from Google. Surely any smart entrepreneur would jump at a chance to piggyback on those deals.