Diagnal interview question

When to use useMemo and useCallBack ?