Diagnal Interview Question

When to use useMemo and useCallBack ?