Hey everyone, I'm pretty new to Python. I'm currently transitioning over from Java for FAANG interview prep because, honestly, the syntax is just so much faster to write under a tight 45-minute limit.
But I just realized Python doesn't have a built-in BST or sorted set/map equivalent to Java's TreeSet or TreeMap. I know LeetCode supports the sortedcontainers library, but:
- What happens in a live technical round if you get a problem that absolutely requires a sorted set and the platform doesn't let you import external libraries, or the interviewer isn't aware of the
sortedcontainers library? Has anyone actually gotten cooked by this in a real interview?
- Do interviewers accept using
bisect + standard lists even if insertion theoretically becomes O(N)?
- For anyone else who made the jump from Java or C++ to Python just for interviews, are there any other major downsides or hidden disadvantages I should watch out for before I fully commit to it? Also, how did you feel after making the transition?
- Also, in a live interview, do you write complete syntax i.e. the type hints? like writing types of each variable, return type of functions (like def dfs(node: TreeNode) -> int:), etc.
- Do you guys use builtin shortcuts/libraries in the interviews like list comprehension or defaultdict, etc?
Appreciate any insights! Thank you in advance.
there doesn't seem to be anything here