"To whom did you give it", ignoring the "whom", sounds like something that might be generated by a robot trying to imitate the English language.
That contortion of a sentence comes from the old Prescriptivist rule "never end a sentence with a preposition". Never mind that it leads to such odd sentences as that, and a loss of clarity.