Interrogative pronouns are real pronouns, they stand for something, even if this something is unknown. The thing they stand for can be a noun or an idea.
noun: Who has been eating of my plate? Who has slept in my bed?
The interrogative pronoun stands in this case for Snow White who at this moment is unknown to the seven dwarfs and who executes the action described by the verb. Even if the author of the action is unknown in this moment, the seven dwarf suppose that it is a single person because they use the third person singular. If the thing asked for is not a human being or better if it is presumed that it is not a human being what is used instead of who. What is also used if we ask for ideas, an amount of words.
idea: What shall we do with the drunken sailor?
In this case the answer can't be a single noun, but an idea. One must bring him to bed or give him something fat to eat.
Another distinction is to be made concerning the grammatical function. The noun as well as the idea can be the subject, the direct object, the indirect object and the genitive of the sentence.
supposedly a person
nominative: Who is there?
accusative: Whom do you see?
dative: To whom did you give it?
genitive: Whose shoe is it?
supposedly a thing / idea
nominative: What bothers you?
accusative: What do you see?
To the English who corresponds in Italian chi. Who / chi ask for the direct object and for the subject of a sentence. Together with the preposition to / a they are used to ask for the indirect object.
nominative: Chi ha bevuto dal mio bicchierino?
(Who has drunk out of my little glass?)
accusative: Chi hai visto?
(Whom did you see?)
dative: A chi hai dato il tuo libro?
(To whom did you give the book?)
genitive: Di chi sono queste scarpe?
(Whose shoes are these?)
If we want to be more accurate, something we don't want in general because it is useless, we could say that who / chi is used if we suppose that the subject or object we are asking for is a person because actually we don't know if the author is a person or a thing.
A: Chi ha mangiato la mia cioccolata?
B: Mi dispiace, Flips, il nostro cane.
A: Who has eaten my chocolate?
B: I apologize, Flips, our dog.
In English a special form is to be used if who is combined with a preposition: whom. That' s not the case in Italian. It is always chi.
Con chi sei andato al cinema?
=> With whom do you go to the cinema?
Per chi hai comprato tutto questo?
=> For whom did you buy all that?
Da chi lo hai saputo?
=> From whom did you learnt that?
Sometimes one could be inclined to think that the preposition a is used to ask for a direct object. That happens with verbs that add with different prepositions depending on the context.
Lo penso anche io.
That' s what I think as well.
Penso di fare tutto ciò che la gente si aspetta da me.
<=> I intend to do everything I am expected to do.
A chi pensi?
<=> Who dou you think?
The a in the sentence A chi pensi is not a marker for an indirect object (Ho dato il libro a lui) but part of the verb pensare (pensare a qualche cosa).
We are going to see in the following pages that the a chi is not a dative in this case, although it seems to be one.