Everyone knows Facebook is one of the most desirable places to work, so how to get a job with the company is a question on many minds.

CEO Mark Zuckerberg answered it at a town hall Q&A in Barcelona this week, where he was attending the city's Mobile World Congress tech event.

To attract employees, he said the company is firm about its message and seeks those who agree with it.

"We have a very strong opinion on the change we want to create in the world," Zuckerberg, 30, said. "We believe that the world will be better when everyone has the ability to share what they think and to be able to connect with their friends and to be able to connect with the whole world."

As for how he selects employees, he said, "I will only hire someone to work directly for me if I would work directly for that person."

Meaning, if the prospective employee seems like a good employer, they are a sound choice.

Facebook COO Sheryl Sandberg and Javier Olivan, vice president of growth and analytics, who moderated the Q&A, for example, fit that rule.

"I would just learn so much," working for them, hypothetically, Zuckerberg said.