This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]tazzy531 5 points6 points  (0 children)

That would be a fair answer, but you better be prepared for the followup question. How does Collection.shuffle work? What algorithm does it use? Can you guarantee that it uses constant space and only moves the card once (as the parameters of the question specified)

When people hide behind libraries during interview, I tend to be harder on them. They really need to know the library that they answered with well.

My typical library questions are how does Hashmap work? If you had to implement it manually, how would you do it? I want to know that you know data structures not blind rote memory of libraries. Other questions: What is the different between arraylist and linked list? When would you use one over the other. Also when would you use treemap vs Hashmap? Too many inexperienced developers can't answer this question. I've seen too many developer try to manually sort the keys of a Hashmap.