logo

AQA A-Level Computer Science practice

Describe what happens to stack frames when subroutine A calls subroutine B, and subroutine B then calls subroutine C. Explain the order in which the frames are used and removed, and why each frame must retain its own information.

Try the question first, then check the answer and practise the same topic again.

At a glance

Question

Type

practice

Style

Topic

Programming

Exam-style question

Try this first

Describe what happens to stack frames when subroutine A calls subroutine B, and subroutine B then calls subroutine C. Explain the order in which the frames are used and removed, and why each frame must retain its own information.

Answer and explanation

Concise answer

A stack frame for subroutine A is active first.

Why this is correct

The essential sequence is last in, first out: C's frame is removed first, then B's, while A's remains below them. The explanation must also connect separate frames with the preservation of return addresses, parameters and local variables.

Use the concise answer above for a quick check, then reveal the full model answer and detailed explanation.

Common mistake

No common mistake is linked to this question yet.

Related flashcards

No flashcards are published for this page yet.

Related practice questions