FastPrepBasic In-Memory Spreadsheet
Problems/Basic In-Memory Spreadsheet

Basic In-Memory Spreadsheet

Google logoGoogle● EasyFULLTIMEONSITE INTERVIEW

Updated Nov 2026

QuestionFunctionExamplesConstraints

Problem statement

Source note: The interview report keeps cell assignment and lookup as the first spreadsheet requirement, but leaves out the later requirements. This version uses a finite list of operations and checks only that set and get work reliably. Our version is about 75% the same as the reported question.

Implement the basic storage layer of an in-memory spreadsheet.

Process the operations in order:

  • ["SET", cell, value] stores the string value in cell, replacing any prior value.
  • ["GET", cell] appends the cell's stored value to the result, or the empty string if the cell has not been set.

Return the values produced by all GET operations in order.

Function

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

Examples

Example 1

operations = [["SET","A1","12"],["GET","A1"]]return = ["12"]

The lookup returns the value stored in A1.

Example 2

operations = [["GET","B2"],["SET","B2","hello"],["GET","B2"]]return = ["","hello"]

An unset cell is blank; after assignment, the stored value is returned.

Example 3

operations = [["SET","C3","first"],["SET","C3","second"],["GET","C3"]]return = ["second"]

A later assignment replaces the previous value.

Constraints

  • 1 <= operations.length <= 100000.
  • Every operation is a valid SET or GET in the documented form.
  • Cell identifiers contain one to twenty uppercase letters or digits.
  • Stored values have length at most 100 and may be empty.

More Google Onsite Interview questions

  • Evaluate a Nested Math ExpressionPHONE SCREEN · ONSITE INTERVIEW · Seen Nov 2026
  • Distinct Subset SumsONSITE INTERVIEW · Seen Nov 2026
  • Playlist With No Same Artist in a RowONSITE INTERVIEW · Seen Nov 2026
  • Route Pattern MatcherPHONE SCREEN · ONSITE INTERVIEW · Seen Nov 2026
  • Delete Nodes and Return Forest RootsONSITE INTERVIEW · Seen Nov 2026
  • Dice-Walk Winning ProbabilityPHONE SCREEN · ONSITE INTERVIEW · Seen Nov 2026
  • First and Last Target Position in a Mountain ArrayONSITE INTERVIEW · Seen Nov 2026
  • Lowest Common Ancestor in an N-ary TreePHONE SCREEN · ONSITE INTERVIEW · Seen Nov 2026
  • 0/1 Knapsack with Weight and Volume LimitsONSITE INTERVIEW · Seen Nov 2026
  • Batched Subsequence Word MatchesONSITE INTERVIEW · Seen Nov 2026

Similar questions at other companies

  • Mutable Record Store with Error ResultsSquarepoint Capital · ONSITE INTERVIEWSquarepoint Capital interview questions
  • Phone Spam Report CounterPinterest · ONSITE INTERVIEWPinterest interview questions
  • Task Row ModificationsNotion · ONSITE INTERVIEWNotion interview questions
  • Card Transaction StreamCapital One · ONSITE INTERVIEWCapital One 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
  • In-Memory Vault File SystemHarvey · ONSITE INTERVIEWHarvey interview questions

Google interview experiences

  • Google interviews · November 2026
  • Google Software Engineer Onsite Questions: 10 Experiences
  • Google OA: What It Tests (2026)
  • Google L4 SWE Phone Screen: 1 Experience
  • Google ML Engineering Manager Onsite: 1 Experience
  • Google Experienced SWE First Round and Onsite: 1 Experience
All Google interview questionsSee Google hiring insights
Saved
class Solution {
    public String[] runSpreadsheet(String[][] operations) {
        // Write your code here.
    }
}
Checking account…