Problem database last updated: June 20, 2025

GGrammarly logo

Grammarly Coding Interview Questions

26 problems · 7 Easy, 16 Medium, 3 Hard · Ranked #75 of 458

Difficulty breakdown

7 Easy

27% · avg 23%

16 Medium

62% · avg 59%

3 Hard

12% · avg 18%

Top topics

string
50%1.8x
array
46.2%
hash-table
34.6%1.5x
math
23.1%1.8x
dynamic-programming
23.1%
stack
19.2%2.2x

Interview profile

Based on 26 reported problems, Grammarly interviews are in line with industry averages - 12% Hard vs 18% overall. The majority (62%) 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, Grammarly puts unusual emphasis on memoization (11.5% of problems, 7.1x the industry average), trie (11.5% of problems, 4.4x the industry average), bit-manipulation (7.7% of problems, 2.3x the industry average). If you're short on time, these are the categories to double down on.

The most common topics are string (50%), array (46.2%), hash-table (34.6%), math (23.1%). Problems below are sorted by frequency, the ones at the top are asked most often.

All 26 problems

Merge Intervals

Solve

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...

MediumVery Likely
arraysorting

Remove All Adjacent Duplicates In String

Solve

You are given a string s consisting of lowercase English letters. A duplicate removal consists of choosing two adjacent and equal letters and removing them.

EasyVery Likely
stringstack

Remove All Adjacent Duplicates in String II

Solve

You are given a string s and an integer k, a k duplicate removal consists of choosing k adjacent and equal letters from s and removing them, causing the left an...

MediumVery Likely
stringstack

Insert Delete GetRandom O(1)

Solve

Implement the RandomizedSet class:

MediumVery Likely
arrayhash-tablemath

Generate Parentheses

Solve

Given n pairs of parentheses, write a function to generate all combinations of well-formed parentheses.

MediumVery Likely
stringdynamic-programmingbacktracking

Vowel Spellchecker

Solve

Given a wordlist, we want to implement a spellchecker that converts a query word into a correct word.

MediumVery Likely
arrayhash-tablestring

Repeated DNA Sequences

Solve

The DNA sequence is composed of a series of nucleotides abbreviated as 'A', 'C', 'G', and 'T'.

MediumVery Likely
hash-tablestringbit-manipulation

Search in Rotated Sorted Array

Solve

There is an integer array nums sorted in ascending order (with distinct values).

MediumVery Likely
arraybinary-search

Perfect Number

Solve

A perfect number is a positive integer that is equal to the sum of its positive divisors, excluding the number itself. A divisor of an integer x is an integer t...

EasyVery Likely
math

Climbing Stairs

Solve

You are climbing a staircase. It takes n steps to reach the top.

EasyLikely
mathdynamic-programmingmemoization

Sqrt(x)

Solve

Given a non-negative integer x, return the square root of x rounded down to the nearest integer. The returned integer should be non-negative as well.

EasyLikely
mathbinary-search

Number of Islands

Solve

Given an m x n 2D binary grid grid which represents a map of '1's (land) and '0's (water), return the number of islands.

MediumLikely
arraydepth-first-searchbreadth-first-search

Word Search

Solve

Given an m x n grid of characters board and a string word, return true if word exists in the grid.

MediumLikely
arraystringbacktracking

Word Break II

Solve

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...

HardLikely
arrayhash-tablestring

Backspace String Compare

Solve

Given two strings s and t, return true if they are equal when both are typed into empty text editors. '' means a backspace character.

EasyLikely
two-pointersstringstack

Implement Trie (Prefix Tree)

Solve

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...

MediumLikely
hash-tablestringdesign

Word Break

Solve

Given a string s and a dictionary of strings wordDict, return true if s can be segmented into a space-separated sequence of one or more dictionary words.

MediumLikely
arrayhash-tablestring

Special Binary String

Solve

Special binary strings are binary strings with the following two properties:

HardSometimes
stringdivide-and-conquersorting

Clone Graph

Solve

Given a reference of a node in a connected undirected graph.

MediumSometimes
hash-tabledepth-first-searchbreadth-first-search

Evaluate Reverse Polish Notation

Solve

You are given an array of strings tokens that represents an arithmetic expression in a Reverse Polish Notation.

MediumSometimes
arraymathstack

Trapping Rain Water

Solve

Given n non-negative integers representing an elevation map where the width of each bar is 1, compute how much water it can trap after raining.

HardSometimes
arraytwo-pointersdynamic-programming

Unique Paths

Solve

There is a robot on an m x n grid. The robot is initially located at the top-left corner (i.e., grid[0][0]). The robot tries to move to the bottom-right corner...

MediumSometimes
mathdynamic-programmingcombinatorics

Decode the Slanted Ciphertext

Solve

A string originalText is encoded using a slanted transposition cipher to a string encodedText with the help of a matrix having a fixed number of rows rows.

MediumSometimes
stringsimulation

Sum of Left Leaves

Solve

Given the root of a binary tree, return the sum of all left leaves.

EasySometimes
treedepth-first-searchbreadth-first-search

Set Mismatch

Solve

You have a set of integers s, which originally contains all the numbers from 1 to n. Unfortunately, due to some error, one of the numbers in s got duplicated to...

EasySometimes
arrayhash-tablebit-manipulation

Maximum Palindromes After Operations

Solve

You are given a 0-indexed string array words having length n and containing 0-indexed strings.

MediumSometimes
arrayhash-tablestring

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 Grammarly interviews.

Very Likely

75-100%

Likely

50-74%

Sometimes

25-49%

Rare

0-24%

Preparing for your Grammarly coding interview

Grammarly interviews focus heavily on string, array, hash-table 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. Grammarly 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.

Looking for more companies? Browse all 458 companies in our directory, or sharpen your fundamentals with our free data structure visualizers and AI-powered DSA tutor.

Frequently Asked Questions

What coding problems does Grammarly ask in interviews?add

Grammarly has been reported to ask 26 distinct coding problems. The most common topics are string, array, hash-table. 7 are Easy difficulty, 16 are Medium, and 3 are Hard. Problems are sorted by frequency - the ones at the top are asked most often.

How hard are Grammarly coding interviews?add

Based on 26 reported problems, Grammarly interviews are in line with industry averages - 12% Hard vs 18% overall. 62% 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 Grammarly coding interview?add

Start with the highest-frequency problems listed on this page. Focus on the core topics: string, array, hash-table. Practice solving them under time pressure and explaining your approach out loud. Mock interviews with AI can simulate the real experience.

Other companies to explore

Ready to ace your Grammarly interview?

Simulate a real Grammarly coding interview with an AI interviewer. Get a scorecard with specific feedback on your problem-solving, code quality, and communication.

Simulate a Grammarly interview with AIarrow_forward