I am having Facebook interview after New Year. I have done around 300 problems on leetcode (past 6 months Facebook tag) I know the idea and implementation of BIT but I don't quite able to utilize it. I can only solve simple BIT question like Range Sum Query 2D - Mutable. As to more advanced questions like Count of Range Sum, Reverse Pairs, Count Of Smaller Numbers After Self and etc, I am still having troubles to understand the solution in discussion, (either BIT, merge sort or BST) Do I need to spend more time on this category or I should practice other medium level questions? Thanks
Dont overprepair. have real interviewing practice.
Don't worry about BIT.
Do easy and medium problems in leetcode. Facebook interviewers count only how many problems you can solve in 45 mins hence. Go fast don't try to add too many test cases or verify if your code works well.
Don’t worry about Binary Indexed Trees, but make sure you know Fenwick Trees.
Both are same. One thing is important, why use this complex logic when prefix sum achieved results in O(1). Sum is o(1) in prefix sum but update is o(n). In large scale system, sum >> update
“Both are same.” ...that’s the joke...
Come on, you’re so close! You can do it.
thanks