Citi Technology OA 2023 Experience | Backtracking, Expression Generation, Recursion and Interview Preparation Guide

Question · Posted Jun 2026

Problem Statement You are given a string num containing only digits and an integer target. Return all possible expressions by inserting the operators: + (Addition) - (Subtraction) * (Multiplication) between the digits so that the resulting expression evaluates exactly to target. Note Digits must remain in their original order. Numbers cannot contain leading zeros. Return all valid expressions. Example 1 Input num = "123" target = 6 Output ["1+2+3", "1*2*3"] Explanation 1 + 2 + 3 = 6 1 * ...

The full answer & interview discussion are available to premium members.

Log in Create a free account