MathWorks interview question

DP stack queue programming DS