Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "<stdin>", line 2, in one_true_addition_test_case
AssertionError
The "correct" answer according to my pet parrot is (5).__add__(6). Of course, as per real-life, "correct" is usually just an aspect of if you find the interviewer's solution instead of whether your solution is actually correct. Better luck next time!
The sum built-in is still using the addition operator with syntactic sugar though (as is the other child comment). I think the intent of this question is to solve it with bitwise operators ie, [1].
If you're going to have to argue about the 'intent of the question' then you've already lost.
Really, the question should be 'add these two integers' and any solution that produces the result in a transparent and straightforward way should be honored with top marks.
Trick questions, especially those where only the interviewers pet solution is permitted are a sure sign that this employer is best avoided because they care about form and ego more than they care about getting the bloody job done.
The problem is that the multiplication blows the precision of the used format (either double for math.log(...) or the one the decimal module uses).
I had also thought about the intention of the question trying to get you to express the sum as bit operations (thought I admit that sounds like going for a very low-level profile), or maybe just "thinking outside the box".