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
Compare Error Volume Before and After Release
00:00
5 left

Compare Error Volume Before and After Release

HardSQL · PostgreSQL

Problem

You are given release records and application error logs. Write a PostgreSQL query that compares error volume in the 7 days before each release to the 7 days after it, and returns the release version, release date, pre-release error count, post-release error count, and the percentage change in error volume.

Use the release date as the boundary: the pre-release window is the 7 full days before the release date, and the post-release window is the 7 full days starting on the release date. Exclude releases that do not have any error logs in either window.

Schema

releases
ColumnTypeDescription
release_idPKINTPrimary key for the release record
release_versionVARCHAR(50)Human-readable release version
release_dateDATEDate the software release went live
error_logs
ColumnTypeDescription
error_idPKINTPrimary key for the error event
release_idINTForeign key to releases.release_id
error_timestampTIMESTAMPWhen the error occurred
error_severityVARCHAR(20)Severity label for the error
service_nameVARCHAR(50)Service where the error occurred
Tablesreleaseserror_logs
Interviewer

Your question is Compare Error Volume Before and After Release. Start with the requirements and the two 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.