Dsa
Recursion
Medium
Expression Evaluator
You are tasked with evaluating a string representing a simple mathematical expression consisting of non-negative integers and operators (+, -, *) without any parentheses. Write a function that evaluates the expression and returns the result. For example:
Input:
"3 + 5 * 2"
Output:
13
The input will be a string expression, and the output will be a single integer representing the result of the evaluation.
Key concepts
recursionbacktracking
Practise this out loud — free
Start a mock interview on THIS exact question — a voice AI interviewer opens with it, pushes back like a real onsite, then hands you an instant scorecard.
🎙 Practise this question now