I think French is correct, and this is the Hitchhiker's Guide to the Galaxy.
Fenchurch is probably who you are thinking of, but she wasn't distracted, and didn't necessarily know the Answer to Life, the Universe, and Everything. The Question cannot be known in the same universe as the Answer, as is explained by Prak (who knows everything in the universe because he took a truth serum). In the latter part of the fourth book, Arthur and Fenchurch seek to find God's last message to his creation, which the pair believe might be what Fenchurch is looking for. Indeed, when they finally reach the location of the words and Fenchurch reads it, she says "yes, that was it", in response to the message. This website suggests an interpretation I hadn't thought of, which is that the message is different for everyone (I don't really buy this intepretation). The message as read by Marvin is
"We apologize for the inconvenience" Which isn't really a question or answer.
As for a man getting distracted, you might be conflating Fenchurch with the most powerful man in the universe (from the third book). Since the president of the galaxy is the last person who should actually rule, the person with all the power is someone who doesn't give a crap. This person is unnamed, and lives in a cabin alone on a planet with his cat. He gets distracted very easily. People from the government come to him and asks him questions, which he promptly forgets about. I believe this is what you are remembering.
I can speak with some authority on this subject.