How do you extrapolate the patterns/themes learned from just 50-100 problems to any unseen problem? Recently I was asked a question at a company a modification of 24 game(Leetcode title) where I was asked to print all solutions which evaluate to a target using arithmetic operators. Now on the first look it seems it's easy to solve it using backtracking but in order to come up with different ways to add brackets you realize that you need to use divide and conquer to generate all combinations of brackets and digits along with arithmetic operators. Eventually I wasn't able to come up with solution using brackets but could solve it without brackets. Tl;dr My question is how do you find a pattern which you haven't encountered before or haven't practiced enough on the spot during onsite interview? Is it pure brain power or something else?
I think the way you approach the practice is critical. I would suggest timing yourself (25 min), then tackle every topic on LC. Any single one you struggle with, tackle more of said topic. Repeat until you’re rolling in stacks.
pinterest?
Try interviewcake, in addition to leet code. They focus a lot on patterns and how to think about a solution.
Is it worth the money ($250)?
Full refund if you are not satisfied and don't get the job.
It's luck. Keep interviewing and you will eventually get an interview where you happen to know the answers.
which company?