I am preparing for a Google interview. I am confused whether to choose C++ or Python. I used to do competitive programming in C++ during my college days. However I am out of touch now. I am very comfortable solving problems in Python. However, there is no good STL support. For instance, there isn't any TreeMap or TreeSet. OrderedDict doesn't allow insertions in sorted order after the dict is created. I wonder if anyone had interviewed with Google and faced this problem of having to implement these data structures during the interview. Should I use Python to prepare for my interviews. Will there be any issues while practicing on LeetCode or InterviewBit using Python due to its disadvantages (Time limit exceeded, Recursion limit, etc.) #leetcode
You can use made up data structures. Just need to explain how it works
Also you should achieve a TreeMap complexity using a sorted list and a binary search, IMO.
You can't insert in a sorted list in O(lgN) after you have constructed it
After about 225 leetcode in java I’ve only used tree map probably once. Linked Hashmap (I believe similar to ordered dict) only a couple times also, most notable is LRU cache. I wouldn’t worry about the lack of DS like these, Python has the core DS that you need. It’s the most common language for interviews. Writing python is usually much faster, which is super helpful. I spend way too much time in interviews writing Map<String, String> myMap = new Hashmap<String, String>() etc.
Clearly you haven't interviewed with Google before. It's all white boarding. Phone is done over hangout and Googlee docs. You can use whatever language you want.
So I can make up some interface and assume that a Data structure exists even if it doesn't ?
If it's a common data structure, yes. You just need to mention it, and explain why you choose it. No one expects you to reinvent the wheel within 45min.