From that point on, Mr. Hammerbacher says, his career has been a matter of repeatedly following the smartest people in search of the best problems. Many of the sharpest math graduates from Harvard were going to Wall Street, and he did too.

He landed at Bear Stearns in the summer of 2005 — three years before it collapsed in the financial crisis. As a quantitative analyst, he built sophisticated computer models, mainly for mortgage securities. “On a single mortgage hedge,” he recalled, “we made or lost more in a day than my father made in a lifetime.”

He stayed at Bear Stearns less than a year, enjoying the intellectual challenge of the work, but ultimately finding it unsatisfying. “Our whole goal was to make the models more complex,” he said. “It was a really bad use of quantitative skills.”

Better problems, Mr. Hammerbacher believed, were on the horizon. He wanted to work for one of the Internet companies that were becoming natural laboratories for data science, and in 2006, he joined one of the most promising. It was a Silicon Valley start-up with fewer than 50 employees, including several people he knew from Harvard. He got a job at Facebook.

The social network was then a two-year-old company with sky’s-the-limit ambitions. Mr. Hammerbacher was 23, two years older than Mark Zuckerberg, Facebook’s founder and chief executive.

Soon after arriving, Mr. Hammerbacher decided he wanted to use Facebook’s data to improve its service. With a small team, he built software tools for gathering, analyzing and experimenting with data. Mostly, these were tests of what works best. For example, which page layout or feature change prompts users to spend more time on Facebook, or makes them more likely to send messages or post pictures.

One group of online users is shown the change being tested, and another group is not. This so-called A/B testing is routine now in website development, online advertising and marketing. At Facebook, it would become more sophisticated in the years after Mr. Hammerbacher left. But he played an instrumental role in starting it. “He laid the foundation for doing data analysis at scale,” said Itamar Rosenn, manager of data science infrastructure at Facebook.