If I understand you correctly, you want to know how the person seemed to "read your thoughts", or at least how they knew what you were most likely to say. This kind of so-called telepathy is really just an old trick, and doesn't work all the time.
Before the colour-and-tool question was sprung on you, your mind was deliberately distracted by a different subject (maths). This tactic puts people off-guard and - I'm guessing - makes it more likely that they will not concentrate on the next question too much. This causes them to answer with the first thing that enters their mind. For example, "What do cows drink?" might be asked. The rushed answer would be "Milk."
The mind-reading part relies on the poser of the question already knowing what the most popular answer is. For colours, the most common choice is red, and for tools it is a hammer. David Blaine makes an excellent living performing this kind of trick on people, making them believe he is an angel and such, but even he gets it wrong sometimes.