Skip to main content
All Questions

Given (city, time, humidity) records and (city, time) queries, return for each query the humidity of that city's latest record at or before the query time.

Unlock detailed company stats for this questionUpgrade
You have humidity records, each a (city, time, humidity) triple, and a list of queries, each a (city, time) pair. For every query return the humidity from that city's record whose time is closest to the query time without being later than it.

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.