Took me a few seconds to parse the question (that it was about "35 factorial" and not about some binary representation of "35" ended with interrobang "?!")
Took me a while to figure out where the "extra" 8th zero came out.... namely 25. That there are at least 7 zeros is evident, since 5 and 2 is needed for each 0, and 5s are more scarce than 2s in 35!
Prime p (e.g. 5) occurs exactly k times in factors of n! .
k being a sum from 1 to m of a sequence whose term is [n / p^m] ([] meaning taking inteer part) where m is such that p^m =< n that is m being the integer part of logarithm base p of n.
In this example
[log5(35)] = 2
so
k = [35/5^1] + [35/5^2]
Sory for bump-posting, but I had perfectly nothing better to do.
It's basically an honesty test, since the interviewer explicitly says not to use paper or a calculator (which would include Excel). Quants are given harder questions, and I doubt that a trader would be dinged for not knowing the correct approach, since it's not a brainteaser that would correlate highly to trading acumen. But the Excel answer (14, I believe) is a very wrong one.
Python is correct. It's promoting to bignum, while the others are using floats, presumably, and passing them off as integers. I think they ought to display 1.0333147966386144e40.
Your average wannabe-banker/Wharton undergrad has never heard of Python, however, but has used Excel. Quants are familiar with Python, but they get harder problems.
Most quants don't, however, get to use Python. For some inexplicable reason, a lot of them are mired in C++, of all languages, and tend to be poor-to-mediocre programmers. There are exceptions, though; the one I worked at used an FP language and had excellent programmers.
I think they ought to display 1.0333147966386144e40.
Actually, they did show the result by default as floats in scientific notation, it was me who changed number display options for easier visual comparison.
I assumed quants preferred C++ because of performance. When I occasionally have to go back from Python to C/C++, I'm surprised much faster it is.
The very not-smart people would try to use Excel for this, and get hilariously (and obviously) incorrect results due to rounding errors.