When to code data structures vs. using libraries?

During interviews, when should I be prepared/expected to code standard data structures from scratch (stacks, queues, hashmaps, etc.) vs. using the standard libraries provided by the language?

I just completed a LeetCode easy question using Java's HashMap, but I want to know if I was in an interview if I would be expected to implement the hash table manually, especially on easier problems.

Comments (1)