Bonami Interview Question

How does useMemo/useCallback work (hooks generally aswell)