Hong Kong people speak colloquial Cantonese, and write Standard written Chinese (SWC)
Just like Cantonese, Mandarin is a dialect. Both terms refer to spoken words only. The different between colloquial Mandarin and SWC is very small
Let me give you some examples
First the one with more commonality between all form:
Then the more localized phrases
(colloquial and written Cantonese): 淨係講唔去做/ 得把口
We use written Cantonese like "得把口" only in casual content like comic, gossip column or web chat. For official documents and formal text like news report or homework, we all use SWC
All Cantonese speakers acquired the ability to translate colloquial Cantonese to SWC in real time since childhood, and it had became a second nature to us.
If you wrote '我是中國人' on paper, I can choose to read it:
as SWC, and read '我是中國人'(ngo5 si6 zung1 gwok3 jan4)
as colloquial Cantonese and say '我係中國人'(ngo5 hai6 zung1 gwok3 jan4)
as colloquial Mandarin and say '我是中國人' (wo3 shi4 zhong1 guo2 ren2 ) if I know Mandarin and choose to read it as Mandarin
The fact is, Cantonese speech is the mix of colloquial Cantonese, classical written phrase (including frequent use of idioms) and Standard written Chinese
你噉做仲唔係 (colloquial Cantonese)
Translate it to SWC or Mandarin would be "你這樣做還不是借題發揮?"
Japanese using Chinese characters (kanji) do have knowledge of the meaning of those character, but they don't need to know the original Chinese pinyin. They use their Japanese pronunciations to read those kanji instead