Member-only story
This is why I think Senior Engineers aren't clearing interviews

I want to cover a serious issue highlighted by a video posted by Gaurav Sen sometime back:
I want to show another point of view. What happens beyond the point Gaurav makes with a simple instance. I will take the leetcode problem of Wildcard Matching for this instance.
If you have never done this problem before, how would a Senior Engineer think of approaching it? Well, this is one way I would approach it:
class Solution:
MATCH_TERMS = ("?", "*")
def isMatch(self, s: str, p: str) -> bool:
print(f"s={s} p={p}")
s_len = len(s)
match p:
case "":
return False
case "*?":
return self.match_all_single_char(s)
case "?*":
return self.match_single_char_all(s)
case "*":
return True
case "?":
return self.match_single_char(s)
case single_char_pat if len(single_char_pat) == 1:
return s_len == 1 and single_char_pat == s
case p if p == s:
return True…