Dataford
Interview QuestionsInterview GuidesExperiencesCoaching
New
Pricing
Get started
Dataford
Popular roles
Software EngineerData AnalystData ScientistData EngineerBusiness AnalystAI EngineerMachine Learning EngineerProduct Manager
Browse
Browse All RolesEvery role hub, from analyst to MLBrowse All CompaniesCompany-specific interview loopsAll Interview GuidesThe full guide library
Top questions by role
Software EngineerData AnalystData ScientistData EngineerBusiness AnalystAI EngineerMachine Learning EngineerProduct Manager
Top questions by skill
SQLPythonStatisticsMachine LearningA/B TestingSystem DesignGenerative AIProduct SenseMetricsBehavioral
Browse all questions →Try a mock interview
Experiences
Practice
Mock InterviewsTimed interview simulations with feedbackCoaching1:1 coaching with people at your target companiesSuccess PathYour 6-week structured planModulesCurated lessons by topicWebinarsTalks from ex-Big Tech data leadsPlaygroundA free-form scratch editor
Learn
BlogInterview strategy and career adviceTech Job Market ReportHiring trends across data and AI rolesFor UniversitiesDataford for career centersAbout DatafordWho we are and how we build
Pricing
Build my plan
Delinquent Loans Query
00:00
5 left

Delinquent Loans Query

MediumSQL · PostgreSQL

Problem

Write a query to identify all mortgage loans that have been delinquent for more than 90 days at Cenlar FSB, including the borrower's payment history and the total outstanding principal balance.

Use the provided loan, borrower, loan account, and payment tables. Include loans without payment records, preserve payment chronology, and exclude loans at exactly 90 days delinquent or less.

Output

  1. One row per delinquent loan and payment record.
  2. Include loan_id, borrower details, delinquency days, payment details, prior payment date, payment status, and outstanding_principal_balance.
  3. Order by loan_id, payment_date, and payment_id.

Schema

mortgage_loans
ColumnTypeDescription
loan_idPKINTUnique mortgage loan identifier
borrower_idINTBorrower associated with the loan
current_delinquency_daysINTCurrent number of days the loan is delinquent
loan_statusVARCHAR(30)Current servicing status
borrowers
ColumnTypeDescription
borrower_idPKINTUnique borrower identifier
borrower_nameVARCHAR(100)Borrower's full name
borrower_stateVARCHAR(2)Two-letter borrower state code
loan_accounts
ColumnTypeDescription
loan_idPKINTMortgage loan identifier
original_principalNUMERIC(14,2)Original principal amount
outstanding_principal_balanceNUMERIC(14,2)Current unpaid principal balance
mortgage_payments
ColumnTypeDescription
payment_idPKINTUnique payment identifier
loan_idINTMortgage loan receiving the payment
payment_dateDATEDate the payment was recorded
payment_amountNUMERIC(12,2)Total payment amount
principal_paidNUMERIC(12,2)Amount applied to principal
payment_methodVARCHAR(30)Method used to submit payment
Tablesmortgage_loansborrowersloan_accountsmortgage_payments
Interviewer

Your question is Delinquent Loans Query. Start with the requirements and the four tables in the Question tab.

Run and submit as often as you like. When you're ready, talk me through your approach or go straight to the code.

You need to log in / sign up to run or submit.
CodePostgreSQL
Sign up free to run your codeLog inLn 1
Run your query to see results here.