Tech interviews have a magic answer: The hashmap. “Great solution, how would you optimize it?” Hashmap!
You get the job and start to work. Your vast interview prep (and half of college) prepared you to answer every question with a hashmap. Sometimes a graph. And in life that instinct is wrong.