FastPrepTask Row Modifications
Problems/Task Row Modifications

Task Row Modifications

Notion logoNotion● EasyFULLTIMEONSITE INTERVIEW

Updated Nov 2026

QuestionFunctionExamplesConstraints

Problem statement

Source note: An onsite report gives a task node that holds rows. It asks for row sums, and a method to modify rows: add, delete, or move a row between tasks. We chose the row IDs and how operations are written, so the API can run.

Our version is about 97% the same as the reported question.

Each task owns zero or more integer-valued rows. Process these operations:

  • ["ADD", taskId, rowId, value] adds a new row to a task.
  • ["DELETE", taskId, rowId] deletes that row.
  • ["MOVE", fromTaskId, toTaskId, rowId] removes the row from task fromTaskId and inserts the same row ID and value into the destination task.
  • ["SUM", taskId] returns the decimal sum of every row currently owned by that task. An empty or unseen task sums to 0.

Return the values produced by SUM operations in order.

Function

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

Examples

Example 1

operations = [["ADD","t1","r1","4"],["ADD","t1","r2","7"],["SUM","t1"],["MOVE","t1","t2","r2"],["SUM","t1"],["SUM","t2"],["DELETE","t2","r2"],["SUM","t2"]]return = ["11","4","7","0"]

Moving r2 transfers its value from t1 to t2. Deleting it then leaves t2 empty.

Constraints

  • 1 <= operations.length <= 20000.
  • Task and row IDs are non-empty ASCII strings containing no whitespace.
  • Values are decimal integers in [-10^9, 10^9].
  • An ADD row ID is absent from its task.
  • A DELETE or MOVE source row exists, and a moved row ID is absent from the destination task.
  • Every task sum fits a signed 64-bit integer.

More Notion interview questions

  • Nested Todo ListPHONE SCREEN · ONSITE INTERVIEW · Seen Sep 2026
  • Top Error Types in a Time WindowONSITE INTERVIEW · Seen Jun 2026
  • DAG Downstream NodesONSITE INTERVIEW · Seen Apr 2026
  • Mutable Table AggregationsPHONE SCREEN · ONSITE INTERVIEW · Seen Apr 2026
  • Page Permission InheritancePHONE SCREEN · ONSITE INTERVIEW · Seen Mar 2026
  • Text Document HistoryPHONE SCREEN · ONSITE INTERVIEW · Seen Mar 2026
  • Sliding Window MedianONSITE INTERVIEW · Seen Oct 2025
  • JSON Block Tree OperationsONSITE INTERVIEW · Seen Jul 2025
  • Block Type with the Most ChildrenPHONE SCREEN · Seen Mar 2026
  • Country with the Most EventsPHONE SCREEN · Seen Mar 2026

Similar questions at other companies

  • Basic In-Memory SpreadsheetGoogle · ONSITE INTERVIEWGoogle interview questions
  • Mutable Record Store with Error ResultsSquarepoint Capital · ONSITE INTERVIEWSquarepoint Capital interview questions
  • Phone Spam Report CounterPinterest · ONSITE INTERVIEWPinterest interview questions
  • Card Transaction StreamCapital One · ONSITE INTERVIEWCapital One interview questions
  • File System Shell CommandsHarvey · ONSITE INTERVIEWHarvey interview questions
  • 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
  • Random Dasher Set OperationsDoorDash · ONSITE INTERVIEWDoorDash interview questions
  • Rectangle Point Coverage CountsOpenAI · PHONE SCREEN · ONSITE INTERVIEWOpenAI interview questions

Notion interview experiences

  • Notion Interviews, Level Not Reported: 20 Experiences
  • Notion Experienced SWE Interviews: 7 Experiences
  • Notion SWE New Grad Interviews: 3 Experiences
  • Notion SWE Intern Interviews and Debugging Round: 6 Experiences
  • Notion New Grad SWE Onsite Invitations: 2 Experiences
All Notion interview questionsSee Notion hiring insights
Saved
class Solution {
    public String[] runTaskRowModifications(String[][] operations) {
        // Write your code here.
    }
}
Checking account…