Turing·Software Engineer·Online Assessment (OA)
Mar 2026
Got a coding problem from Turing that was basically LC 629 in disguise. Standard DP inverse pairs problem, nothing too surprising if you've seen it before.
- Given two integers m and n, count the number of permutations of length m that contain exactly n inverse pairs (where an inverse pair is a pair of indices x < y such that the value at x is greater than the value at y). Return the result modulo 10^9 + 7.
“I recognized this pretty quickly as a DP problem but still fumbled the transition for a few minutes.”