These hard interview questions do happen. That one was actually asked during an interview for an assistant vice president job at Barclays, according to job site, Glassdoor.com.

The point isn't to be a jerk or make you look stupid. It's to see how you think.

"It's their way of figuring out how you solve a tough problem," said Gayle Laakmann McDowell, author of "Cracking the Coding Interview" and the CEO of CareerCup.com, a site that helps engineers and other technical types prepare for this type of hard interview questions.

"It helps to see how someone thinks creatively, how they think analytically," said Rusty Rueff, a career and workplace expert for Glassdoor.com.

And, let's be honest, it helps weed out the people who buckle under pressure.

"They're worried that they'll get a candidate who is potentially very bright. Great grades. But when they're given a tough problem, they break down and cry," McDowell explained. "The want a candidate who sees a tough challenge and says, "OK, I can do that."

With that nine balls question above, there is a correct answer, McDowell explains: In the first step, you divide the balls into sets of three and weigh all three sets. One of those sets will be lighter, so now you know it's one of those three. In the second step, you weigh two of the three balls. If one weighs less, you now that's the light ball. If they're equal, you know it's the ball you didn't weigh. That's it — done in two steps!

Of course, there isn't always a right answer, such as in this question: Why are manhole covers round?

This is a favorite question asked at Microsoft. Brian Groth, an advertising executive at Microsoft, who says he's asked this question in an interview, admits that he doesn't actually know the right answer — he asks it just to loosen up and have some fun!

For the record, the scientific answer is "so they won't fall in the hole." A square cover, if tilted, could fall into a square hole. Other possible answers include "because they're heavy and that way you can roll them" or, if you're feeling cheeky, "because the hole is round!"

The only wrong answer to these hard questions, Rueff says, is to say "I don't know" — and just leave it at that.

"Just take a big deep breath, slow way down and then think it through out loud," he suggests.

Say you're asked how many bicycle tires are sold in China each year, he said, offering this rationale: Let's imagine there's a billion people in China. Of those billion people, let's imagine half of them own bicycles — that's 500 million. If you figure that once every five years they have to change their bicycle tires. … That's 100,000 bicycle tires a year," he said. Then, he remembers that there are two tires on every bike: "OK, that's 200,000 bicycle tires a year."

More from CNBC

"The first thing is to start with brute force," she said. "Talk out loud. Don't expect perfection. When you're solving it, just start looking for rules and look for patterns."

Take the question: If you had two 6-sided dice, what is the probability you'll get a 7? That was a question asked at an interview for a job in the Portfolio Analytics Group at BlackRock, according to Glassdoor.

Every number, 1-6, can be combined with another number to reach 7, she explains. If there are 6 sides on that second die, then that means there are 6 ways you can get a sum of 7. Consider that 6 times 6 is 36, and out of those 36 permutations, there are six ways to reach 7. So 6 out of 36 makes the probability 1:6.

"It's not too hard," McDowell said.

"Most of these questions can be broken down into a few categories: Quant, information, psychological and just plain weird," said Marie McIntyre, a career coach and the author of "Secrets to Winning at Office Politics."

So, they may ask you a question like, "Why was your GPA not a 4.0?"

That was a question asked for a job as a wireless engineer at Apple.

"I got sucked into too many beer parties is probably not a good answer!" McIntyre quipped. A better answer is that you really dug your engineering classes, not so much with American history, she said.

"That says to the interviewer: 'I like the stuff that you do!'" she said.

Some of the questions try to test your toughness.

Consider: Who would you fire right now?

That was a question asked during an interview for a job as a marketing manager at Red Ventures, according to Glassdoor.

"I would fire the person who is performing at the lowest level with the lowest level of potential to grow in the company," Rueff said.

"Maybe all of these are, in some way, about self-awareness," Rueff said. "How do you stand on your own two feet when challenged?" he said. And, most importantly: "Do you have the perseverance to finish the questions?"

Then, there are just the wacky questions that, if nothing else, provide a little comic relief.

Questions like: "How many dogs would have the same exact number of hairs?" or "How do they get the Ms on M&M's?" Those were questions asked for a trader job at Capital Asset Exchange & Trading and for an attorney position at Wachtell Lipton, respectively.

The first one probably doesn't have an answer. The second does — they're printed on, according to Mars, which makes M&Ms.

Even if you don't know the answer, making a rational argument for why they're probably stenciled on, so you don't crush the M&M's, might've earned you some points.

Whatever you do, don't panic — and stay focused.

"Give an answer that shows some grace under pressure," McIntyre said. "And if you have a tendency to babble, get that under control before you go into the interview. When you're through saying what you want to say – just stop."

Hardest interview questions

Here are more than a dozen of the hardest interview questions submitted to Glassdoor.com from job applicants and which company asked them.

• What were your thoughts about Barack Obama's decision to bring a virtual academic to the stand for the Supreme Court?" Interview question for Senior Vice President at Accenture

•There are 9 balls one of which is lighter than the others. How would you find the lighter ball in 2 tries? Interview question for Assistant Vice President at Barclays Capital

•If you had two 6-sided dice, what's the probability you get a 7? Interview question for Portfolio Analytics Group at BlackRock

• How many dogs in the world have the same exact number of hairs? Interview question for capital equipment trader at Capital Asset Exchange & Trading

• Why was your GPA not a 4.0? Interview question for wireless engineering at Apple

• Having an infinite supply of water and two containers, one for 3 liters and one for 5 liters, how would you measure 4 liters? Interview question for a software development engineer at Amazon.com

• Who would you fire right now? Interview question for marketing manager at Red Ventures

• You have 200 Goldfish and 2 Piranhas. How many goldfish should the Piranhas eat to have 99% Goldfish in the tank? Interview question for field engineer at Schlumberger

• Three groups of different colored socks, something like 21 blue, 14 red, 18 green. If you're in the dark and can't see, how many socks will you need to pull out to make sure you get a matching pair? Interview question for junior trader at Simplex Investments

• How many barbershops are in America? Interview question for analyst at Digitas

• How many ball bearings, 1" in diameter, can you fit into a 747 aircraft? Interview question for senior trainer at SIAC

• A frog is at the bottom of a 30 meter well. Each day he summons enough energy for one 3 meter leap up the well. Exhausted, he then hangs there for the rest of the day. At night, while he is asleep, he slips 2 meters backwards. How many days does it take him to escape from the well? Interview question for financial software developer at Bloomberg LP

• Would you rather sell a deal for a large amount of money and walk away or receive less and have a partner for 10 years? Interview question for consultant business development at Gallup

• How do they get the M on M & M's?Interview question for attorney at Wachtell Lipton

For more information about reprints & permissions, visit our FAQ's. To report corrections and clarifications, contact Standards Editor Brent Jones. For publication consideration in the newspaper, send comments to letters@usatoday.com. Include name, phone number, city and state for verification. To view our corrections, go to corrections.usatoday.com.