You wrote the correct algorithm and the interviewer stopped at your variable declaration. What did the collection type give away?
A declaration shows whether you chose a structure for its access pattern: Stack or LinkedList where ArrayDeque belongs, a List used for membership tests, a concrete type on a signature. Programming to interfaces helps only if the code stays efficient for every implementation it accepts.