"This is the friend to whom I have given the key."
Translation:Questa è l'amica a cui ho dato la chiave.
Chi is always who in a question (“who is ...?”). “The man, who...” is a completely different use of “who” translated as “che” (or “cui” if there is a preposition). “A chi” can only used in a question: “A chi hai dato la chiave?”
The hints are more like looking up a word in a dictionary, there may be different translations in different cases, it is up to you to decide which translation is the one you need in this case, if any at all.
In the question form, is it also okay to use 'a CUI hai dato la chiave?'
I'm trying to work out a rule: can I always translate 'whom' to 'cui' if I want to make it simple for myself (even if 'chi' is also an option in question form).
Or is the rule that 'cui' is only for 'whom' in statement form, and 'chi' is used in all other circumstances?