PracHub
QuestionsPremiumLearningGuidesCheatsheetNEWCoaches
|Home/Coding & Algorithms/Pinterest

Determine subsequence expression equals target

Last updated: Mar 29, 2026

Quick Overview

This question evaluates a candidate's ability to perform combinatorial search and expression evaluation over subsequences with operator insertion, testing algorithm design, state-space reasoning, and handling integer arithmetic constraints.

  • Medium
  • Pinterest
  • Coding & Algorithms
  • Software Engineer

Determine subsequence expression equals target

Company: Pinterest

Role: Software Engineer

Category: Coding & Algorithms

Difficulty: Medium

Interview Round: Technical Screen

##### Question Given a sequence of positive 32-bit integers A and an integer target, determine whether there exists a subsequence of A (each element used at most once) such that, by inserting '+' or '*' between the chosen numbers and evaluating strictly from left to right (addition and multiplication have equal precedence), the resulting expression equals target. Follow-up: propose pruning techniques to accelerate the search.

Quick Answer: This question evaluates a candidate's ability to perform combinatorial search and expression evaluation over subsequences with operator insertion, testing algorithm design, state-space reasoning, and handling integer arithmetic constraints.

Related Interview Questions

  • Design Hierarchical Permission Checks - Pinterest (medium)
  • Implement weighted random choice - Pinterest (medium)
  • Solve five hard algorithm problems - Pinterest
  • Sample a string by real-valued scores - Pinterest (hard)
  • Find First Prefix-Matching Word - Pinterest (medium)
Pinterest logo
Pinterest
Aug 4, 2025, 10:55 AM
Software Engineer
Technical Screen
Coding & Algorithms
5
0
Question

Given a sequence of positive 32-bit integers A and an integer target, determine whether there exists a subsequence of A (each element used at most once) such that, by inserting '+' or '*' between the chosen numbers and evaluating strictly from left to right (addition and multiplication have equal precedence), the resulting expression equals target. Follow-up: propose pruning techniques to accelerate the search.

Comments (0)

Sign in to leave a comment

Loading comments...

Browse More Questions

More Coding & Algorithms•More Pinterest•More Software Engineer•Pinterest Software Engineer•Pinterest Coding & Algorithms•Software Engineer Coding & Algorithms
PracHub

Master your tech interviews with 7,500+ real questions from top companies.

Product

  • Questions
  • Learning Tracks
  • Interview Guides
  • Resources
  • Premium
  • For Universities
  • Student Access

Browse

  • By Company
  • By Role
  • By Category
  • Topic Hubs
  • SQL Questions
  • Compare Platforms
  • Discord Community

Support

  • support@prachub.com
  • (916) 541-4762

Legal

  • Privacy Policy
  • Terms of Service
  • About Us

© 2026 PracHub. All rights reserved.