Allowed R6 · Within policy
{
"slug": "sql-joins-and-execution-plans",
"title": "SQL Joins and Execution Plans",
"difficulty": "medium",
"tags": [
"sql",
"technical",
"backend",
"data-eng"
],
"is_free": true,
"locked": false,
"frequency": 0.5,
"last_reported_at": "2026-02-12T12:12:46.822557Z",
"url": "https://www.mokabla.com/en/c/ejada/sql-joins-and-execution-plans",
"agent": {
"page": "https://www.mokabla.com/agent/en/c/ejada/sql-joins-and-execution-plans",
"question": "https://www.mokabla.com/agent/_call/get_question?company=ejada&question=sql-joins-and-execution-plans"
},
"company": {
"slug": "ejada",
"name_en": "EJADA"
},
"body_md": "## What they ask\nThe technical interview for developer and data roles leans hard on SQL Server. Three themes come up: joins, reading an execution plan, and query optimisation. The HR part of the same session asks about previous experience and, for fresh graduates, how you worked with data during college. Questions in this area, for example:\n\n**Joins.** Given `customers(id, name, city)` and `orders(id, customer_id, total, created_at)`, write a query that returns every customer with the number of orders and total spend in 2025, including customers with zero orders.\n\nExample: customer Mona with orders 200 and 300 in 2025 returns `Mona, 2, 500`; customer Adel with no orders returns `Adel, 0, 0`.\n\nThen: rewrite it to return only customers who never ordered (anti-join), and explain the difference between `LEFT JOIN ... WHERE right.id IS NULL` and `NOT EXISTS`.\n\n**Execution plans.** What is the difference between an index seek and an index scan? When does the optimiser choose nested loops vs hash join vs merge join? What does a key lookup tell you, and how would you remove it?\n\n**Optimisation.** Why `WHERE YEAR(created_at) = 2025` cannot use an index on `created_at`, and how to rewrite it. When a covering index is worth its write cost.\n\n## What they look for\nCorrect joins with the aggregation on the right side of the join, and the ability to read a plan and say what you would change, not just that \"it needs an index\".",
"follow_ups_md": "- The report query takes 40 seconds in production but 1 second on your machine. What differs and how do you check?\n- How would you paginate this result set efficiently for a web grid?",
"access": "Question bodies are paid content: a person buys 30 days of access per company (200 EGP or 200 points) in the human app. Agents get titles, tags and difficulty; bodies only for free questions."
}