FastPrepEvaluate Reverse Polish Notation
Problems/Evaluate Reverse Polish Notation

Evaluate Reverse Polish Notation

Coalition logoCoalition● MediumFULLTIMEPHONE SCREEN

Updated Nov 2026

QuestionFunctionExamplesConstraints

Problem statement

Source note: A Coalition interview report names a variation of Reverse Polish Notation. Our version uses the standard form with four operators. It is about 90% the same as the reported question.

Evaluate an arithmetic expression in Reverse Polish Notation. Each operator consumes the two preceding values, and integer division truncates toward zero.

Function

evalRPN(tokens: String[]) → int

Examples

Example 1

tokens = ["2","1","+","3","*"]return = 9

Add 2 and 1, then multiply the result by 3.

Constraints

  • 1 <= tokens.length <= 10000
  • Tokens are integers or one of +, -, *, /.
  • The expression is valid and no division uses zero.

More Coalition interview questions

  • Character Counts with Retried Remote WorkersPHONE SCREEN · Seen Oct 2026
  • Time Based Key-Value StoreOA · Seen Jul 2024

Similar questions at other companies

  • Evaluate Reverse Polish NotationAtlassian · OAAtlassian interview questions
  • Find the Value of a Postfix ExpressionExpedia · ONSITE INTERVIEWExpedia interview questions
  • Sliding Window Attention over a KV CacheNVIDIA · PHONE SCREENNVIDIA interview questions
  • Logistic Regression with Gradient DescentYahoo · PHONE SCREENYahoo interview questions
  • Asteroid CollisionSiemens · PHONE SCREEN
  • Constant-Time Weighted Pick with an Alias TableEtched · PHONE SCREEN
  • Billing Log with Undo and RedoReddit · PHONE SCREENReddit interview questions
  • Adaptive Calibration ErrorOpenAI · PHONE SCREENOpenAI interview questions
  • Random Pick with Weight Using Recorded DrawsGoogle · PHONE SCREEN · ONSITE INTERVIEWGoogle interview questions
  • Reachable Transfer PositionsCitadel · PHONE SCREENCitadel interview questions
See Coalition hiring insights
Saved
class Solution {
    public int evalRPN(String[] tokens) {
      // Write your code here.
    }

}
Checking account…