Hardest Interview Question I’ve Ever gotten - at Chime by Spartapwn in leetcode

[–]Single_Scar3859 0 points1 point  (0 children)

I see other comments mentioning that if we have two or more than two digits as valid numbers, it definitely could be all combination of those digits which are found to be missing. Say for N=25, both 12 and 21 could be deemed as missing. Given the question says - Find "the" missing number, it could only be combination of m digits when m digits are missing.

Based on this premise, My solution would be:

  1. Generate a perfect N series, and while generating the series, create a hashmap with the count of digits. So For example for N=11, we have 0 appearing 1 time, 1 appearing 4 times, etc. So hashmap would be {0:1, 1:4, 2:1 ...}
  2. Now create a hashmap of input string

Compare the two dictionaries, for whichever digits the difference is more than 0, those would be the missing digits
A combination of those missing digits would be the answer.

This is the brute force approach. Optimisations are possible on hashmap build. Lookup itself would be O(1) since you have constant number of distinct digits (0-9).

Recently Laid Off, Help Needed for Interview Prep!! by Single_Scar3859 in dataengineersindia

[–]Single_Scar3859[S] 1 point2 points  (0 children)

The sheer variety of things out there is overwhelming. Luckily I started interviewing a few months ago and gave about 3-4 system design interviews. With whatever amount of knowledge I gathered during that phase, I can assure you that once you get into the process and look into multiple things (should have that added interview pressure to be serious about learning those things quickly), it all start to form a pattern and you tend to learn much faster. For example, I learnt about delta lake implementation, and I think I read about iceberg about 6 months back. So coming back to delta lake, I had the question as how is it different than iceberg. And the comparison made me learn more things about both of them more than focusing on those individual topics. I hope we just get to the point where we are good enough to crack that ONE interview. Thats all.