Data Axle interview question

Optimized version of Two Sum, Some SQL queries