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
Cloud SQL, Spanner, and Bigtable
00:00
5 left

Cloud SQL, Spanner, and Bigtable

MediumSQL · PostgreSQL

Problem

How would you work with Cloud SQL, Cloud Spanner, or Cloud Bigtable?

For this hands-on SQL task, use the provided service and metric records to produce a current view of active services across these platforms. Include services without a metric and ignore metrics that do not belong to a listed service.

Output

  1. One row per active service, with service_name, platform, region, latest_latency_ms, latest_error_rate, and health_status
  2. Set health_status to NO_DATA when no metric exists, ATTENTION when latency is null or error rate exceeds 0.05, otherwise HEALTHY
  3. Sort by platform, then service_name

Schema

cloud_services
ColumnTypeDescription
service_idPKINTUnique service identifier
service_nameVARCHAR(100)Name of the configured service
platformVARCHAR(30)Cloud database platform
regionVARCHAR(50)Deployment region
is_activeBOOLEANWhether the service is currently active
service_metrics
ColumnTypeDescription
metric_idPKINTUnique metric record identifier
service_idINTReferenced cloud service
measured_atTIMESTAMPTime when the metric was captured
latency_msDECIMAL(10,2)Observed latency in milliseconds
error_rateDECIMAL(5,4)Observed request error rate
Tablescloud_servicesservice_metrics
Interviewer

Your question is Cloud SQL, Spanner, and Bigtable. 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.