Count arrays with per-index upper bounds and no two equal neighbors
Company: Deshaw
Role: Software Engineer
Category: Coding & Algorithms
Difficulty: hard
Interview Round: Other
Overview: Count integer arrays where each element lies between 1 and its own upper bound and no two neighbors are equal, modulo 10^9 + 7, for up to 10^5 positions and bounds up to 10^9. The problem tests dynamic programming over values and how to make each transition cheap when the value range is huge.