IBM interview question

Intro and stack and queue, Dp