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
ExperiencesCoaching
New
Practice
Mock InterviewsTimed interview simulations with feedbackSuccess 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
Start free
Basic Database and C Problem
00:00
5 left

Basic Database and C Problem

MediumSQL · PostgreSQL

Problem

Tell me about your basic database knowledge, solve a C problem, and describe your previous projects.

For the database portion, write a PostgreSQL query using the provided Comcast tables. Return one row per plan with at least one active subscriber, including active subscribers, tickets, resolved tickets, and average resolution time.

Output

  1. Columns: plan_name, active_subscriber_count, ticket_count, resolved_ticket_count, avg_resolution_hours
  2. Include only plans with at least one active subscriber.
  3. Order by active subscriber count descending, then plan name ascending.

Schema

xfinity_plans
ColumnTypeDescription
plan_idPKINTUnique Comcast plan identifier
plan_nameVARCHAR(100)Plan name
monthly_priceDECIMAL(10,2)Monthly plan price
xfinity_subscribers
ColumnTypeDescription
subscriber_idPKINTUnique subscriber identifier
subscriber_nameVARCHAR(100)Subscriber name
plan_idINTSubscribed plan identifier
statusVARCHAR(20)Subscriber status
xfinity_support_tickets
ColumnTypeDescription
ticket_idPKINTUnique support ticket identifier
subscriber_idINTSubscriber associated with the ticket
statusVARCHAR(20)Ticket status
resolution_hoursDECIMAL(10,2)Hours required to resolve the ticket
issue_typeVARCHAR(50)Support issue category
Tablesxfinity_plansxfinity_subscribersxfinity_support_tickets
Interviewer

Whenever you're ready, walk me through your approach or go straight to the code. The requirements and the three tables are in the Question tab.

Sign up free to run or submit. Log in
CodePostgreSQL
Sign up free to run your code. Your draft is saved.Run with a free accountLog inLn 1
Run your query to see results here.