The original version of this puzzle was published in What Is the Name of This Book? written by mathematician and logician Raymond Smullyan:
There are three guardians, A, B and C. Their names are Knight, Knave and Chaos. Knight always speaks truly, Knave always lies. Chaos tossed a coin this morning to decide whether today he would behave like Knight or like Knave.
Your task is simple: ask three yes-no questions, and determine which is Knight, which is Knave, and which is Chaos.
There is, alas, a complication: the guardians understand English but will answer in the local language, in which “Da” means yes and “Ja” means no. Or possibly “Ja” means yes and “Da” means no – you cannot remember. [source]
Note that the three guardians know each others’ identities (but they may not know whether Chaos has decided – based on his coin flip in the morning – to speak truth or lie.)
Also, it could be that some guardian gets asked more than one question (and hence some guardian is not asked any question at all.)
I have posted a (big) hint in the comment section.