<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Engineering Unfiltered | By Devrim on Medium]]></title>
        <description><![CDATA[Stories by Engineering Unfiltered | By Devrim on Medium]]></description>
        <link>https://medium.com/@devcommando?source=rss-bfebdff1bc27------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*zFThAygnbIsOpXzQwr8stA.png</url>
            <title>Stories by Engineering Unfiltered | By Devrim on Medium</title>
            <link>https://medium.com/@devcommando?source=rss-bfebdff1bc27------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Wed, 18 Nov 2026 02:58:13 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@devcommando/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com" rel="hub"/>
        <item>
            <title><![CDATA[I Found Our Customer Data in an AI Tool. My CTO Told Me to Keep Quiet]]></title>
            <description><![CDATA[<div class="medium-feed-item"><p class="medium-feed-image"><a href="https://medium.com/engineering-playbook/i-found-our-customer-data-in-an-ai-tool-my-cto-told-me-to-keep-quiet-1622670b47dc?source=rss-bfebdff1bc27------2"><img src="https://cdn-images-1.medium.com/max/1070/1*G2rbF5HspovS9VwlKunaOA.png" width="1070"></a></p><p class="medium-feed-snippet">The company had spent six months celebrating its AI transformation.</p><p class="medium-feed-link"><a href="https://medium.com/engineering-playbook/i-found-our-customer-data-in-an-ai-tool-my-cto-told-me-to-keep-quiet-1622670b47dc?source=rss-bfebdff1bc27------2">Continue reading on Engineering Under Pressure »</a></p></div>]]></description>
            <link>https://medium.com/engineering-playbook/i-found-our-customer-data-in-an-ai-tool-my-cto-told-me-to-keep-quiet-1622670b47dc?source=rss-bfebdff1bc27------2</link>
            <guid isPermaLink="false">https://medium.com/p/1622670b47dc</guid>
            <category><![CDATA[artificial-intelligence]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[startup]]></category>
            <category><![CDATA[technology]]></category>
            <category><![CDATA[software-engineering]]></category>
            <dc:creator><![CDATA[Engineering Unfiltered | By Devrim]]></dc:creator>
            <pubDate>Tue, 17 Nov 2026 21:18:55 GMT</pubDate>
            <atom:updated>2026-11-17T21:19:22.453Z</atom:updated>
        </item>
        <item>
            <title><![CDATA[Our CEO Fired 19 Engineers After an AI Demo. Six Months Later, He Fired the Guy Who Built It]]></title>
            <description><![CDATA[<div class="medium-feed-item"><p class="medium-feed-image"><a href="https://medium.com/javarevisited/our-ceo-fired-19-engineers-after-an-ai-demo-six-months-later-he-fired-the-guy-who-built-it-eacf85941228?source=rss-bfebdff1bc27------2"><img src="https://cdn-images-1.medium.com/max/1072/1*rHiKZD7CX-1tMsZB7NSxeQ.png" width="1072"></a></p><p class="medium-feed-snippet">The demo lasted eleven minutes. The layoffs took twenty minutes. The engineer who promised to replace half our team was the last person I&#x2026;</p><p class="medium-feed-link"><a href="https://medium.com/javarevisited/our-ceo-fired-19-engineers-after-an-ai-demo-six-months-later-he-fired-the-guy-who-built-it-eacf85941228?source=rss-bfebdff1bc27------2">Continue reading on Javarevisited »</a></p></div>]]></description>
            <link>https://medium.com/javarevisited/our-ceo-fired-19-engineers-after-an-ai-demo-six-months-later-he-fired-the-guy-who-built-it-eacf85941228?source=rss-bfebdff1bc27------2</link>
            <guid isPermaLink="false">https://medium.com/p/eacf85941228</guid>
            <category><![CDATA[artificial-intelligence]]></category>
            <category><![CDATA[technology]]></category>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[software-engineering]]></category>
            <category><![CDATA[programming]]></category>
            <dc:creator><![CDATA[Engineering Unfiltered | By Devrim]]></dc:creator>
            <pubDate>Tue, 17 Nov 2026 15:44:59 GMT</pubDate>
            <atom:updated>2026-11-17T15:44:59.797Z</atom:updated>
        </item>
        <item>
            <title><![CDATA[I Interviewed for a Software Engineer Job. The Interviewer Was Reading AI Answers]]></title>
            <description><![CDATA[<div class="medium-feed-item"><p class="medium-feed-image"><a href="https://python.plainenglish.io/i-interviewed-for-a-software-engineer-job-the-interviewer-was-reading-ai-answers-b8bf89da4f82?source=rss-bfebdff1bc27------2"><img src="https://cdn-images-1.medium.com/max/1056/1*DzlFjOqKJOlDKq7nEr6acA.png" width="1056"></a></p><p class="medium-feed-snippet">I spent three weeks preparing for a technical interview. Halfway through, I realized the person evaluating me couldn&#x2019;t explain his own&#x2026;</p><p class="medium-feed-link"><a href="https://python.plainenglish.io/i-interviewed-for-a-software-engineer-job-the-interviewer-was-reading-ai-answers-b8bf89da4f82?source=rss-bfebdff1bc27------2">Continue reading on Python in Plain English »</a></p></div>]]></description>
            <link>https://python.plainenglish.io/i-interviewed-for-a-software-engineer-job-the-interviewer-was-reading-ai-answers-b8bf89da4f82?source=rss-bfebdff1bc27------2</link>
            <guid isPermaLink="false">https://medium.com/p/b8bf89da4f82</guid>
            <category><![CDATA[artificial-intelligence]]></category>
            <category><![CDATA[technology]]></category>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[software-engineering]]></category>
            <category><![CDATA[programming]]></category>
            <dc:creator><![CDATA[Engineering Unfiltered | By Devrim]]></dc:creator>
            <pubDate>Tue, 17 Nov 2026 15:42:06 GMT</pubDate>
            <atom:updated>2026-11-17T15:42:06.827Z</atom:updated>
        </item>
        <item>
            <title><![CDATA[I Found Out My Replacement Earned $40,000 More. He Had Two Years of Experience]]></title>
            <description><![CDATA[<div class="medium-feed-item"><p class="medium-feed-image"><a href="https://medium.com/javarevisited/i-found-out-my-replacement-earned-40-000-more-he-had-two-years-of-experience-46aa33f508b3?source=rss-bfebdff1bc27------2"><img src="https://cdn-images-1.medium.com/max/1058/1*xDOATgkZVc7C55bFvr47VA.png" width="1058"></a></p><p class="medium-feed-snippet">I&#x2019;d spent eight years at the company, survived three layoffs, and trained the engineer who eventually took over my job. The salary&#x2026;</p><p class="medium-feed-link"><a href="https://medium.com/javarevisited/i-found-out-my-replacement-earned-40-000-more-he-had-two-years-of-experience-46aa33f508b3?source=rss-bfebdff1bc27------2">Continue reading on Javarevisited »</a></p></div>]]></description>
            <link>https://medium.com/javarevisited/i-found-out-my-replacement-earned-40-000-more-he-had-two-years-of-experience-46aa33f508b3?source=rss-bfebdff1bc27------2</link>
            <guid isPermaLink="false">https://medium.com/p/46aa33f508b3</guid>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[technology]]></category>
            <category><![CDATA[artificial-intelligence]]></category>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[leadership]]></category>
            <dc:creator><![CDATA[Engineering Unfiltered | By Devrim]]></dc:creator>
            <pubDate>Tue, 17 Nov 2026 15:39:08 GMT</pubDate>
            <atom:updated>2026-11-17T15:39:08.392Z</atom:updated>
        </item>
        <item>
            <title><![CDATA[I Applied to 63 Software Engineering Jobs. The Only Interview I Got Was With an AI]]></title>
            <description><![CDATA[<div class="medium-feed-item"><p class="medium-feed-image"><a href="https://python.plainenglish.io/i-applied-to-63-software-engineering-jobs-the-only-interview-i-got-was-with-an-ai-93bce0997121?source=rss-bfebdff1bc27------2"><img src="https://cdn-images-1.medium.com/max/1066/1*TMm2LRWbv4iOHW2zPhExlQ.png" width="1066"></a></p><p class="medium-feed-snippet">I had nine years of experience, a solid r&#xE9;sum&#xE9;, and references from people who had worked with me for years. Apparently, none of that&#x2026;</p><p class="medium-feed-link"><a href="https://python.plainenglish.io/i-applied-to-63-software-engineering-jobs-the-only-interview-i-got-was-with-an-ai-93bce0997121?source=rss-bfebdff1bc27------2">Continue reading on Python in Plain English »</a></p></div>]]></description>
            <link>https://python.plainenglish.io/i-applied-to-63-software-engineering-jobs-the-only-interview-i-got-was-with-an-ai-93bce0997121?source=rss-bfebdff1bc27------2</link>
            <guid isPermaLink="false">https://medium.com/p/93bce0997121</guid>
            <category><![CDATA[software-engineering]]></category>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[technology]]></category>
            <category><![CDATA[artificial-intelligence]]></category>
            <dc:creator><![CDATA[Engineering Unfiltered | By Devrim]]></dc:creator>
            <pubDate>Tue, 17 Nov 2026 15:36:13 GMT</pubDate>
            <atom:updated>2026-11-17T15:36:13.955Z</atom:updated>
        </item>
        <item>
            <title><![CDATA[Our CEO Ranked 46 Engineers by AI Productivity. The Results Started a War.]]></title>
            <description><![CDATA[<div class="medium-feed-item"><p class="medium-feed-image"><a href="https://medium.com/javarevisited/our-ceo-ranked-46-engineers-by-ai-productivity-the-results-started-a-war-b48d15477113?source=rss-bfebdff1bc27------2"><img src="https://cdn-images-1.medium.com/max/1070/1*ZdQpWxCa-Aw0C7VUKPBOoA.png" width="1070"></a></p><p class="medium-feed-snippet">Software engineers, data scientists, and ML engineers were put on the same leaderboard. The highest-ranked employees got bonuses. Three&#x2026;</p><p class="medium-feed-link"><a href="https://medium.com/javarevisited/our-ceo-ranked-46-engineers-by-ai-productivity-the-results-started-a-war-b48d15477113?source=rss-bfebdff1bc27------2">Continue reading on Javarevisited »</a></p></div>]]></description>
            <link>https://medium.com/javarevisited/our-ceo-ranked-46-engineers-by-ai-productivity-the-results-started-a-war-b48d15477113?source=rss-bfebdff1bc27------2</link>
            <guid isPermaLink="false">https://medium.com/p/b48d15477113</guid>
            <category><![CDATA[artificial-intelligence]]></category>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[technology]]></category>
            <category><![CDATA[productivity]]></category>
            <category><![CDATA[programming]]></category>
            <dc:creator><![CDATA[Engineering Unfiltered | By Devrim]]></dc:creator>
            <pubDate>Tue, 17 Nov 2026 15:33:13 GMT</pubDate>
            <atom:updated>2026-11-17T15:33:13.429Z</atom:updated>
        </item>
        <item>
            <title><![CDATA[I Stopped Fixing My Team’s Problems for 30 Days. My Manager Didn’t Like What Happened]]></title>
            <description><![CDATA[<div class="medium-feed-item"><p class="medium-feed-image"><a href="https://medium.com/engineering-playbook/i-stopped-fixing-my-teams-problems-for-30-days-my-manager-didn-t-like-what-happened-ad08f0f86896?source=rss-bfebdff1bc27------2"><img src="https://cdn-images-1.medium.com/max/1072/1*BboBJ8Hv72vivlHVlFeIGQ.png" width="1072"></a></p><p class="medium-feed-snippet">For six years, I was the engineer everyone called when something broke. My teammates got promoted, my own projects kept slipping, and my&#x2026;</p><p class="medium-feed-link"><a href="https://medium.com/engineering-playbook/i-stopped-fixing-my-teams-problems-for-30-days-my-manager-didn-t-like-what-happened-ad08f0f86896?source=rss-bfebdff1bc27------2">Continue reading on Engineering Under Pressure »</a></p></div>]]></description>
            <link>https://medium.com/engineering-playbook/i-stopped-fixing-my-teams-problems-for-30-days-my-manager-didn-t-like-what-happened-ad08f0f86896?source=rss-bfebdff1bc27------2</link>
            <guid isPermaLink="false">https://medium.com/p/ad08f0f86896</guid>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[software-engineering]]></category>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[technology]]></category>
            <category><![CDATA[artificial-intelligence]]></category>
            <dc:creator><![CDATA[Engineering Unfiltered | By Devrim]]></dc:creator>
            <pubDate>Tue, 17 Nov 2026 15:31:22 GMT</pubDate>
            <atom:updated>2026-11-17T15:31:40.368Z</atom:updated>
        </item>
        <item>
            <title><![CDATA[I Failed 7 Staff Engineer Interviews in 45 Days. The Eighth Exposed My Biggest Weakness]]></title>
            <description><![CDATA[<div class="medium-feed-item"><p class="medium-feed-image"><a href="https://medium.com/engineering-playbook/i-failed-7-staff-engineer-interviews-in-45-days-the-eighth-exposed-my-biggest-weakness-c56024d98c6b?source=rss-bfebdff1bc27------2"><img src="https://cdn-images-1.medium.com/max/1070/1*nTYnbVtPJwUqq2nOurtfDQ.png" width="1070"></a></p><p class="medium-feed-snippet">I had 12 years of experience, a Staff Engineer title, and a salary most developers would consider a success. Seven companies rejected me&#x2026;</p><p class="medium-feed-link"><a href="https://medium.com/engineering-playbook/i-failed-7-staff-engineer-interviews-in-45-days-the-eighth-exposed-my-biggest-weakness-c56024d98c6b?source=rss-bfebdff1bc27------2">Continue reading on Engineering Under Pressure »</a></p></div>]]></description>
            <link>https://medium.com/engineering-playbook/i-failed-7-staff-engineer-interviews-in-45-days-the-eighth-exposed-my-biggest-weakness-c56024d98c6b?source=rss-bfebdff1bc27------2</link>
            <guid isPermaLink="false">https://medium.com/p/c56024d98c6b</guid>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[technology]]></category>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[leadership]]></category>
            <category><![CDATA[software-engineering]]></category>
            <dc:creator><![CDATA[Engineering Unfiltered | By Devrim]]></dc:creator>
            <pubDate>Tue, 17 Nov 2026 15:29:17 GMT</pubDate>
            <atom:updated>2026-11-17T15:29:33.332Z</atom:updated>
        </item>
        <item>
            <title><![CDATA[I Interviewed 12 Senior Engineers. Only 2 Could Debug This Production Failure.]]></title>
            <description><![CDATA[<div class="medium-feed-item"><p class="medium-feed-image"><a href="https://python.plainenglish.io/i-interviewed-12-senior-engineers-only-2-could-debug-this-production-failure-abe5186147e5?source=rss-bfebdff1bc27------2"><img src="https://cdn-images-1.medium.com/max/1072/1*XvPRkc-dJ2UOcbklFs9v3g.png" width="1072"></a></p><p class="medium-feed-snippet">Most had 8&#x2013;15 years of experience. Several worked at companies I couldn&#x2019;t get an interview with. Almost everyone blamed the database. The&#x2026;</p><p class="medium-feed-link"><a href="https://python.plainenglish.io/i-interviewed-12-senior-engineers-only-2-could-debug-this-production-failure-abe5186147e5?source=rss-bfebdff1bc27------2">Continue reading on Python in Plain English »</a></p></div>]]></description>
            <link>https://python.plainenglish.io/i-interviewed-12-senior-engineers-only-2-could-debug-this-production-failure-abe5186147e5?source=rss-bfebdff1bc27------2</link>
            <guid isPermaLink="false">https://medium.com/p/abe5186147e5</guid>
            <category><![CDATA[coding]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[software-engineering]]></category>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[technology]]></category>
            <dc:creator><![CDATA[Engineering Unfiltered | By Devrim]]></dc:creator>
            <pubDate>Tue, 17 Nov 2026 15:27:36 GMT</pubDate>
            <atom:updated>2026-11-17T15:27:36.724Z</atom:updated>
        </item>
        <item>
            <title><![CDATA[The Senior Engineer Interview That Went Wrong After One SQL Query]]></title>
            <link>https://medium.com/@devcommando/the-senior-engineer-interview-that-went-wrong-after-one-sql-query-ddabd5f89ed6?source=rss-bfebdff1bc27------2</link>
            <guid isPermaLink="false">https://medium.com/p/ddabd5f89ed6</guid>
            <category><![CDATA[software-engineering]]></category>
            <category><![CDATA[software-architecture]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[coding]]></category>
            <dc:creator><![CDATA[Engineering Unfiltered | By Devrim]]></dc:creator>
            <pubDate>Tue, 17 Nov 2026 15:25:19 GMT</pubDate>
            <atom:updated>2026-11-17T15:25:19.108Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-piEQ1tuEfGvf4Ha9XcMuw.png" /></figure><h4><em>Advanced SQL and PostgreSQL interview questions for Senior Backend Engineers, covering query optimization, composite indexes, pagination, transaction isolation, and the performance problems that rarely appear in coding tutorials.</em></h4><h3>The Candidate Had Twelve Years of Experience. The Interviewer Asked Him to Remove One Index.</h3><p>Michael had been a backend engineer for twelve years, most of them spent building Java applications for financial companies. His résumé included PostgreSQL, Oracle, Spring Boot, Hibernate, database optimization, and the usual collection of technologies that accumulate when you’ve survived enough enterprise projects.</p><p>He was interviewing for a Staff Backend Engineer position. The first forty minutes went well. He explained service boundaries, transaction management, asynchronous processing, and why the company probably didn’t need another microservice for sending confirmation emails.</p><p>Then the interviewer opened a SQL editor.</p><p>The database contained 120 million payment records, and one endpoint had become painfully slow. Michael was asked to explain the execution plan, recommend an index, and estimate what his change would cost during writes.</p><p>He suggested adding indexes to every column in the WHERE clause.</p><p>The interviewer asked him to explain why three individual indexes would be better than one carefully designed composite index. Michael paused, looked at the query again, and realized the conversation had moved into a part of PostgreSQL he’d spent years letting Hibernate handle.</p><p>That is a surprisingly common problem among experienced backend engineers. They understand repositories, transactions, and entity relationships, but their understanding becomes less reliable once the discussion reaches query planners, index access patterns, and database concurrency.</p><p>A serious SQL interview exposes those gaps quickly because the interviewer can change one predicate and force you to explain the consequences.</p><h3>The Query Looked Innocent Until the Table Reached 120 Million Rows</h3><p>The interviewer showed Michael a query used by an internal payments dashboard.</p><pre>SELECT id, merchant_id, amount, created_at<br>FROM payments<br>WHERE merchant_id = 4821<br>  AND status = &#39;COMPLETED&#39;<br>ORDER BY created_at DESC<br>LIMIT 50;</pre><p>The table had a primary key on id and separate indexes on merchant_id, status, and created_at.</p><p>Michael explained that PostgreSQL could use indexes to filter the rows.</p><p>The interviewer agreed, then asked whether those indexes would efficiently satisfy both the filtering and ordering requirements.</p><p>An index on merchant_id can help locate payments belonging to one merchant. An index on created_at can support ordered access. PostgreSQL might also combine indexes using bitmap operations, depending on its cost estimates.</p><p>But bitmap index combinations generally lose the ordering provided by the individual indexes. The database may still need to sort the qualifying rows before returning the latest fifty.</p><p>Michael proposed a composite index:</p><pre>CREATE INDEX CONCURRENTLY idx_payments_merchant_status_date<br>ON payments (<br>    merchant_id,<br>    status,<br>    created_at DESC<br>);</pre><p>For the query shown, the leading equality predicates can narrow the relevant index range, while the following created_at ordering can support efficient retrieval of recent payments.</p><p>The interviewer asked whether this index was guaranteed to be used.</p><p>Michael said no. PostgreSQL chooses execution plans based on statistics, selectivity, estimated costs, and the available alternatives. If a particular merchant owns a substantial portion of the table, or the data distribution differs from expectations, the planner may choose another strategy.</p><p>Then the interviewer changed the query.</p><pre>SELECT id, merchant_id, amount, created_at<br>FROM payments<br>WHERE status = &#39;COMPLETED&#39;<br>ORDER BY created_at DESC<br>LIMIT 50;</pre><p>The merchant_id predicate was gone.</p><p>Now the composite index’s leading column was no longer constrained. Its usefulness for this query changed substantially, and another index design might be more appropriate.</p><p>Michael had finally reached the part of the interview where knowing that B-tree indexes exist wasn’t enough.</p><h3>Why Does Column Order Matter in a Composite Index?</h3><p>The interviewer asked Michael to compare these indexes:</p><pre>CREATE INDEX idx_a<br>ON payments (merchant_id, status, created_at);<br><br>CREATE INDEX idx_b<br>ON payments (created_at, status, merchant_id);</pre><p>Michael initially said both contained the same columns, so their performance should be similar.</p><p>The interviewer asked him to consider how a B-tree index is ordered.</p><p>In a multicolumn B-tree index, entries are ordered primarily by the first indexed column, then by subsequent columns within equal preceding values. That ordering determines which query predicates can efficiently restrict the portion of the index that must be examined.</p><p>For the original query, equality conditions on merchant_id and status make the first index a natural candidate. The database can navigate to the relevant range and read rows in created_at order.</p><p>The second index begins with created_at, which changes the access pattern. It may be useful for queries primarily interested in recent records, but filtering by merchant and status can require examining additional entries.</p><p>The interviewer asked whether putting the most selective column first was always the correct rule.</p><p>Michael had heard that advice before, but it was too simplistic.</p><p>The optimal order depends on the query workload, equality and range predicates, ordering requirements, and how the index will be used. For a query with equality conditions on both leading columns, their relative order may be less important for that specific lookup than their usefulness across other queries.</p><p>PostgreSQL also has planner capabilities that make rigid leftmost-prefix rules an incomplete description of every possible access path.</p><p>A Staff Engineer should understand the actual access pattern rather than treating index design as a memorized sorting exercise.</p><p>The interviewer wasn’t interested in whether Michael could repeat a rule from a database blog. He wanted to know whether Michael could defend the index when the query changed.</p><h3>The Index Made Reads Faster. Why Did Payment Processing Become Slower?</h3><p>Michael had recommended several new indexes for the payments table.</p><p>The interviewer asked what happened to insert throughput after those indexes were created.</p><p>Every insert now had additional index maintenance work. PostgreSQL had to maintain the relevant index structures, generate WAL records for changes, and manage the resulting storage and cache pressure.</p><p>The cost of an index extends beyond its disk footprint.</p><p>Updates can also become more expensive, particularly when indexed columns change. Additional indexes may reduce opportunities for heap-only tuple updates, depending on which columns are modified.</p><p>The interviewer asked whether an index that improves a dashboard query from 800 milliseconds to 15 milliseconds is automatically worth keeping.</p><p>Michael said the answer depended on the workload.</p><p>If the dashboard query runs once every ten minutes while the payment service performs thousands of writes per second, the tradeoff deserves careful measurement. A read optimization that creates substantial write overhead might be a poor choice for the overall system.</p><p>The interviewer suggested a partial index.</p><pre>CREATE INDEX CONCURRENTLY idx_completed_payments<br>ON payments (merchant_id, created_at DESC)<br>WHERE status = &#39;COMPLETED&#39;;</pre><p>If the dashboard consistently queries completed payments, the partial index may be smaller and cheaper to maintain than an equivalent full-table index.</p><p>But the interviewer asked what happens when the application uses a prepared statement with a parameterized status.</p><pre>SELECT id, merchant_id, amount<br>FROM payments<br>WHERE merchant_id = $1<br>  AND status = $2<br>ORDER BY created_at DESC<br>LIMIT 50;</pre><p>A generic plan may be unable to prove that the parameterized predicate implies the partial index predicate for every possible parameter value. As a result, the partial index may not be usable in that plan.</p><p>Michael had used prepared statements for years without thinking much about the planner’s relationship with parameter values.</p><p>The interview was becoming educational in the least comfortable way possible.</p><h3>OFFSET 1000000 Was the Next Problem</h3><p>The interviewer opened a query used by an administrative dashboard.</p><pre>SELECT id, created_at, amount<br>FROM payments<br>WHERE merchant_id = 4821<br>ORDER BY created_at DESC<br>LIMIT 50 OFFSET 1000000;</pre><p>Michael explained that PostgreSQL needed to skip one million qualifying rows before returning the requested page.</p><p>An appropriate index can make the ordered scan more efficient, but it doesn’t eliminate the work associated with advancing past a large offset.</p><p>The interviewer asked what Michael would use instead.</p><p>He proposed keyset pagination.</p><pre>SELECT id, created_at, amount<br>FROM payments<br>WHERE merchant_id = 4821<br>  AND (created_at, id) &lt; ($1, $2)<br>ORDER BY created_at DESC, id DESC<br>LIMIT 50;</pre><p>The cursor contains the created_at and id values of the last record from the previous page.</p><p>Using both columns establishes a deterministic ordering when multiple payments share the same timestamp. An index aligned with the merchant filter and ordering can support efficient navigation to the next range.</p><pre>CREATE INDEX CONCURRENTLY idx_payments_cursor<br>ON payments (<br>    merchant_id,<br>    created_at DESC,<br>    id DESC<br>);</pre><p>The interviewer asked whether keyset pagination supported jumping directly to page 20,000.</p><p>Not naturally in the same way offset pagination does. Keyset pagination is designed around continuing from a known position, which makes it well suited to feeds, timelines, and sequential navigation.</p><p>The interviewer then asked what happens when new payments arrive between page requests.</p><p>Keyset pagination can avoid some of the shifting-page behavior associated with offsets, but it doesn’t automatically provide a frozen snapshot of the entire dataset across independent requests.</p><p>If the product requires a consistent historical view, the architecture may need snapshot semantics, a fixed upper boundary, or another application-specific approach.</p><p>Michael was beginning to understand why pagination was a system design decision rather than merely a repository method parameter.</p><h3>The Interviewer Asked Whether COUNT(*) Was Expensive</h3><p>Michael had optimized the payment listing endpoint.</p><p>Then the interviewer showed him the dashboard’s pagination metadata query.</p><pre>SELECT COUNT(*)<br>FROM payments<br>WHERE merchant_id = 4821;</pre><p>The interviewer asked whether PostgreSQL could answer it instantly from table metadata.</p><p>Michael explained that PostgreSQL’s MVCC model makes exact row visibility relevant. A precise count generally requires examining qualifying rows or index entries under the query’s snapshot visibility rules.</p><p>PostgreSQL maintains estimated row counts in statistics, but those estimates aren’t interchangeable with an exact transactional count.</p><p>The interviewer asked whether an index made the count free.</p><p>It didn’t.</p><p>An index-only scan may improve performance under suitable visibility conditions, but the database still has work to perform. For a merchant with millions of payments, an exact count can remain expensive.</p><p>The interviewer asked whether every dashboard needed an exact total.</p><p>Michael said it depended on the product.</p><p>An administrative export may require a precise count. A user interface displaying thousands of historical records may be able to use an estimate, omit the total, or calculate it asynchronously.</p><p>This was the first time Michael challenged the requirement rather than immediately proposing another index.</p><p>The interviewer seemed more interested in that decision than in the SQL syntax.</p><h3>Two Transactions Both Passed the Validation. Why Did the Business Rule Fail?</h3><p>The next question involved appointment reservations.</p><p>A table contained reservations for limited-capacity events. Before inserting a reservation, the application counted existing reservations and rejected the request if the capacity had been reached.</p><p>Two concurrent transactions checked the same event.</p><p>Both observed that one seat remained available.</p><p>Both inserted a reservation.</p><p>The event was now overbooked.</p><p>Michael explained that a transaction boundary alone doesn’t necessarily protect a business invariant involving multiple statements and concurrent transactions.</p><p>Under PostgreSQL’s default READ COMMITTED isolation, each statement receives a snapshot according to that isolation model. Two transactions can make decisions based on observations that don&#39;t account for each other&#39;s uncommitted changes.</p><p>The interviewer asked whether SELECT ... FOR UPDATE on the existing reservation rows would solve the problem.</p><p>Michael paused.</p><p>Locking existing rows doesn’t necessarily protect against new rows being inserted that satisfy the same predicate. If there are no existing rows to lock, the proposed strategy becomes particularly fragile.</p><p>One solution is to model capacity through an authoritative row that transactions update conditionally.</p><pre>UPDATE events<br>SET reserved_count = reserved_count + 1<br>WHERE id = 42<br>  AND reserved_count &lt; capacity;</pre><p>The application checks whether one row was updated, then inserts the reservation in the same database transaction.</p><p>This can serialize the relevant capacity decision around the event row and preserve the invariant when all reservation paths follow the same protocol.</p><p>The interviewer asked whether SERIALIZABLE isolation could help.</p><p>PostgreSQL’s serializable isolation can detect certain dangerous concurrent execution patterns and abort transactions that cannot be serialized safely. Applications must be prepared to retry complete transactions when serialization failures occur.</p><p>But stronger isolation doesn’t remove the need to define the business invariant correctly.</p><p>Michael had spent years writing validation logic in Java. The interviewer had just demonstrated why some validation belongs close to the data and its concurrency controls.</p><h3>A Query Was Blocked for Thirty Seconds. The Database CPU Was at 12%.</h3><p>The interviewer showed a production dashboard.</p><p>PostgreSQL CPU usage was low. Disk latency was normal. The application had plenty of available memory, yet a payment update had been waiting for thirty seconds.</p><p>Michael asked to inspect pg_stat_activity.</p><pre>SELECT<br>    pid,<br>    state,<br>    wait_event_type,<br>    wait_event,<br>    now() - xact_start AS transaction_age,<br>    query<br>FROM pg_stat_activity<br>WHERE datname = current_database();</pre><p>The interviewer asked how he’d identify the session responsible for blocking another backend.</p><p>Michael suggested pg_blocking_pids().</p><pre>SELECT<br>    pid,<br>    pg_blocking_pids(pid) AS blocking_pids,<br>    wait_event_type,<br>    wait_event,<br>    query<br>FROM pg_stat_activity<br>WHERE cardinality(pg_blocking_pids(pid)) &gt; 0;</pre><p>The query could help identify blocked sessions and the backends preventing their progress.</p><p>The interviewer then revealed that the blocking transaction belonged to a Spring Boot service that had executed an update and was waiting for an external HTTP response.</p><p>Michael recognized the pattern immediately.</p><p>The database was spending very little CPU because the affected operations weren’t actively executing. They were waiting for locks held by another transaction.</p><p>Increasing database CPU capacity wouldn’t remove the blocking dependency.</p><p>The interviewer asked whether killing the blocking transaction was always safe.</p><p>Michael explained that terminating a transaction could release locks but might interrupt legitimate business work. Before taking that action, he’d examine the transaction’s purpose, age, and application state, especially if external operations were involved.</p><p>The discussion returned to transaction boundaries, which was where the original production incident had started.</p><h3>The Final Question Was About a Migration Nobody Wanted to Own</h3><p>The company needed to add a new column to a payments table containing 120 million rows.</p><p>The application ran continuously, and the database couldn’t be taken offline for a maintenance window.</p><p>The interviewer asked how Michael would deploy the change.</p><p>Michael described an expand-and-contract migration.</p><p>First, introduce a backward-compatible schema change that allows the old application version to continue operating. Then deploy application code capable of handling the new schema while existing records are gradually migrated.</p><p>For a large backfill, process rows in controlled batches rather than attempting one enormous transaction. Monitor replication lag, WAL generation, lock waits, and the effect on normal traffic.</p><p>After validating the migrated data, the application can begin relying on the new representation. Constraints and obsolete structures can be tightened or removed in later deployment stages when the compatibility requirements allow it.</p><p>The interviewer asked whether adding a column always rewrote the entire PostgreSQL table.</p><p>Michael explained that the answer depends on the exact DDL operation and PostgreSQL version. Some changes can be metadata-only, while others require significant table work or stronger locking.</p><p>He also mentioned that CREATE INDEX CONCURRENTLY can reduce write blocking compared with ordinary index creation, although it has its own operational requirements and failure modes.</p><p>The interviewer asked how he’d roll back a partially completed migration.</p><p>Michael said the rollback strategy had to be designed before the deployment. Database changes aren’t always trivially reversible, especially after new application versions begin writing data in a new format.</p><p>A migration plan should define compatibility windows, validation criteria, and what happens when the rollout stops halfway through.</p><p>That answer was less glamorous than promising zero downtime through Kubernetes.</p><p>It was also much closer to how production migrations actually work.</p><h3>What the Interview Was Really Measuring</h3><p>Michael hadn’t failed because he couldn’t remember a PostgreSQL command. He had struggled whenever a question required him to connect database internals with the behavior of the application running above them.</p><p>A composite index became a discussion about physical ordering and workload distribution. Pagination became a question about consistency and product requirements. Transaction isolation became a problem of protecting business invariants under concurrency.</p><p>Those are the conversations experienced backend engineers eventually have to lead.</p><p>The interviewer wasn’t looking for someone who could write the longest SQL query or recite every isolation level. He wanted an engineer who could explain why a proposed optimization worked, identify its costs, and recognize the situations where it would fail.</p><p>Michael left the interview with a different preparation plan. Instead of collecting another hundred Spring Boot interview questions, he started reproducing PostgreSQL concurrency problems locally and reading execution plans against realistic datasets.</p><p>He also stopped treating Hibernate as an excuse to avoid understanding SQL.</p><p>That was probably the most useful outcome of the entire interview.</p><h3>Frequently Asked Questions</h3><h3>What SQL questions are asked in Senior Backend Engineer interviews?</h3><p>Senior interviews frequently cover composite indexes, query execution plans, transaction isolation, locking, deadlocks, pagination, MVCC, and database migrations. Candidates are usually expected to explain performance and correctness tradeoffs rather than simply write syntactically valid SQL.</p><h3>How do composite indexes work in PostgreSQL?</h3><p>Multicolumn B-tree indexes maintain an ordering based on their indexed columns. Query predicates, ordering requirements, and column positions influence how efficiently PostgreSQL can use an index.</p><h3>Why is OFFSET pagination slow on large tables?</h3><p>Large offsets require PostgreSQL to advance past many qualifying rows before returning the requested page. Keyset pagination can avoid much of that work when the application can navigate using a stable cursor.</p><h3>What is the difference between READ COMMITTED and SERIALIZABLE in PostgreSQL?</h3><p>READ COMMITTED provides statement-level snapshot behavior, while SERIALIZABLE aims to ensure that concurrent committed transactions have an outcome equivalent to some serial execution. Serializable transactions may need to be retried after serialization failures.</p><h3>Why does PostgreSQL sometimes ignore an index?</h3><p>The query planner estimates the costs of available execution strategies using statistics and other information. It may prefer a sequential scan or another plan when an index is estimated to provide less benefit.</p><h3>How do you find blocking transactions in PostgreSQL?</h3><p>Inspect pg_stat_activity, wait events, and blocking relationships using pg_blocking_pids(). Correlate the results with transaction age and application behavior before taking corrective action.</p><h3>What is the safest way to migrate a large PostgreSQL table?</h3><p>The approach depends on the schema change, but backward-compatible migrations, controlled backfills, staged application deployments, and explicit validation can reduce operational risk.</p><h3>How should Senior Java Engineers prepare for PostgreSQL interviews?</h3><p>Build small experiments involving concurrent transactions, analyze query plans with representative datasets, and investigate how Spring transaction boundaries affect database resources. Understanding the actual behavior is more valuable than memorizing ORM annotations.</p><h3>Your ORM Won’t Be Sitting Beside You in the Interview</h3><p>Hibernate is useful because it removes repetitive persistence code and provides a convenient programming model. It also makes it possible to spend years building backend applications without investigating the database behavior underneath.</p><p>That convenience has a limit.</p><p>When a query becomes slow, you need to understand the execution plan. When two transactions corrupt a business invariant, you need to understand concurrency control. When a production migration threatens availability, you need to know which database operations are safe and what locks they require.</p><p>A Senior Engineer can get surprisingly far without mastering those details. A Staff Engineer who is responsible for database-heavy systems eventually has to confront them.</p><p>Michael’s interview didn’t reveal that his twelve years of experience were worthless. It revealed which parts of those twelve years he had never examined closely enough.</p><p>That’s a useful distinction when preparing for a role where other engineers will depend on your technical judgment.</p><h3>Prepare for the Database Questions That Expose Real Experience</h3><p>If you can build a Spring Boot service but struggle to explain why PostgreSQL chooses a sequential scan, how concurrent transactions violate business rules, or why a connection pool increase makes latency worse, those are the gaps worth closing before your next interview.</p><p>The <a href="https://devrimozcay.gumroad.com/l/epxiu">Senior Backend Production Engineering OS</a> focuses on Java, Spring Boot, PostgreSQL, and the production engineering decisions that experienced backend candidates are expected to defend. Use it to strengthen the parts of your knowledge that framework abstractions have allowed you to avoid.</p><p>For engineers preparing for Staff and Principal architecture interviews, the <a href="https://devrimozcay.gumroad.com/l/oordy">Senior &amp; Staff System Design Interview OS</a> extends that preparation into distributed consistency, scalability, reliability, and system-level tradeoffs. Those discussions become more convincing when you understand the database behavior beneath the architecture.</p><p>You can also begin with the <a href="https://devrimozcay.gumroad.com/l/fdiown">free Senior Engineer Interview &amp; Production Playbook</a>. Choose the questions you couldn’t answer confidently, reproduce them in PostgreSQL, and build your preparation around the evidence you observe.</p><p>I’m researching the <a href="https://docs.google.com/forms/d/e/1FAIpQLScLD53xFU73sirxXmKFfL9-M7FGL_5mM6a8_B0qQdaYce2atA/viewform?usp=header">ProdRescue AI System Design Interview Platform</a>, focused on realistic technical interviews with demanding follow-up questions. Engineers interested in practicing these discussions can contribute to the research and express interest in the private beta.</p><p>I publish more advanced backend engineering and interview preparation articles on <a href="https://substack.com/@devrimozcay1">Substack</a>, including the production details that rarely appear in introductory tutorials.</p><p><em>Devrim Özçay — Founder, ProdRescue AI</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ddabd5f89ed6" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>