Sumtracker interview question

List ways to detect and mitigate n+1 query problem.