FastPrepWorkflow Service Operations
Problems/Workflow Service Operations

Workflow Service Operations

FurtherAI logoFurtherAI● MediumFULLTIMEPHONE SCREEN

Updated Nov 2026

QuestionFunctionExamplesConstraints

Problem statement

Source note: The report asks for a service that creates workflows and runs workflows that were created earlier. We chose how the input is given, simple integer transforms that always give the same result, what happens with duplicates, and the result strings.

You are given a list of workflow operations. Run them in order. A workflow has a unique ID and an ordered list of integer steps. A step is ADD:x, SUB:x, or MUL:x.

  • ["CREATE", id, step1, step2, ...] stores a workflow with at least one step and returns OK. If the ID already exists, it returns EXISTS and keeps the old workflow.
  • ["EXECUTE", id, payload] applies every stored step to payload in order and returns the final integer as a decimal string. If the ID does not exist, it returns NOT_FOUND.

Return one result per operation, in input order.

Function

runWorkflows(operations: String[][]) → String[]

Examples

Example 1

operations = [["CREATE","w1","ADD:3","MUL:2"],["EXECUTE","w1","4"],["CREATE","w1","SUB:1"],["EXECUTE","missing","7"]]return = ["OK","14","EXISTS","NOT_FOUND"]

The workflow adds three to the payload, then multiplies by two. For the payload four that is (4 + 3) * 2, which is fourteen. The second create for the same ID is rejected because it already exists. The last execute names a workflow that was never created.

Example 2

operations = [["CREATE","negate","MUL:-1"],["EXECUTE","negate","9"],["EXECUTE","negate","-4"]]return = ["OK","-9","4"]

The workflow multiplies by negative one. Nine becomes negative nine, and negative four becomes four. The same stored steps are used for each execute, and running them does not change the workflow.

Constraints

  • 1 <= operations.length <= 10^5.
  • Each workflow contains between 1 and 50 valid transform steps.
  • Workflow IDs are non-empty strings without :.
  • Payloads, operands, and every intermediate result fit in a signed 64-bit integer.

More FurtherAI Phone Screen questions

  • Merge Overlapping IntervalsPHONE SCREEN · Seen Oct 2026

Similar questions at other companies

  • LRU Cache for Query ResultsAmazon · PHONE SCREEN · ONSITE INTERVIEW
  • In-Memory Filesystem CommandsPerplexity AI · PHONE SCREEN · ONSITE INTERVIEWPerplexity AI interview questions
  • LRU CacheServiceNow · PHONE SCREEN · ONSITE INTERVIEWServiceNow interview questions
  • Mutable Points in a Hash Set and a ListMillennium · PHONE SCREENMillennium interview questions
  • Rectangle Point Coverage CountsOpenAI · PHONE SCREEN · ONSITE INTERVIEWOpenAI interview questions
  • File Storage ServiceCresta · PHONE SCREENCresta interview questions
  • Camel CardsRippling · PHONE SCREEN · ONSITE INTERVIEWRippling interview questions
  • Return Every Matching DecryptionDuolingo · PHONE SCREENDuolingo interview questions
  • Corporation Reporting LinesMicrosoft · PHONE SCREENMicrosoft interview questions
  • Key-Value Store on a Block DeviceLambda · PHONE SCREEN
See FurtherAI hiring insights
Saved
class Solution {
    public String[] runWorkflows(String[][] operations) {
        // Write your code here.
    }
}
Checking account…