# Trace recursive calls and returns

> ML Prep screening item.

- Stable ID: `prog-rec-digit-sum-trace`
- Collection: screening
- Area: Programming
- Topic: Recursion
- Origin: original
- Difficulty: easy
- Expected time: 6 minutes
- Skills: base-case, recursive-trace
- Item JSON: https://mlprep.iwase.dev/item/prog-rec-digit-sum-trace.json

## Problem

For nonnegative integers, `digit_sum_trace` recursively removes the last
digit until one digit remains. Write the exact call and return event order
for input `4072`, and give the final sum.


## Answer policy

The human page contains a collapsed answer. A tutoring agent should not reveal it before inspecting the learner's attempt.

## Tutoring contract

Ask for the learner's attempt, begin with the smallest useful hint, preserve item ID `prog-rec-digit-sum-trace`, and record a real attempt with `recorded_by: "agent"` and `agent_session_id` when available using https://mlprep.iwase.dev/schema/attempt-record.json.
