Dataford
Interview QuestionsInterview GuidesExperiencesMock InterviewsPricing
Get started

Top Updated Map Segments Query

MediumSQL · PostgreSQL00:00
Practice interviewer
In session
5 left
00:00

Your question is Top Updated Map Segments Query. Start with the requirements and the two tables on the right.

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.

Problem

HERE Technologies monitors map quality by tracking changes made to segments in the HERE map database. Write a PostgreSQL query to identify the five most frequently updated map segments in the Central Europe region during the 30-day period ending February 15, 2025.

Requirements

  1. Count updates for each map segment using only updates from January 16, 2025 through February 15, 2025, inclusive.
  2. Restrict results to the Central Europe region.
  3. Return the five segments with the highest update counts, including ties in the ordering by segment_id ascending.

Schema

map_segments
ColumnTypeDescription
segment_idPKINTUnique map segment identifier
segment_nameVARCHAR(100)Human-readable segment name
region_nameVARCHAR(50)HERE map region containing the segment
is_activeBOOLEANWhether the segment is currently active
segment_updates
ColumnTypeDescription
update_idPKINTUnique update event identifier
segment_idINTUpdated map segment
updated_atTIMESTAMPTimestamp when the update was recorded
update_typeVARCHAR(30)Type of map change
updated_byVARCHAR(80)Source or analyst responsible for the update
Tablesmap_segmentssegment_updates
Your solutionPostgreSQL
You need to log in / sign up to run or submit.
Run a query to see results