Database Designer Interview Questions
For database programmers and developers designing data structures and database code. Interviews cover data models, query behavior and reliable data transfers.
30 questions, ranked by what the job needs most
In other fields: Software Developers, Applications · Database Administrators · Database Architects · compare them →
Print the top 10:Scoring sheetPractice sheet
Question 1: Give an example of how you changed a database model when the original table relationships could not represent a business rule.
Example answerThe interviewer wants to see how you turn a business rule into a table relationship and verify that the change works with existing data.
Explain what the old model allowed and give one example of a valid case it couldn't represent. Describe the relationship you changed, how you moved old records and which cases you checked afterward.
"A scheduling tool stored a single trainer on each session. The training team needed to assign several trainers to one session, and a trainer could teach several sessions. I added a table that linked trainers to sessions and used the pair of IDs to prevent duplicate assignments. I copied each existing assignment into that table. I checked that old schedules still showed the same trainer and tested a session with several trainers. The schedule could show everyone without creating a second copy of the session."
Avoid using repeated session records to represent the extra trainers. Don't skip checking the screens and reports that still read existing assignments.
Interviewer tipExpect the rule, the relationship change and checks on existing data and application behavior. Adding duplicate records to hide a modeling problem is a red flag.
Candidate tipSketch the original relationship in words. Explain your role in changing it, how you checked existing records and whether the revised model represented the rule correctly.
Question 2: Describe a program you wrote to automate a task people had been doing by hand.
Example answerThe interviewer wants to see whether you understood a manual task well enough to automate it and check that the program did the same job correctly.
Explain who did the task, which steps took effort and which part you wrote. Show how you handled an exception that came up in the manual process. End with how you checked the output and what the people using it could do afterward.
"Our office coordinator used to combine supply request sheets by hand. I watched them match item codes across sheets and set aside rows with missing codes for review. I wrote a script that read the sheets, combined requests for the same code and put incomplete rows in a separate file. We compared its totals with a summary the coordinator had already prepared. Once the totals matched, they could start with the combined list and review the flagged rows."
Avoid spending the answer on your choice of language. Don't skip a manual check that the program had to preserve.
Interviewer tipListen for a clear link between the manual task and the code they wrote. A description of the programming language alone leaves it unclear whether the program did the job.
Candidate tipA class project is fine. Explain what the manual task involved, what went into your program, and what it produced for the person doing the work.
Question 3: Describe a time you improved a slow database query without changing the results it was supposed to return.
Example answerThe interviewer wants to see whether you can find the cause of a slow query and improve it while preserving the results.
Describe what the query returned and how you reproduced the delay. Explain what its execution plan or timing told you and why you made your change. Compare results on the same data, including cases where the change might affect which rows are included.
"An order report was slow because its filter converted every stored timestamp to a date before comparing it. The execution plan showed a scan even though the timestamp had an index. I rewrote the filter to compare stored timestamps with the start of the requested day and the start of the next day, using the report's time zone to set both cutoffs. The revised plan used the index to read the requested range. I compared the returned rows, including orders at the cutoff, and timed both versions on the same data. The rows matched and the revised query finished sooner."
Avoid comparing different date ranges. Matching row counts alone can miss an exchange of one row for another.
Interviewer tipListen for a measured bottleneck, a reasoned query or index change and comparison of results. Calling a query faster without checking correctness is a red flag.
Candidate tipUse one slow query. Name the evidence you used to locate the delay, explain your change and compare both the returned data and performance before and after.
Question 4: Walk me through a hard-to-find bug you fixed, from the first report to confirming the fix worked.
Example answerThe interviewer wants to see how you debug: whether you follow a method or guess. Use Situation, Task, Action, Result. Set the scene briefly, then spend most of your answer on the steps: how you reproduced the bug, how you narrowed down the cause, what you changed and how you retested. Sample answer: "Users reported that a monthly report sometimes showed duplicate orders, but I couldn't make it happen on my machine. I compared the failing runs and noticed they all happened when two people ran the report at the same time. I wrote a small test that ran it twice in parallel, and the duplicates appeared. The cause was a temporary table both runs shared. I gave each run its own table, added the parallel test to our test suite, and checked the next few reports against the database totals. The duplicates stopped." Pitfalls to avoid: picking a bug that took five minutes to fix; skipping how you confirmed the fix; blaming the person who wrote the original code.
Interviewer tipListen for a clear method: reproducing the bug, narrowing the cause, fixing the root cause and retesting. Guessing at changes until the symptom went away is a red flag.
Candidate tipPick a real bug that took some digging. Say how you reproduced it, how you narrowed down the cause, what you changed, and how you rechecked that the program gave the right results.
Question 5: How would you design a database transfer so an interruption halfway through does not leave records missing or duplicated?
Example answerThe interviewer wants to see whether you can design a database transfer that can resume safely and account for every record after a failure.
Say what defines the set of records and what counts as a completed piece of work. Explain how you'll recognize a record that already arrived and where the restart point is stored. Include how you'll verify the finished transfer.
"I'd transfer from a fixed snapshot so the list of records stays stable while the job runs. I'd copy in batches and keep the source record ID as a unique key at the destination. I'd save each batch and its checkpoint in the same transaction. If the job stopped before that transaction completed, the batch would roll back and the restart would pick it up again. I'd test an interrupted run and compare source and destination by record ID and key fields when the transfer finished."
Avoid starting over with plain inserts. Matching totals alone can hide missing records.
Interviewer tipA competent answer covers transaction boundaries, restart behavior and checks for missing or duplicate records. Blindly rerunning every insert can create more damage.
Candidate tipDescribe the transfer's unit of work and the state left by a failure. Walk through rollback or restart handling and the checks that establish the final data is complete.
Question 6: Tell me how you changed an existing program to make it run more efficiently or meet a new requirement.
Example answerThe interviewer wants to see how you make a targeted change to existing code and check that it solves the original problem.
Choose one program you made faster or adapted to a new requirement. Explain what had to change and how you found the part of the program responsible. Describe your change and the checks you made on both the new behavior and the parts that needed to keep working.
"A report export took longer as the input grew. I timed the main stages and found that the export looked up the same product details again for each row. I changed it to fetch the product details together and reuse them while building the file. I compared the old and new exports on the same input, including rows with no matching product. The files matched, and a repeat run with that input spent less time on lookups."
Avoid crediting a speedup you didn't measure. If you choose a requirement change, state the rule plainly so the interviewer can follow your checks.
Interviewer tipListen for a specific change to existing code and a check tied to its goal. Simply showing that the program still runs leaves the improvement or new behavior unproven.
Candidate tipName the old limit or new requirement, the code you changed, and the check that showed it worked. That might be a run time comparison or output that matches the new rule.
Question 7: Walk me through a trial run you used to check whether a program's output matched the specification.
Example answerThe interviewer wants to know how you turn a written specification into an expected result you can check during a trial run.
Choose a trial where you knew what the correct output would look like before running the program. Name the rule you tested and explain how you picked the inputs, calculated the expected output and compared it with the run. Describe what you did with any difference.
"I tested a program that generated a weekly list of open service requests. The specification said a request closed before the reporting cutoff should be excluded. I set up sample requests on both sides of the cutoff and wrote down which ones I expected in the report. The trial included a request closed just before the cutoff. I traced that row to a filter using the wrong date field, corrected it and reran the sample. The report then matched the list I had worked out."
Avoid checking only that the program ran. Don't treat existing output as the expected result without checking it against the specification.
Interviewer tipListen for an expected result worked out before the run and a comparison with what the program produced. A run that finishes without errors can still return the wrong result.
Candidate tipA course lab works here. Pick one trial run, name the input and the result you expected from the specification, and explain how you checked the actual output.
Question 8: Describe a time you weighed two ways to store data that a program needed to look up later.
Example answerThe interviewer wants to see how you chose a way to store data based on how the program would retrieve and update it.
Describe the data and give an example of a lookup the program needed to make. Name the two storage options you considered and the trade-off that mattered. Explain what you chose and how you checked that it suited the program's needs.
"In a parts lookup tool, I weighed keeping the catalog in a local file against putting it in a small database. A file would have been simple to ship, and it worked well for looking up a part by number. The support team also needed to search by supplier and update individual entries. I tried those operations with a sample catalog. The database made the searches simpler and let an update touch just one record, so I chose it and used the sample to check the lookup results."
Avoid listing tools without explaining the lookup they support. Don't assume your choice was faster unless you measured it.
Interviewer tipListen for a strength and a drawback of each option given the program's needs. Claiming one way to store data is always faster without considering the kind of lookup is a red flag.
Candidate tipName both approaches and the trade-off that mattered for those lookups, such as search speed or how often the data changed. Say how the comparison shaped your choice and what happened when you used it.
Question 9: Tell me about a time a conversation with a teammate helped you pin down why a program was giving the wrong result.
Example answerThe interviewer wants to know how a teammate's knowledge helped you explain a wrong result from a program.
Set up the discrepancy and mention what you had already checked. Show what you brought to the conversation, what the teammate knew and how you tested the explanation. End with the cause you found and what you did about it.
"A monthly order summary showed more shipments than the warehouse expected. I traced one order through the report and showed a teammate the two rows it produced. My teammate explained that reprinting a label added another label record for the same shipment. I pulled the shipment history for that order and confirmed the extra row came from a reprint. I changed the summary to count shipments by shipment ID and checked it against other orders with reprints."
Avoid saying the teammate fixed it without explaining your part. Don't treat a plausible explanation as confirmed until you've checked an example.
Interviewer tipListen for a clue the teammate supplied about the expected output or the code and how the candidate used it. Forwarding a bug report without discussing the problem gives no evidence of a joint diagnosis.
Candidate tipDescribe the wrong result, what you brought to the conversation, and the clue your teammate added. End with what you were able to pin down or fix because of that input.
Question 10: Walk me through a time you documented a program change so another programmer could pick up where you left off.
Interviewer tipGood handoff notes help a teammate understand why the code changed and how to check it. A list of files with no explanation of the change leaves the next programmer guessing.
Candidate tipChoose a real change and describe what you wrote about why it was made and how to test it. Mention any teammate feedback that showed what was clear or what could use more detail.
Question 11: Walk me through the programming work you've done on your most recent projects.
Example answerThe interviewer wants to understand what you've programmed recently and which parts of each project you handled yourself.
Choose a recent project you can explain in some depth and a second one that shows a different kind of programming work. For each, say who needed it, what you built or changed, and how you checked it. Spend the most time on a decision or problem you worked through. A recent course project can work if it gives you that detail.
"I recently wrote the import step for an internal inventory tool. I mapped fields from the incoming file to our records and added a separate report for rows the tool couldn't read. I checked the import against a sample the inventory team had already reconciled. On another project, I changed a report export so staff could filter by date, and I tested records on the first and last days of the range."
Avoid rattling off languages without showing what you used them for. Be clear about which work your teammates owned.
Interviewer tipListen for a specific piece of code and its purpose on each project. A list of languages and project names leaves their programming work unclear.
Candidate tipPick two recent projects. For each, name the part of the application or script you worked on, the code you wrote or changed, and what it did when it ran.
Question 12: Give an example of how you coded a decision in a program from a workflow diagram.
Interviewer tipA strong answer traces a decision on the diagram to a condition in the code and explains where each path leads. Coding only the usual path leaves other cases in the diagram unhandled.
Candidate tipPoint to a decision on the diagram, such as whether to send an order for review. Name the condition you coded and show how the program followed the paths in the diagram.
Question 13: Tell me how you used code, documents and conversations to find the information that mattered for a programming change.
Example answerThe interviewer wants to see how you choose useful information from several sources before changing a program.
Use Situation, Task, Action, Result. Set up the programming change and the information gap. Name the sources you consulted, explain which details mattered to the requirements, and end with the effect on your code or tests.
Sample answer: "A spec asked me to add a late fee to overdue invoices but did not explain partial payments. I checked the billing code, the policy document and the business analyst's explanation. I set aside code for closed accounts because this change covered open invoices. The remaining sources still left a gap, so I sent the analyst examples of the different fee outcomes. The analyst confirmed the intended rule, and I used those examples in the tests."
Avoid listing sources without explaining their relevance, treating old code as the final authority, or guessing when the requirement remains unclear.
Interviewer tipA strong example compares sources and explains which details mattered to the programming change. Gathering documents without judging their relevance is a weak answer.
Candidate tipUse a real programming change. Name the sources you consulted, explain which details mattered to the requirements, and show how your choices shaped the code or tests.
Question 14: Share an example of a test you ran that helped you make a program more reliable.
Example answerThe interviewer wants to see whether you can design a test that exposes a reliability problem and verify that your change addresses it.
Pick one test and explain what led you to run it. Describe the inputs, the expected behavior and what actually happened. Say what you changed because of the result and what you saw when you repeated the test.
"I was testing a program that imported inventory files. I took a small sample and added an empty row between valid records because the files sometimes had blank lines. I expected the import to skip that row and finish. Instead, it stopped and left the rest of the file unread. I changed the reader to skip blank rows and ran the same file again. I checked that every valid record was imported and added the sample to our automated tests."
Avoid using a passing test as your entire example. Don't claim the fix worked without saying how you checked it.
Interviewer tipListen for a test that exposed a specific failure and a rerun that showed the fix worked. Disabling the failing test without fixing the problem is a red flag.
Candidate tipName the input or condition that exposed the failure, the fix you made, and the result when you ran that case again. If you kept the test to catch the same failure later, say so.
Question 15: Tell me about a time you applied a new programming tool, technology or technical information to improve your team's work.
Example answerThe interviewer wants to learn how you applied new technology or information to produce a useful change in programming work.
Use Situation, Task, Action, Result. Describe the team's need, the new tool or information and your role in applying it. Explain the checks you made and the benefit you could actually observe.
An illustrative example: "Our team maintained a reporting program, and I applied a new testing approach when adding an export. I started with a small part of the code, built checks for date handling and compared the generated files with known examples. I asked another developer to review the tests before we used them for later changes. A test caught an end-of-month date error before release. I corrected the export and added the case to our regular checks, so the team could catch the same error when changing that code again."
Avoid listing technologies without an application, claiming a tool was better simply because it was new, or inventing time savings. State any limits in how you measured the benefit.
Interviewer tipListen for a concrete application in code or a programming workflow and evidence of its benefit. Claiming improvement simply because the technology was new is a red flag.
Candidate tipName the new tool or information and the programming problem it addressed. Focus on how you applied it, checked the work and assessed the benefit to your team.
Question 16: Share an example of how you made sure a change to a shared data field was consistent everywhere the application used it.
Interviewer tipListen for how they tracked down uses of the field and checked that the change reached them. Assuming reports were unaffected without checking whether they used the field is a red flag.
Candidate tipPick one field you changed. Explain how you found where it was used, such as on a form or in a report, and what your checks showed.
Question 17: Give an example of how you turned the branches in a workflow diagram you drew into code.
Interviewer tipListen for a clear link between a decision in the diagram and the paths the code can take. Leaving out a branch the workflow calls for is a red flag.
Candidate tipPick one decision in the diagram and describe how you coded and checked each path from it. A course project or capstone works if you drew the diagram and wrote the code.
Question 18: Tell me about a time you spotted a problem in a program's output, logs or error reports before users did.
Interviewer tipListen for what they were watching, what made them notice, and how they confirmed and fixed the issue. Ignoring warnings until users complained is a red flag.
Candidate tipExplain what you were reviewing and what looked wrong. Describe how you checked the cause, what you did about it, and whether you added anything to catch it sooner next time.
Question 19: Describe your approach when a program you write has to process a very large volume of records.
Interviewer tipA strong answer covers testing with realistic data volumes, efficient queries or batching, and checks that no records were lost. Never having considered speed or data volume is a red flag.
Candidate tipUse a real example. Explain how you handled memory, speed and errors, how you tested with realistic data, and how you confirmed the output was complete and correct.
Question 20: Walk me through how you prioritize when bug fixes, change requests and new programming work all land on you at once.
Example answerThe interviewer wants to see how you decide what to work on when everything seems urgent, and whether you keep others informed. Explain your general method, then back it up with a recent example. Sample answer: "I sort work by impact and deadline. A bug that stops users from working comes first, then work with a fixed date, then smaller changes. When two requests compete and I'm not sure which matters more, I ask my lead rather than guess. Recently I was midway through a new feature when a bug stopped orders from saving. I paused the feature, fixed and tested the bug the same day, then told my lead the feature would be a day late and asked whether a small change request could wait until the following week. They agreed, and everything shipped in that order." Pitfalls to avoid: saying you just work harder or longer; treating every request as top priority; leaving your manager out when plans change.
Interviewer tipA strong answer weighs impact and urgency and checks priorities with the lead or manager. Working tickets strictly in arrival order, or never pushing back, is a red flag.
Candidate tipExplain the method you use, such as ranking by impact on users and by deadline, and give a recent example. Mention how you keep your lead informed when priorities change.
Question 21: Tell me about a time you had to tell a manager or client that a program would miss its deadline or had a serious bug.
Example answerThe interviewer wants to know whether you raise bad news early and honestly, and whether you bring options along with the problem. Use Situation, Task, Action, Result. Sample answer: "Two weeks before a release, I found that the data conversion I was writing would take much longer than planned, because the old records had far more errors than expected. I told my manager that day rather than hoping to catch up. I explained what I had found, showed a few examples of the bad records, and offered two options: move the date, or release with the clean records converted and fix the rest in a second pass. My manager chose the second option and explained the plan to the client. The release went out on time, and the second pass finished a few weeks later." Pitfalls to avoid: waiting until the deadline to speak up; blaming teammates or the client; bringing the problem with no ideas for what to do next.
Interviewer tipLook for early, honest notice with the facts, the impact and some options. Hiding the problem until the deadline, or blaming teammates, is a red flag.
Candidate tipSay what the news was, when and how you raised it, and what options you offered, such as a smaller scope or a fix plan. End with how the people involved responded.
Question 22: Tell me about a time you worked with a teammate who was hard to deal with, such as during code reviews or on a shared program.
Example answerThe interviewer wants to know whether you can work professionally with a difficult teammate while keeping programming work moving.
Use Situation, Task, Action, Result. Describe the behavior and its effect on the code review or shared program. Focus on your own actions, then explain the outcome and anything you would change.
Sample answer: "A teammate rejected my changes in code reviews with short comments that did not explain the problem. I asked for a conversation about a specific review. They were worried that the new code would be hard to test. I added testing notes to my changes, and we agreed that review comments should name the concern and explain the requested change. Our next review focused on test coverage rather than personal criticism. I learned to ask about a concern before assuming what a comment meant."
Avoid attacking the person's character, claiming you were entirely right, or hiding information to undermine them. Involving a lead can be appropriate when a conflict remains unresolved.
Interviewer tipListen for specific steps to resolve the code-review conflict and keep work moving. Personal attacks or hiding information to undermine the teammate are red flags; involving a lead can be appropriate.
Candidate tipDescribe the behavior, not the person's character. Explain what you did to keep the work moving, such as talking one on one or agreeing on review rules, and how the working relationship ended up.
Question 23: Tell me how you worked with an operations teammate or systems analyst to get a program running again after a scheduled run failed.
Example answerThe interviewer wants to see how you coordinate with operations or a systems analyst to restore a scheduled run and confirm it recovered.
Choose a failed run and explain what the program was meant to produce. Say what your teammate could see, what you checked in the program and how you agreed it was ready for another run. Describe how you verified the result together.
"A nightly report stopped before it produced its output. My operations teammate sent me the run log and confirmed the expected input file had arrived. I compared it with the previous day's file and found that a column header had changed. The report had stopped before writing anything. I updated the reader and checked both header versions with sample files. Operations restarted the job, and I checked the new report against the input before they marked the run complete."
Avoid retelling the incident without explaining the handoff. Don't assume a successful restart means the output is correct.
Interviewer tipListen for what each person contributed and how they confirmed that the next run worked. A red flag is calling the problem fixed without checking the new run.
Candidate tipBriefly describe the failed run, then say what your teammate saw in the run log and what you checked in the code. Finish with how you confirmed together that the program was working again.
Question 24: Share an effective method you have used to ensure that networks, workstations, central processing units, and peripheral equipment respond to programs' instructions.
Question 25: Describe an effective method you have used to maintain and control the use of computer systems software.
Question 26: Share an experience in which your contribution to the development of instructions for end users benefited your company.
Question 27: Describe a time when looking more closely at users' needs changed how you planned to build a feature.
Interviewer tipA strong answer connects a specific user need to a change in the feature design. Watch for a candidate who treats a guess about what users need as a confirmed requirement.
Candidate tipStart with the requirement you were given and the user need it left unclear. Explain the design choice you made once you understood that need and what the change let users do.
Question 28: Provide a time when you were able to identify a complex problem, evaluate the options, and implement a solution. How did the solution benefit your employer?
Example answerThe interviewer wants to see how you handle problems with many parts: how you break them down, choose a path, and follow through.
Use Situation, Task, Action, Result. Explain why the problem was complex, such as several causes or many people affected. Walk through how you found the root cause, the options you weighed, and how you put the solution in place. End with the benefit to your employer.
Sample answer: "Our monthly billing kept going out late. The cause wasn't one thing: data arrived late from two departments, and the billing software needed manual fixes. I mapped each step, timed them, and found the manual fixes took the most time. I compared hiring temporary help with automating the fixes, and we chose automation with help from our technology team. Billing went out on time for the next three months, and customers paid faster."
Pitfalls: Don't pick a simple problem and call it complex. Avoid skipping the options you considered. Don't take credit for others' work; name who helped.
Question 29: Share an experience in which your ability to consider the costs or benefits of a potential action helped you choose the most appropriate action.
Example answerThe interviewer wants to see that you think through the trade-offs of a decision before acting.
Use Situation, Task, Action, Result. Describe the decision, the options, and the costs and benefits you weighed, including money, time, risk, and the effect on people. Explain which you chose and how it turned out.
Sample answer: "Our team's printer broke for the third time in a year. One option was another repair, which was cheap. Another was a new printer, which cost more up front. I looked at the past year's repair bills and the downtime each breakdown caused. The repairs plus lost time were likely to cost more than a new machine over two years. I shared that with my manager, we bought a new printer, and we haven't had a breakdown since."
Pitfalls: Don't focus only on money; include time and people. Avoid a decision you made without checking the facts. Don't skip how it turned out.
Question 30: Tell me about a time you found an unusual approach to a programming problem that the obvious solution couldn't handle.
Interviewer tipListen for why the usual solution failed and how they tested the alternative. Needless complexity without explanation, documentation or a plan for maintenance is a red flag.
Candidate tipDescribe the problem and why the standard approach didn't fit. Explain your idea, how you tested it, and what it meant for the program or its users.
New to interviews? Start with the common questions every interview asks →