FastPrepPaint a Grid with Three Colors
Problems/Paint a Grid with Three Colors

Paint a Grid with Three Colors

Intuit logoIntuit● MediumFULLTIMEOA

Updated Nov 2026

QuestionFunctionExamplesConstraints

Problem statement

Source note: Reported in an Intuit full-time online assessment. A firsthand comment links the well-known problem of coloring a grid so adjacent cells differ. This version keeps that rule and the stated sizes. Our version is about 100% the same as the reported question.

Color an m by n grid with three labeled colors so that every pair of cells sharing an edge has different colors. Diagonal equality is allowed. Return the count modulo 1000000007.

Function

paintGrid(m: int, n: int) → int

Examples

Example 1

m = 1n = 1return = 3

The one cell may use any color.

Example 2

m = 2n = 2return = 18

Every horizontal and vertical edge must connect different colors.

Constraints

  • The author-linked task gives 1 <= m <= 5 and 1 <= n <= 1000.

More Intuit Online Assessment questions

  • Employee Promotion OpportunitiesOA · Seen Oct 2026
  • Next Pascal Row CoefficientOA · Seen Oct 2026
  • Parse Router LogsOA · Seen Oct 2026
  • Longest Repeated Letter Block with Adjacent SwapsOA · Seen Oct 2026
  • Maximum Square-Free DivisorOA · Seen Oct 2026
  • Two Tribes from Taller-Person CountsOA · Seen Oct 2026
  • Shortest Path from an Encoded GraphOA · Seen Sep 2026
  • Oldest and Youngest EmployeesOA · Seen Sep 2026
  • Pressure-Isolation Shutdown OrderOA · Seen Sep 2026
  • Submask Sum QueriesOA · Seen Sep 2026

Similar questions at other companies

  • Count Routes Through Four Shop TypesOpenAI · OAOpenAI interview questions
  • Vehicle Builds for Required Terrain (Game Adaptation)Roblox · OARoblox interview questions
  • Minimum Moves to Spread Stones Across a GridAmerican Express · OAAmerican Express interview questions
  • Maximum Profit Under a Bitwise OR LimitConcentric AI · OAConcentric AI interview questions
  • Bitwise XOR SubsequencesJP Morgan Chase · OAJP Morgan Chase interview questions
  • Beautiful Number OrderingsDocuSign · OADocuSign interview questions
  • Minimum Operations To Reduce To ZeroUber · OAUber interview questions
  • Bitwise XOR SubsequencesGoldman Sachs · OAGoldman Sachs interview questions
  • Delete K Subsets for Maximum ScoreRubrik · OARubrik interview questions
  • Optimize Discount Selection Under a Point BudgetPalantir · OAPalantir interview questions

Interview reports that mention this question

  • Intuit OA: What It Tests (2026)

Intuit interview experiences

  • Intuit Software Engineering Intern - Full Stack OA Format
All Intuit interview questionsSee Intuit hiring insights
Saved
class Solution {
    public int paintGrid(int m, int n) {
        // Write your code here
    }
}
Checking account…