Question library
Questions from real interviews. Drill any of them by voice in a couple of minutes, with an interviewer, a score and feedback.
What is the N+1 query problem in an ORM, and how do you solve it in Django?JuniorIn a SQLAlchemy application, a function returns an object from a repository, and accessing one of its related fields throws DetachedInstanceError. Why does this happen, and how should you organize session handling properly?Mid-levelThe order list page in the Django admin takes ten seconds to load, and the logs show hundreds of SQL queries per page load. What's going on, and how do you fix it?Mid-levelThe orders list page has started taking several seconds to load, and in the logs you see hundreds of near-identical SQL queries per HTTP request. What's going on, and how would you fix it?Mid-levelTell me about the N+1 query problem in the Django ORM. How do you find it, and which ORM tools do you use to fix it?SeniorDesign how a high-load Python service using SQLAlchemy works with PostgreSQL: dozens of instances, each with several workers. How would you organize the connection pools and the session lifecycle?Senior