You can remember the meaning of 公主 with this easy mnemonic:
The public (公) mainly (主) favors the princess over the prince. They think the prince is more spoiled.
Using mnemonics to remember the meaning of Chinese characters like can have an enormous impact on how long to learn Mandarin it takes.