Skip to main content
All Questions

Given time-sorted temperature and humidity readings tagged by city, find for each temperature reading the most recent humidity reading from the same city.

Unlock detailed company stats for this questionUpgrade
You have two lists sorted by time: temperature readings (time, city, value) and humidity readings (time, city, value). For each temperature reading, find the most recent humidity reading from the same city. Example: temperatures (1,NYC,12), (5,SFO,20), (7,NYC,23), (16,SFO,10); humidities (0,SFO,12), (3,SFO,2), (6,NYC,2), (19,SFO,9).

Community answers

No answers contributed by the community yet.

Related courses

Course

SQL Interview Prep Course

Prepare for SQL interviews with lessons on joins, aggregations, and window functions, then practice real SQL interview questions in an interactive editor with expert solutions.

Course

Data Science Interview Prep

Land your dream data science role at Google, Amazon, Microsoft, Meta, Apple, and other top companies. Learn from mock interviews, frameworks, and advice from senior candidates. Practice statistics, experimentation, coding, SQL, machine learning, behavioral interviews, and more.