Production databases occasionally slow down because one user or application is running expensive queries, opening too many sessions, or holding locks. Interviewers want to know whether you can diagnose the issue quickly and respond safely.
Explain how you would identify a single user generating heavy load on a PostgreSQL database and how you would stop that activity. Your answer should cover:
Focus on practical PostgreSQL operations rather than generic database theory. A strong answer should mention specific views such as pg_stat_activity, lock inspection, and the operational trade-offs of pg_cancel_backend() versus pg_terminate_backend().