Is kaum and knapp the same ?
Definitly not, but it's difficult to explain:
"KAUM" is an adverb. It means hard to hit something. "ich habe KAUM geschlafen" = "I could HARDLY sleep" or "sie war KAUM aus der Tür, als das Telefon klingelte" = "the phone rung, BARELY after she quit the door"
"KNAPP" is an adjectiv. That means it is not much left on sth (amound + time). "das Geld ist äußerst KNAPP" = "I'am very SHORT of money" or "ich habe KNAPP den Zug erwischt" = "I only BARELY caught the train."
I hope this could help, I think with practising that you will get it.
They maybe synonyms in specific context (for example with quantities) but, in most cases they cannot substutute one another. You have to learn these in context. It s the fastes way to develop a feeling for the usage of these words. In case of doubt in most cases of adverbial use ”kaum” is the better and safer choice. if knapp is used as an adjective, it can never be substituted by kaum.