Shortest Prefix of a Digit String That Can Build Every Permutation of a Target
Company: Visa
Role: Software Engineer
Category: Coding & Algorithms
Difficulty: medium
Interview Round: Online Assessment
Overview: Given a digit string and a list of digit targets, return for each target the length of the shortest prefix whose characters could build every permutation of that target, or -1 if no prefix can. It tests character frequency counting, precomputation over a string, and answering many queries efficiently.
Read the full Visa Software Engineer interview experience this question came from