I have about three years of experience and an upcoming DevOps interview. The recruiter said I should prepare for SQL query design and optimization in addition to the usual DevOps topics. My SQL knowledge is limited, so I'm looking for the kinds of questions and concepts that are commonly tested, especially around writing efficient queries and understanding execution plans.
4 Answers
For a role asking about SQL, focus on practical fundamentals instead of memorizing interview questions. Review table design and normalization, primary and foreign keys, joins, aggregations, subqueries, common table expressions, transactions, and stored procedures. Building a small project with a few related tables will help you understand these much faster.
It’s worth clarifying how much SQL the position actually requires. If the expectation is production database ownership, that may be closer to a combined DevOps and database role. Still, a DevOps engineer should generally be comfortable querying operational data, troubleshooting slow queries, checking locks and connections, and understanding how application changes affect database performance.
For optimization, learn how to read an execution plan and understand why a database chooses a table scan instead of an index seek. Review clustered and nonclustered indexes, composite indexes, statistics, filtering early, avoiding unnecessary columns, and checking whether joins or sorts are expensive. Also understand SARGability—for example, applying a function or implicit conversion to a column in a WHERE clause can prevent an index from being used efficiently.
Common intermediate topics include window functions such as ROW_NUMBER and RANK, CTEs, different join types, CROSS APPLY, grouping, and handling NULL values. You should also be able to explain when an index helps, when it adds overhead, and how you would investigate a slow query using execution plans and query metrics.

That makes sense. I’ll prepare enough to troubleshoot and optimize common queries, while also asking the interviewer how much database ownership the role involves.