Country or region and language

    Choose your country or region and your language.

    Suggested for you

      All countries and regions

        Choose your character

        It shows in the top bar and on your profile. Change it any time.

        Interviews in PostgreSQL

        Work in the tool while you explain your decisions.

        Choose a role and level. Each interview has a new task, follow-up questions and a report that checks your work and your explanation.

        Speak or type. Sign in to save your results across devices.

        Timed assessment

        • 12 practical questions
        • 45 minutes
        • Mid level

        Questions are drawn from a bank of 36. Your report includes a skill breakdown and lessons to practice next.

        Practice interviews

        Junior tasks cover the fundamentals. Mid and senior tasks add debugging, changing requirements and review decisions.

        10 interviews

        • Backend engineer
        • Junior
        • 30 min

        The current ticket charge

        At fictional Cedar Dispatch, return ticket, revision and charge from changes. Keep the highest revision for each ticket; ties go to the latest received_at, then highest id. Sort by ticket.

        Start interview
        Skills and rubricThe current ticket charge
        • I use DISTINCT ON with ticket first in ORDER BY because PostgreSQL keeps the first row of each ticket group. Revision DESC, received_at DESC and id DESC put the required winner first. I check that cedar keeps id 4 and reed keeps id 3.
        • I compare both cedar rows at revision 2 because a maximum revision alone leaves ids 2 and 4 tied. Their received_at values make id 4 current, while a global maximum would also drop reed's valid revision 1.
        • I retain the DISTINCT ON query and the winning source ids because the charge total alone can't prove which revision was selected. I rerun it on tied timestamps and changed charges, then compare each returned ticket with its ordered source rows before releasing the query.
        • Data engineer
        • Junior
        • 30 min

        A UTC posting day

        Morrow Ledger needs id and amount from entries for posted records on March 1, 2027 in UTC. Include midnight at the start and exclude midnight of March 2. Sort by id.

        Start interview
        Skills and rubricA UTC posting day
        • I filter status to posted and use explicit UTC instants because the reporting contract defines a posting day rather than the session's local date. The lower bound includes March 1 midnight and the exclusive upper bound excludes March 2 midnight. I check that ids 1 and 2 remain, including the credit.
        • I check id 4 at March 2 midnight because BETWEEN would include that endpoint and count a posting from the next day. I also check that draft id 3 is absent even though its timestamp is inside March 1. Both time and status determine eligibility.
        • I retain the posting predicate, UTC bounds and returned ids because the same timestamps can be interpreted differently under another session time zone; I rerun the boundary fixture in a second time zone and compare the ids, keeping the credit while excluding the draft and the next midnight.
        • Backend engineer
        • Junior
        • 30 min

        Typed JSON eligibility

        Tern Parcel needs the ids of documents whose payload has the JSON boolean active=true and contains the priority tag. A text value "true" is invalid. Sort ids.

        Start interview
        Skills and rubricTyped JSON eligibility
        • I use JSONB containment for active=true and the priority tag because containment preserves the JSON boolean type while checking the required array element. I check that only document 1 qualifies. The string true, false and a missing active key all fail the stated contract.
        • I compare documents 1 and 2 because extracting active with ->> turns both the boolean true and the string true into text. Typed containment excludes document 2, and I check document 4 separately because a priority tag can't substitute for a missing active key.
        • I retain the JSONB predicate and the four original payloads because an output id alone doesn't prove that boolean and string values stayed distinct. I compare the checked result with the expected inclusion of document 1 and rejection of documents 2, 3 and 4 before changing the service filter.
        • Backend engineer
        • Mid
        • 30 min

        Guarded stock reservation

        Alder Rentals reserves three units from every stock row that can cover the request. Write one atomic UPDATE that decrements only eligible rows and returns id and remaining, sorted by id in the final result. Rows with less than three units must remain unchanged.

        Start interview
        Skills and rubricGuarded stock reservation
        • I check the row with exactly 3 units because remaining>3 would reject a reservation that the contract explicitly permits. I also compare the rows starting at 2 and 0 with their original values. Neither row may be decremented or returned as reserved.
        • I record a unique reservation key in the same transaction as the decrement because the capacity guard doesn't recognize a retried request. The retry must read the recorded reservation instead of decrementing again. I check a lost-response retry and a new key against the final stock.
        • I retain the guarded UPDATE, returned rows and final stock values because successful SQL alone doesn't prove that unavailable stock was preserved. Before service release, I test competing reservations on the target PostgreSQL server and check the request-key transaction; the single browser connection can't establish concurrent behavior.
        • Backend engineer
        • Mid
        • 30 min

        Zero-activity accounts

        Larch Accounting needs account id and posted_count for every account, including accounts without posted entries. Count real entry ids and sort by account id.

        Start interview
        Skills and rubricZero-activity accounts
        • I check account 3 with no entries because COUNT(*) would count its placeholder row as one posting. I also check draft-only account 4 and the zero-amount posting for account 2. The rule counts real posted entry ids, regardless of amount.
        • I use NOT EXISTS with the same posted predicate because the revised request excludes accounts with postings, not accounts with any activity. I check that draft-only account 4 remains alongside account 3; filtering for the absence of every entry would wrongly drop account 4.
        • I retain the LEFT JOIN query and the account-by-account counts because a correct grand total can still hide a missing zero-activity account. I compare all account ids with the output and check that the zero-amount posting counts once while draft-only and empty accounts count zero.
        • Data engineer
        • Mid
        • 30 min

        A signed settlement view

        Brookline Finance needs a view named posted_net with account_id and net. Sum signed amounts for posted entries, including entries whose account_id is NULL. Create the view; the check reads it on changed source data.

        Start interview
        Skills and rubricA signed settlement view
        • I compare the credit and the NULL-account posting with the view because filtering either out would hide a signed source amount. The first account nets to 40, the second keeps its zero posting, and the unresolved NULL group retains 7. I check each group separately.
        • I define a refresh boundary and a stale-data policy because a materialized view stores a snapshot instead of rerunning the source query on each read. I change a source posting, check that the stored result stays unchanged before refresh, then refresh and compare the new signed totals.
        • I retain the posted_net definition and source-to-view totals because the view name alone doesn't establish the signed posting rule. I add a credit and a draft in a rollback-only test, compare the visible groups, and record the reader's transaction snapshot so freshness isn't confused with uncommitted data.
        • Backend engineer
        • Mid
        • 30 min

        Missing posting coverage

        Kestrel Controls needs account ids that have no posted entries. A posted entry with a NULL account_id must not suppress every account. Return id in ascending order.

        Start interview
        Skills and rubricMissing posting coverage
        • I check the posted row with account_id NULL because NOT IN would make unmatched comparisons unknown and suppress the accounts we need. I compare draft-only account 4 as well. A NOT EXISTS without the posted filter would wrongly treat its draft as posting coverage.
        • I require absence from both approved posting sources because an account with a valid imported posting no longer qualifies as missing coverage. I preserve each source's status and account-key rules, then test a posting found only in the import and a duplicate present in both sources.
        • I retain the NOT EXISTS predicate and the unmatched account ids because an empty result can conceal a NULL-related comparison mistake; I compare the query with a fixture containing a NULL key, a draft-only account and an empty account, then repeat after adding an approved posting to one account.
        • Data engineer
        • Senior
        • 30 min

        English document search

        Linden Repairs needs document ids whose body matches both battery and repair using PostgreSQL English full-text search. Word inflections should match, but a body missing either concept must fail. Sort by id.

        Start interview
        Skills and rubricEnglish document search
        • I select the text-search configuration by document language because English normalization doesn't define the same word forms for Spanish documents. I normalize the query with the matching configuration, check representative Spanish inflections and mixed-language records, and measure relevance before changing ranking.
        • I retain the search configuration, query and matching document ids because successful execution doesn't show whether inflections and missing terms were handled correctly. I compare the English fixture's ids 1 and 4 with the rejected one-term documents, and record relevance checks separately from any unmeasured latency claim.
        • I compare document 4 with document 3 because literal battery substrings miss Batteries while an OR query accepts Battery replacement without repair. I check that the full-text predicate returns ids 1 and 4 only. Each returned body must contain both normalized concepts.
        • Backend engineer
        • Senior
        • 30 min

        A rollback repair

        Rowan Warehouse needs stock id 1 reduced by one. A later trial update to id 2 must be undone without losing the first change. Use a transaction and savepoint, roll back the trial, and commit the first change.

        Start interview
        Skills and rubricA rollback repair
        • I issue ROLLBACK TO SAVEPOINT trial after the trial error because ordinary statements can't proceed in the failed subtransaction. I then check the required earlier decrement and COMMIT it. I also test that the failed trial left id 2 unchanged instead of continuing in an aborted transaction.
        • I retain the transaction script and before-and-after stock rows because the final COMMIT alone doesn't prove that only the trial was undone. I replay a successful trial and an erroring trial from the same start, checking the saved decrement and the unchanged id 2 in both runs.
        • I compare both stock rows after the transaction because checking only id 1 would miss a trial update accidentally committed to id 2. A full ROLLBACK loses the required decrement, while omitting ROLLBACK TO SAVEPOINT leaves id 2 at zero. Neither final state meets the request.
        • Data engineer
        • Senior
        • 30 min

        JSON array membership

        Wren Freight needs ids whose JSONB tags contain both priority and fragile, regardless of array order. Preserve documents with additional tags and sort by id.

        Start interview
        Skills and rubricJSON array membership
        • I replace containment with JSONB array equality because the revised contract requires the exact ordered array instead of membership. I check that the original priority-then-fragile array passes while reversed order and an extra element both fail. The earlier document 4 expectation must change.
        • I retain the JSONB predicate and each document's tag array because matching ids alone don't establish whether order and extra tags were allowed; I compare base and reordered fixtures, checking both-tag inclusion and single-tag rejection; any later equality rule gets a separate expected result.
        • I check document 4 with reversed tags and an extra cold element because JSONB array equality would reject this valid membership match. I also compare document 2, which has only priority. Containment must require both requested elements rather than accepting either tag alone.

        Interview Hub access

        The Interview Hub is included in All Access. Choose a plan or sign in to your account to continue.

        View plansSign in or join

        Your Work Gym account

        Save your progress and pick up on another device. Your browser's progress comes with you.

        or

        You can keep practicing without an account.

        Change your plan

        Checking the price

        Help and feedback

        Ask a question, tell us what is not working, or share an idea. We reply by email.

        What is it about?

        We use it only to reply to you.