The Python kit
The standard-library moves that save minutes in the room, each one as the slow way and the fluent way, side by side.
Is it cheating to use the standard library in an interview?
No, and reaching for it is usually the signal the interviewer wants. Using Counter instead of building a dictionary by hand says you know the library you work in, and it buys back the minutes you need for the follow-ups. The one time to be careful is when the library call is the thing being tested: if the question is about heaps, reaching for heapq is right, but reaching for it and being unable to say what a sift-down does is not.
Will an interviewer ask me to implement these by hand?
Sometimes, and almost always for the combinatorial ones. Writing combinations or permutations as a recursion is a standard question in its own right, so know how to do both: call itertools in the solution, and be ready to write the six-line recursive version if asked. The same goes for a heap, for binary search, and for a hash map. Use the library, understand the internals.
Which of these change the complexity, and which only save typing?
Four change it outright: a deque instead of list.pop(0) turns a queue from O(n) per pop into O(1); joining a list of strings instead of repeated concatenation turns quadratic string building into linear; a bisect instead of a scan turns a lookup from O(n) into O(log n); and caching a recursion turns exponential into polynomial. The rest, such as enumerate, tuple unpacking and sort keys, cost the same to run and save you time and mistakes while writing.
Should I write everything as a comprehension?
Up to one comprehension with one condition. Past that the interviewer has to decode it while you talk, and anything they cannot read quickly works against you. A nested comprehension with two conditions and a conditional expression is the most common way a candidate loses the room while writing correct code. When a loop is clearer, write the loop.
What about numpy, sortedcontainers, or other third-party libraries?
Assume they are not available. Most interview environments give you the standard library only, and a solution built on sortedcontainers.SortedList usually dodges exactly the data structure the question was about. If the answer really wants a sorted multiset, say that a balanced tree or a skip list is what you would use in production, then build what you need from a heap, a sorted list with bisect, or two heaps.