Bonami interview question

How does useMemo/useCallback work (hooks generally aswell)