Squarespace
4 questions · 4 experiences · LeetCode (2) · 1p3a (2) · Other (4)
8 entries
Squarespace Software Engineer Tech Screen Range Intersection Coding Question
1p3a
SWE
Jan 2026
Question
#88 Merge Sorted Array
LeetCode
SWE
Experience
#1893 Check if All the Integers in a Range Are Covered
LeetCode
SWE
Experience
Squarespace onsite interview?
Reddit
Backend
Sep 2017
Experience
Menu Filters
InterviewDB
Question
Numbers That Belong
InterviewDB
Question
Slideshow Frontend
InterviewDB
Question
Squarespace Software Engineer Fulltime Tech Phone Screen Interview Overview
1p3a
SWE
Apr 2026
Experience
1p3a
Question
·
Jan 2026
Squarespace Software Engineer Tech Screen Range Intersection Coding Question
Question Details
Question You are given an array of integers "values". Another array "ranges" has each element as a 2-list - [start, end] where "start" and "end" denote a range (start is always < end). Find the number of elements in "values" which are covered by every range (inclusive). For eg, values = [2, 5, 13, 7, 17] ranges = [[2, 10], [2, 5], [1, 17]] Answer = 2 because only values 2 and 5 are covered by every range. ## Solution: We need to find the intersection of all intervals in the ranges array to create a single interval. Those values which are covered by this single interval will count to our result: def count_values_in_all_ranges(values, ranges) -> int: # Intersection of all inclusive ranges L = float("-inf") R = float("inf") for s, e in ranges: L = max(L, s) R = min(R, e) if L > R: # if no valid intersection exists return 0 # Count values covered by the final intersection interval return sum(1 for v in values if L <= v <= R)
Free preview. Unlock all questions →
Topics
Arrays