Skip to main content

Workday Coding Interview Questions

100 Workday coding interview problems with full optimal solutions — 31 easy, 55 medium, 14 hard. Every problem ships with multiple approaches (brute-force first, then the optimal), complexity tables for each, company-specific tips on what an Workday interviewer values, and a FAQ section.

  • #1easyfrequently asked

    1. Two Sum

    Given an array of integers and a target, return the indices of the two numbers that add up to the target. Workday uses this to evaluate whether you reach for a hash map instead of brute-force enumeration when reconciling payroll line items.

  • #2easyfrequently asked

    2. Valid Parentheses

    Given a string containing only brackets, determine if the input is valid. Workday uses this to gauge stack intuition for nested approval chains — every 'submit' must match a 'review'.

  • #3easyfrequently asked

    3. Merge Two Sorted Lists

    Merge two sorted linked lists into one sorted list. Workday uses this to evaluate pointer hygiene — payroll merges sorted contribution streams (401k, HSA, FSA) into a single time-ordered ledger every cycle.

  • #4easyfrequently asked

    4. Remove Duplicates from Sorted Array

    Remove duplicates in-place from a sorted array. Workday tests this for two-pointer fluency — they dedup employee IDs in payroll batches that arrive from multiple HRIS feeds.

  • #5easysometimes asked

    5. Remove Element

    Remove all occurrences of a value in-place from an array. Workday tests this for terminated-employee scrubbing — strip out IDs marked for deactivation from an active-roster array.

  • #6easyfrequently asked

    6. Search Insert Position

    Given a sorted array and a target, return the index where the target is found or would be inserted. Workday uses this to test binary-search hygiene for slot-aware pay-grade insertion into compensation bands.

  • #7mediumfrequently asked

    7. Maximum Subarray

    Find the contiguous subarray with the largest sum. Workday uses this to test Kadane's pattern for finding the best fiscal-quarter window of an employee's incremental bonuses.

  • #8easysometimes asked

    8. Plus One

    Given a non-negative integer as a digit array, increment by one and return as a digit array. Workday uses this to test carry-propagation discipline — payroll batch IDs are big integers that increment past JS number precision.

  • #9easyfrequently asked

    9. Merge Sorted Array

    Merge two sorted arrays in-place into the first one (sized for both). Workday uses this for end-to-front pointer practice — merging current-period and adjustment ledger entries when only the result buffer exists.

  • #10easyfrequently asked

    10. Binary Tree Inorder Traversal

    Given the root of a binary tree, return the inorder traversal of its node values. Workday uses this to verify you can both recurse AND iterate trees — org charts may be too deep for recursion when traversing a 50,000-employee hierarchy.

  • #11easyfrequently asked

    11. Same Tree

    Given two binary trees, determine if they are structurally identical with equal values. Workday uses this to test parallel recursion — diffing two snapshots of an org chart to find structural drift.

  • #12easysometimes asked

    12. Symmetric Tree

    Given the root of a binary tree, check whether it is a mirror of itself. Workday uses this to extend the parallel-recursion pattern from Same Tree — useful for symmetrical permission policies in dual-approval workflows.

  • #13easyfrequently asked

    13. Maximum Depth of Binary Tree

    Given the root of a binary tree, return its maximum depth. Workday uses this as the tree-recursion warmup before harder org-chart depth questions like 'find the deepest reporting chain'.

  • #14easysometimes asked

    14. Balanced Binary Tree

    Determine if a binary tree is height-balanced. Workday uses this to catch sloppy 'recompute depth at every node' candidates — at org-chart scale, that's O(n^2).

  • #15easyfrequently asked

    15. Path Sum

    Given a binary tree and a target sum, determine if there's a root-to-leaf path summing to the target. Workday uses this to evaluate accumulator-passing in recursion — analogous to summing payroll items along an approval chain.

  • #16easysometimes asked

    16. Pascal's Triangle

    Generate the first numRows of Pascal's triangle. Workday uses this to test 2D-array construction and row-from-previous-row dependency — analogous to month-over-month payroll deltas.

  • #17easyfrequently asked

    17. Best Time to Buy and Sell Stock

    Given daily stock prices, find the maximum profit from a single buy-and-sell. Workday uses this to test running-minimum tracking — the same pattern used for finding the best fiscal-year window in compensation grading.

  • #18easysometimes asked

    18. Valid Palindrome

    Determine whether a string is a palindrome considering only alphanumeric characters and ignoring case. Workday uses this to evaluate two-pointer fluency on cleaned input — same pattern as normalizing employee-ID strings during reconciliation.

  • #19easysometimes asked

    19. Single Number

    Given a non-empty array where every element appears twice except for one, find that single one. Workday uses this to gauge whether you can leverage XOR for O(1)-space dedup — useful when audit logs pair every action with its reversal.

  • #20easyfrequently asked

    20. Linked List Cycle

    Determine if a linked list has a cycle. Workday uses this for Floyd's tortoise-and-hare fluency — same pattern that catches circular reporting in org-chart imports.

  • #21mediumfrequently asked

    21. Min Stack

    Design a stack that supports push, pop, top, and retrieving the minimum element in constant time. Workday uses this as a stand-in for 'efficient running aggregates' — the same pattern used for tracking the lowest pay-grade in a permission-stack snapshot.

  • #22mediumfrequently asked

    22. Two Sum II - Input Array Is Sorted

    Find two numbers in a 1-indexed sorted array that sum to a target. Workday uses this to test two-pointer pattern recognition on sorted ledger data — common shape for paid-vs-owed reconciliations.

  • #23easysometimes asked

    23. Majority Element

    Find the element that appears more than n/2 times. Workday uses this to evaluate whether you reach for Boyer-Moore voting — useful when reconciling 'which dept gets the most pay-grade adjustments'.

  • #24mediumsometimes asked

    24. Rotate Array

    Rotate an array to the right by k steps. Workday uses this to test in-place transformation discipline — same shape as shifting a payroll cycle's days when a holiday lands mid-period.

  • #25easyrarely asked

    25. Reverse Bits

    Reverse the bits of a 32-bit unsigned integer. Workday uses this to test bitwise fluency — needed when packing role/permission flags into compact bitmaps for RBAC.

  • #26easyrarely asked

    26. Number of 1 Bits

    Return the number of set bits in a 32-bit unsigned integer. Workday uses this to count active permissions in a role bitmap — bonus signal if you know the n & (n-1) trick.

  • #27mediumfrequently asked

    27. House Robber

    Maximize the sum of values you can take from a row of houses without taking two adjacent. Workday uses this as a DP warmup — same shape as scheduling non-overlapping shift-bonuses across consecutive pay periods.

  • #28easysometimes asked

    28. Happy Number

    Determine if a number is 'happy' — iterating the sum-of-digits-squared reaches 1. Workday uses this to test cycle-detection on numeric sequences — same Floyd's pattern as in linked lists.

  • #29easysometimes asked

    29. Isomorphic Strings

    Determine if two strings are isomorphic — characters in s can be replaced to get t with a consistent one-to-one mapping. Workday uses this for column-mapping integrity checks during HRIS imports.

  • #30easyfrequently asked

    30. Reverse Linked List

    Reverse a singly linked list. Workday uses this for pointer hygiene — the same prev/curr/next dance needed when reversing an audit-log timeline.

  • #31mediumfrequently asked

    31. Add Two Numbers

    Given two numbers as reversed linked lists, add them and return as a linked list. Workday uses this to test carry-propagation discipline — same as adding two arbitrary-precision payroll totals stored as digit lists.

  • #33mediumsometimes asked

    33. Longest Palindromic Substring

    Find the longest palindromic substring of a given string. Workday uses this as a DP vs expand-around-center decision point — both are valid; choosing the right one is the test.

  • #34mediumsometimes asked

    34. Container With Most Water

    Given an array of heights, find two lines that hold the most water. Workday uses this for two-pointer convergence reasoning — same shape as maximizing fiscal-coverage between two timeline anchors.

  • #35mediumfrequently asked

    35. 3Sum

    Find all unique triplets in an array that sum to zero. Workday uses this as a sort + two-pointer composition test — same shape as 'find three pay-grade adjustments that net to zero'.

  • #36mediumsometimes asked

    36. Letter Combinations of a Phone Number

    Given a string of digits 2-9, return all letter combinations the digits could represent. Workday uses this for backtracking fluency — the same shape as enumerating valid permission combinations across role tiers.

  • #37mediumsometimes asked

    37. Remove Nth Node From End of List

    Given the head of a linked list, remove the nth node from the end. Workday uses this for two-pointer-with-gap fluency — pointer hygiene mistakes show up immediately.

  • #38mediumsometimes asked

    38. Generate Parentheses

    Generate all valid parenthesis strings of n pairs. Workday uses this for backtracking + pruning — same shape as enumerating valid approval-chain templates.

  • #39mediumrarely asked

    39. Swap Nodes in Pairs

    Swap every two adjacent nodes in a linked list. Workday uses this for fine pointer surgery — the same wrangling needed to merge adjacent payroll segments without losing the chain.

  • #40mediumrarely asked

    40. Next Permutation

    Rearrange numbers into the next lexicographically greater permutation. Workday uses this to test array-manipulation discipline — same pattern as cycling shift-assignment rotations.

  • #41mediumfrequently asked

    41. Search in Rotated Sorted Array

    Search a target in a sorted-then-rotated array in O(log n). Workday uses this to test modified binary search — same shape as querying a payroll-cycle log that has been wrapped around midnight.

  • #43mediumsometimes asked

    43. Valid Sudoku

    Determine if a 9x9 Sudoku board is valid. Workday uses this for multi-dimensional constraint checks — same shape as validating that role assignments don't conflict across departments, locations, and time bands.

  • #44mediumsometimes asked

    44. Combination Sum

    Find all unique combinations of candidates (reusable) summing to target. Workday uses this for backtracking with reuse — same shape as enumerating ways to allocate a fixed payroll budget across recurring expense categories.

  • #45mediumsometimes asked

    45. Permutations

    Generate all permutations of an array of distinct integers. Workday uses this as the canonical backtracking baseline — same shape as enumerating role-rotation schedules.

  • #46mediumsometimes asked

    46. Rotate Image

    Rotate an n x n 2D matrix by 90 degrees clockwise in place. Workday uses this for matrix-manipulation discipline — same shape as transposing a payroll-period attendance grid.

  • #47mediumfrequently asked

    47. Group Anagrams

    Group strings into anagram clusters. Workday uses this for canonical-key bucketing — same shape as grouping department-code aliases that all refer to the same cost center.

  • #48mediumsometimes asked

    48. Spiral Matrix

    Return all elements of a matrix in spiral order. Workday uses this to test boundary-shrinking discipline — same shape as walking the perimeter of a fiscal calendar grid before drilling inward.

  • #49mediumfrequently asked

    49. Jump Game

    Given an array of max-jump lengths, determine if you can reach the last index. Workday uses this as a greedy-reasoning test — same shape as 'can a workflow proceed from any starting step given variable hop allowances'.

  • #50mediumfrequently asked

    50. Merge Intervals

    Given a collection of intervals, merge all overlapping intervals. Workday uses this canonically for time-and-attendance — same shape as merging overlapping clock-in/out windows to compute total worked hours.

  • #51mediumsometimes asked

    51. Unique Paths

    Count the number of unique paths from top-left to bottom-right of an m x n grid, moving only right or down. Workday uses this as a 2D DP intro — same shape as counting org-chart promotion paths through ranks.

  • #52mediumsometimes asked

    52. Minimum Path Sum

    Find the minimum-sum path from top-left to bottom-right of a grid moving only right or down. Workday uses this for DP-on-grids fluency — same shape as finding the lowest-cost approval chain through a multi-tier authorization graph.

  • #53mediumrarely asked

    53. Simplify Path

    Simplify a Unix-style absolute path. Workday uses this as a stack-on-strings pattern — same shape as resolving nested cost-center inheritance chains.

  • #54hardsometimes asked

    54. Edit Distance

    Compute the minimum number of operations (insert, delete, replace) to convert one string to another. Workday uses this for string-DP fluency — same shape as detecting close-match HRIS records during deduplication.

  • #55mediumsometimes asked

    55. Set Matrix Zeroes

    If an element is 0, set its entire row and column to 0 in place. Workday uses this for in-place matrix updates with marker tricks — same shape as cascading deactivation of a department in a 2D allocation grid.

  • #56mediumsometimes asked

    56. Sort Colors

    Sort an array of 0s, 1s, and 2s in one pass. Workday uses this for Dutch-national-flag fluency — same shape as bucketing employees into three pay-grade tiers in one pass.

  • #57hardsometimes asked

    57. Minimum Window Substring

    Given two strings s and t, find the minimum window in s that contains all characters of t. Workday uses this for sliding-window mastery — same shape as finding the shortest payroll-period window covering all of a multi-state employee's tax jurisdictions.

  • #58mediumsometimes asked

    58. Subsets

    Return all possible subsets of a set of distinct integers. Workday uses this for power-set generation — same shape as enumerating all possible permission-flag combinations in an RBAC role.

  • #59mediumfrequently asked

    59. Word Search

    Determine if a word exists in a grid of letters using adjacent cells. Workday uses this for DFS-with-backtracking + visited-marking — same shape as searching for a specific approval-chain path through a workflow graph.

  • #60mediumsometimes asked

    60. Decode Ways

    Count the number of ways a digit string can be decoded as letters A-Z (1=A, 26=Z). Workday uses this for DP with constraint-checking — same shape as counting valid time-zone codes from a raw integer stream.

  • #61mediumfrequently asked

    61. Validate Binary Search Tree

    Determine if a binary tree is a valid BST. Workday uses this to test recursion with bounds — same pattern as validating an org-chart's pay-grade ordering: every manager outranks all reports.

  • #62mediumfrequently asked

    62. Binary Tree Level Order Traversal

    Return the level-order (BFS) traversal of a binary tree's values, grouped by level. Workday uses this for tier-by-tier org-chart processing — same shape as emitting all VPs first, then all directors, then all managers.

  • #63mediumsometimes asked

    63. Binary Tree Zigzag Level Order Traversal

    Return the zigzag (alternating left-to-right then right-to-left) traversal of a binary tree. Workday uses this to test BFS + per-level transformation — same pattern as alternating row directions when emitting a multi-level approval-chain report.

  • #66mediumfrequently asked

    66. Word Break

    Determine if a string can be segmented into a sequence of dictionary words. Workday uses this for DP-on-strings — same shape as validating that a free-form job-title string can be decomposed into known role tokens.

  • #67mediumfrequently asked

    67. LRU Cache

    Design an LRU cache with O(1) get and put. Workday uses this for hash-map + doubly-linked-list composition — same shape as caching the most-recently-viewed employee records in an HR app.

  • #68mediumsometimes asked

    68. Sort List

    Sort a linked list in O(n log n) time and O(1) auxiliary space. Workday uses this for merge-sort-on-linked-lists fluency — same shape as merge-sorting an audit-log linked stream without buffering.

  • #69hardrarely asked

    69. Word Ladder

    Find the shortest transformation sequence from beginWord to endWord changing one letter at a time, where each intermediate is in wordList. Workday uses this for BFS-on-graph reasoning — same shape as finding the shortest role-transition chain through approved promotion paths.

  • #70mediumfrequently asked

    70. Number of Islands

    Count the number of islands in a 2D grid of '1' (land) and '0' (water). Workday uses this for grid-DFS counting — same shape as counting connected groups of co-located employees on a floor plan.

  • #71mediumfrequently asked

    71. Course Schedule

    Determine if you can finish all courses given prerequisite dependencies. Workday uses this for cycle-detection in workflow DAGs — same shape as validating that an approval-chain definition doesn't loop back on itself.

  • #72mediumsometimes asked

    72. Implement Trie (Prefix Tree)

    Implement a trie with insert, search, and startsWith. Workday uses this for prefix-search infrastructure — same data structure powering autocomplete on employee names and department codes.

  • #73mediumfrequently asked

    73. Kth Largest Element in an Array

    Find the kth largest element without sorting the entire array. Workday uses this to test heap fluency — same shape as finding the top-k highest-paid employees per department for compensation reports.

  • #74easyfrequently asked

    74. Contains Duplicate

    Determine whether an array contains any duplicates. Workday uses this for hash-set fluency — same shape as checking whether an employee ID appears twice in a payroll batch.

  • #75easysometimes asked

    75. Invert Binary Tree

    Invert a binary tree (swap left and right at every node). Workday uses this as a 5-line warmup before harder tree problems — but they grade on whether you write the recursion cleanly.

  • #76mediumsometimes asked

    76. Kth Smallest Element in a BST

    Find the kth smallest value in a BST. Workday uses this to test in-order traversal awareness — same shape as 'the kth-earliest hire date in a salary-sorted directory'.

  • #79mediumfrequently asked

    79. Product of Array Except Self

    Return an array where output[i] is the product of all elements except nums[i], without division and in O(n). Workday uses this for prefix/suffix product fluency — same shape as computing aggregate-without-self metrics across departments.

  • #80hardsometimes asked

    80. Sliding Window Maximum

    Return the maximum in each sliding window of size k. Workday uses this for monotonic-deque fluency — same shape as computing peak headcount over a rolling pay-period window.

  • #81easyfrequently asked

    81. Move Zeroes

    Move all zeros to the end of an array while preserving the order of non-zero elements. Workday uses this for two-pointer in-place fluency — same shape as deferring 'inactive' employee records to the end of an active-roster array.

  • #82mediumsometimes asked

    82. Find the Duplicate Number

    Find the duplicate number in an array of n+1 integers where each is in [1, n]. Workday uses this for Floyd's cycle detection in non-linked-list contexts — same shape as finding the duplicate employee record in a permission graph.

  • #83mediumsometimes asked

    83. Longest Increasing Subsequence

    Find the length of the longest strictly-increasing subsequence. Workday uses this for DP-vs-patience-sort decisions — same shape as finding the longest streak of strictly-rising compensation reviews.

  • #84mediumfrequently asked

    84. Coin Change

    Find the minimum number of coins to make a target amount. Workday uses this for unbounded-knapsack DP — same shape as allocating the minimum number of pay-frequency cycles to reach a target year-to-date amount.

  • #85mediumfrequently asked

    85. Top K Frequent Elements

    Return the k most frequent elements in an array. Workday uses this for bucket-sort vs heap decisions — same shape as 'top-k most-used permission codes across an org'.

  • #86easysometimes asked

    86. Intersection of Two Arrays II

    Return the intersection of two integer arrays preserving duplicate counts. Workday uses this for hash-map counting — same shape as 'employees who appear in both the active roster and the payroll batch'.

  • #88hardsometimes asked

    88. Serialize and Deserialize Binary Tree

    Design serialize/deserialize for a binary tree. Workday uses this for protocol-design + recursion mastery — same shape as transmitting an org-chart snapshot across services without losing structure.

  • #89mediumsometimes asked

    89. Copy List with Random Pointer

    Deep-copy a linked list where each node has a random pointer to any other node. Workday uses this for two-pass-or-hash-map design — same shape as cloning an employee record graph with cross-references intact.

  • #90hardsometimes asked

    90. Integer to English Words

    Convert a non-negative integer to its English-words representation. Workday uses this for grouping/edge-case discipline — same shape as generating human-readable payslip amounts ($1,234,567 -> 'One Million Two Hundred Thirty Four Thousand...').

  • #91mediumrarely asked

    91. Design Tic-Tac-Toe

    Design an efficient Tic-Tac-Toe game. Workday uses this for incremental-state-tracking — same shape as maintaining running sums for the 'all approvals received?' check across multi-axis approval matrices.

  • #92easyfrequently asked

    92. Binary Search

    Implement binary search on a sorted array. Workday uses this as a fluency check — they'll follow up with rotated-search and first-bad-version variants in the same interview.

  • #93hardrarely asked

    93. Median of Two Sorted Arrays

    Find the median of two sorted arrays in O(log min(m, n)). Workday uses this for binary-search-on-partition mastery — the hardest of their binary-search variants.

  • #94hardsometimes asked

    94. Trapping Rain Water

    Compute how much water can be trapped after raining on a histogram. Workday uses this for two-pointer mastery — same shape as 'how much pay-period overflow is held by the maximum-flexible-spending walls'.

  • #95hardrarely asked

    95. Regular Expression Matching

    Implement regex matching with '.' and '*'. Workday uses this for 2D DP with branching choice — same shape as evaluating wildcard-based permission patterns against role strings.

  • #96hardfrequently asked

    96. Merge k Sorted Lists

    Merge k sorted linked lists into one sorted list. Workday uses this for heap composition — same shape as merging time-sorted payroll streams from k departments into one chronological ledger.

  • #97hardrarely asked

    97. Largest Rectangle in Histogram

    Find the largest rectangular area in a histogram. Workday uses this for monotonic-stack mastery — same shape as computing the largest contiguous block of FTEs across departments where each meets a minimum FTE-count threshold.

  • #98hardrarely asked

    98. Maximal Rectangle

    Find the largest rectangle of 1s in a binary matrix. Workday uses this as the 2D extension of Largest Rectangle in Histogram — same shape as finding the largest cohort of co-employed-in-region records across employees and timeline.

  • #99hardrarely asked

    99. First Missing Positive

    Find the smallest missing positive integer in O(n) and O(1) space. Workday uses this for array-as-hash-map fluency — same shape as finding the next unassigned employee ID in a partially-allocated range.

  • #100hardsometimes asked

    100. Wildcard Matching

    Match a string against a pattern with '?' (single char) and '*' (any sequence). Workday uses this directly for RBAC pattern matching — same shape as evaluating policies like 'admin:*:write' against role strings.

Workday Coding Interview Questions — Full Solutions — InterviewChamp.AI