XYZ (Turkey) interview question

how to implemented memory stack