# Evaluate postfix arithmetic with a stack

> ML Prep screening item.

- Stable ID: `prog-ds-postfix-stack`
- Collection: screening
- Area: Programming
- Topic: Data Structures
- Origin: original
- Difficulty: medium
- Expected time: 12 minutes
- Skills: stack
- Item JSON: https://mlprep.iwase.dev/item/prog-ds-postfix-stack.json

## Problem

Implement `evaluate_postfix(tokens)` for a valid postfix expression whose
tokens are integer literals or `+`, `-`, and `*`. For an operator, pop the
right operand and then the left operand. Return the final integer.


## 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-ds-postfix-stack`, and record a real attempt with `recorded_by: "agent"` and `agent_session_id` when available using https://mlprep.iwase.dev/schema/attempt-record.json.
