80 problems · 10 Easy, 59 Medium, 11 Hard · Ranked #30 of 458
Difficulty breakdown
10 Easy
13% · avg 23%
59 Medium
74% · avg 59%
11 Hard
14% · avg 18%
Top topics
array
60%
string
28.7%
dynamic-programming
23.8%
hash-table
20%
two-pointers
15%
stack
11.3%
Interview profile
Based on 80 reported problems, ServiceNow interviews are in line with industry averages - 14% Hard vs 18% overall. The majority (74%) of questions are Medium difficulty, which is typical for companies that want to see solid fundamentals without excessive trick questions.
Compared to the industry average, ServiceNow puts unusual emphasis on memoization (3.8% of problems, 2.3x the industry average), trie (5% of problems, 1.9x the industry average), queue (2.5% of problems, 1.7x the industry average). If you're short on time, these are the categories to double down on.
The most common topics are array (60%), string (28.7%), dynamic-programming (23.8%), hash-table (20%). Problems below are sorted by frequency, the ones at the top are asked most often.
All 80 problems
Problem
Difficulty
Frequency
Topics
Subarray Product Less Than K
Given an array of integers nums and an integer k, return the number of contiguous subarrays where the product of all the elements in the subarray is strictly le...
There exist two undirected trees with n and m nodes, numbered from 0 to n - 1 and from 0 to m - 1, respectively. You are given two 2D integer arrays edges1 and...
You are given an integer n. You roll a fair 6-sided dice n times. Determine the total number of distinct sequences of rolls possible such that the following con...
The string "PAYPALISHIRING" is written in a zigzag pattern on a given number of rows like this: (you may want to display this pattern in a fixed font for better...
Given an array of intervals where intervals[i] = [starti, endi], merge all overlapping intervals, and return an array of the non-overlapping intervals that cove...
Given an array of integers temperatures represents the daily temperatures, return an array answer such that answer[i] is the number of days you have to wait aft...
You are given an integer array height of length n. There are n vertical lines drawn such that the two endpoints of the ith line are (i, 0) and (i, height[i]).
There is an m x n rectangular island that borders both the Pacific Ocean and Atlantic Ocean. The Pacific Ocean touches the island's left and top edges, and the...
Given the root of a binary tree, imagine yourself standing on the right side of it, return the values of the nodes you can see ordered from top to bottom.
We are given an array asteroids of integers representing asteroids in a row. The indices of the asteroid in the array represent their relative position in space...
Given a string queryIP, return "IPv4" if IP is a valid IPv4 address, "IPv6" if IP is a valid IPv6 address or "Neither" if IP is not a correct IP of any type.
There are n people standing in a queue, and they numbered from 0 to n - 1 in left to right order. You are given an array heights of distinct integers where heig...
A phrase is a palindrome if, after converting all uppercase letters into lowercase letters and removing all non-alphanumeric characters, it reads the same forwa...
A trie (pronounced as "try") or prefix tree is a tree data structure used to efficiently store and retrieve keys in a dataset of strings. There are various appl...
You are a professional robber planning to rob houses along a street. Each house has a certain amount of money stashed, the only constraint stopping you from rob...
You are given an array of integers nums, there is a sliding window of size k which is moving from the very left of the array to the very right. You can only see...
Given an integer array nums, return all the triplets [nums[i], nums[j], nums[k]] such that i != j, i != k, and j != k, and nums[i] + nums[j] + nums[k] == 0.
You are given a perfect binary tree where all leaves are on the same level, and every parent has two children. The binary tree has the following definition:
You are given two integer arrays nums1 and nums2, sorted in non-decreasing order, and two integers m and n, representing the number of elements in nums1 and num...
Given a string s and a dictionary of strings wordDict, add spaces in s to construct a sentence where each word is a valid dictionary word. Return all such possi...
Given an integer array nums, return true if you can partition the array into two subsets such that the sum of the elements in both subsets is equal or false oth...
Given the root of a binary tree, return the zigzag level order traversal of its nodes' values. (i.e., from left to right, then right to left for the next level...
Given a string containing digits from 2-9 inclusive, return all possible letter combinations that the number could represent. Return the answer in any order.
Given an array of distinct integers candidates and a target integer target, return a list of all unique combinations of candidates where the chosen numbers sum...
You are given an integer array nums. You are initially positioned at the array's first index, and each element in the array represents your maximum jump length...
You are given a binary string s. In one second, all occurrences of "01" are simultaneously replaced with "10". This process repeats until no occurrences of "01"...
Given an array of integers nums and an integer k, return the number of contiguous subarrays where the product of all the elements in the subarray is strictly le...
There exist two undirected trees with n and m nodes, numbered from 0 to n - 1 and from 0 to m - 1, respectively. You are given two 2D integer arrays edges1 and...
HardVery Likely
treedepth-first-searchbreadth-first-search
Lexicographically Smallest String After Operations With Constraint
You are given an integer n. You roll a fair 6-sided dice n times. Determine the total number of distinct sequences of rolls possible such that the following con...
The string "PAYPALISHIRING" is written in a zigzag pattern on a given number of rows like this: (you may want to display this pattern in a fixed font for better...
Given an array of intervals where intervals[i] = [starti, endi], merge all overlapping intervals, and return an array of the non-overlapping intervals that cove...
Given an array of integers temperatures represents the daily temperatures, return an array answer such that answer[i] is the number of days you have to wait aft...
You are given an integer array height of length n. There are n vertical lines drawn such that the two endpoints of the ith line are (i, 0) and (i, height[i]).
There is an m x n rectangular island that borders both the Pacific Ocean and Atlantic Ocean. The Pacific Ocean touches the island's left and top edges, and the...
Given the root of a binary tree, imagine yourself standing on the right side of it, return the values of the nodes you can see ordered from top to bottom.
We are given an array asteroids of integers representing asteroids in a row. The indices of the asteroid in the array represent their relative position in space...
Given a string queryIP, return "IPv4" if IP is a valid IPv4 address, "IPv6" if IP is a valid IPv6 address or "Neither" if IP is not a correct IP of any type.
There are n people standing in a queue, and they numbered from 0 to n - 1 in left to right order. You are given an array heights of distinct integers where heig...
A phrase is a palindrome if, after converting all uppercase letters into lowercase letters and removing all non-alphanumeric characters, it reads the same forwa...
A trie (pronounced as "try") or prefix tree is a tree data structure used to efficiently store and retrieve keys in a dataset of strings. There are various appl...
You are a professional robber planning to rob houses along a street. Each house has a certain amount of money stashed, the only constraint stopping you from rob...
You are given an array of integers nums, there is a sliding window of size k which is moving from the very left of the array to the very right. You can only see...
Given an integer array nums, return all the triplets [nums[i], nums[j], nums[k]] such that i != j, i != k, and j != k, and nums[i] + nums[j] + nums[k] == 0.
You are given a perfect binary tree where all leaves are on the same level, and every parent has two children. The binary tree has the following definition:
You are given two integer arrays nums1 and nums2, sorted in non-decreasing order, and two integers m and n, representing the number of elements in nums1 and num...
Given a string s and a dictionary of strings wordDict, add spaces in s to construct a sentence where each word is a valid dictionary word. Return all such possi...
Given an integer array nums, return true if you can partition the array into two subsets such that the sum of the elements in both subsets is equal or false oth...
Given the root of a binary tree, return the zigzag level order traversal of its nodes' values. (i.e., from left to right, then right to left for the next level...
Given a string containing digits from 2-9 inclusive, return all possible letter combinations that the number could represent. Return the answer in any order.
Given an array of distinct integers candidates and a target integer target, return a list of all unique combinations of candidates where the chosen numbers sum...
You are given an integer array nums. You are initially positioned at the array's first index, and each element in the array represents your maximum jump length...
You are given a binary string s. In one second, all occurrences of "01" are simultaneously replaced with "10". This process repeats until no occurrences of "01"...
MediumLikely
stringdynamic-programmingsimulation
How often are these problems asked?
Frequency scores are based on crowdsourced interview reports. A higher score means the problem has been reported more often in recent ServiceNow interviews.
Very Likely
75-100%
Likely
50-74%
Sometimes
25-49%
Rare
0-24%
Preparing for your ServiceNow coding interview
ServiceNow interviews focus heavily on array, string, dynamic-programming problems. If you're short on time, these are the categories to prioritize. The problems on this page are sorted by frequency, so start from the top and work your way down.
Beyond solving problems, practice explaining your approach. ServiceNow interviewers care about your thought process - how you break down a problem, consider edge cases, and evaluate tradeoffs between solutions. A clean O(n) solution you can explain clearly beats an O(log n) solution you can't articulate.
What coding problems does ServiceNow ask in interviews?add
ServiceNow has been reported to ask 80 distinct coding problems. The most common topics are array, string, dynamic-programming. 10 are Easy difficulty, 59 are Medium, and 11 are Hard. Problems are sorted by frequency - the ones at the top are asked most often.
How hard are ServiceNow coding interviews?add
Based on 80 reported problems, ServiceNow interviews are in line with industry averages - 14% Hard vs 18% overall. 74% of questions are Medium difficulty. Focus on the high-frequency Medium problems first, then work through the Hard ones.
How should I prepare for a ServiceNow coding interview?add
Start with the highest-frequency problems listed on this page. Focus on the core topics: array, string, dynamic-programming. Practice solving them under time pressure and explaining your approach out loud. Mock interviews with AI can simulate the real experience.
Simulate a real ServiceNow coding interview with an AI interviewer. Get a scorecard with specific feedback on your problem-solving, code quality, and communication.