Company
Date Published
Author
-
Word count
998
Language
English
Hacker News points
None

Summary

Participating in the Advent of Code challenges, engineers at Heap explored solving problems using both JavaScript and PostgreSQL, discovering intriguing insights into SQL's capabilities. They highlighted the utility of window function ranges, which allow for dynamic data manipulation, as well as the advantages of Common Table Expressions (CTEs) over traditional subqueries for their clarity and ability to handle recursive tasks. The team also learned the value of thinking relationally rather than iteratively, which helped them address complex problems like determining bingo board winners by abstracting iterative logic into a sorting problem. They were surprised by the compactness and elegance of SQL solutions compared to JavaScript, particularly in tasks such as calculating positions with directional commands. This exercise not only enriched their algorithmic skills but also reflected Heap's engineering culture, emphasizing growth and collaboration, as they actively use PostgreSQL and engage in coding challenges.