Problem database last updated: June 20, 2025

GGraviton logo

Graviton Coding Interview Questions

7 problems · 0 Easy, 5 Medium, 2 Hard · Ranked #189 of 458

Difficulty breakdown

0 Easy

0% · avg 23%

5 Medium

71% · avg 59%

2 Hard

29% · avg 18%

Top topics

depth-first-search
42.9%4.7x
breadth-first-search
42.9%5.2x
graph
42.9%14.5x
array
42.9%
dynamic-programming
42.9%2.2x
topological-sort
28.6%24.3x

Interview profile

Based on 7 reported problems, Graviton interviews are significantly harder than average - 29% Hard vs 18% across all companies. The majority (71%) 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, Graviton puts unusual emphasis on topological-sort (28.6% of problems, 24.3x the industry average), graph (42.9% of problems, 14.5x the industry average), breadth-first-search (42.9% of problems, 5.2x the industry average). If you're short on time, these are the categories to double down on.

The most common topics are depth-first-search (42.9%), breadth-first-search (42.9%), graph (42.9%), array (42.9%). Problems below are sorted by frequency, the ones at the top are asked most often.

All 7 problems

Course Schedule

Solve

There are a total of numCourses courses you have to take, labeled from 0 to numCourses - 1. You are given an array prerequisites where prerequisites[i] = [ai, b...

MediumVery Likely
depth-first-searchbreadth-first-searchgraph

01 Matrix

Solve

Given an m x n binary matrix mat, return the distance of the nearest 0 for each cell.

MediumVery Likely
arraydynamic-programmingbreadth-first-search

Decode Ways

Solve

You have intercepted a secret message encoded as a string of numbers. The message is decoded via the following mapping:

MediumVery Likely
stringdynamic-programming

Largest Number

Solve

Given a list of non-negative integers nums, arrange them such that they form the largest number and return it.

MediumVery Likely
arraystringgreedy

Keys and Rooms

Solve

There are n rooms labeled from 0 to n - 1 and all the rooms are locked except for room 0. Your goal is to visit all the rooms. However, you cannot enter a locke...

MediumVery Likely
depth-first-searchbreadth-first-searchgraph

Collect Coins in a Tree

Solve

There exists an undirected and unrooted tree with n nodes indexed from 0 to n - 1. You are given an integer n and a 2D integer array edges of length n - 1, wher...

HardVery Likely
arraytreegraph

Binary Tree Cameras

Solve

You are given the root of a binary tree. We install cameras on the tree nodes where each camera at a node can monitor its parent, itself, and its immediate chil...

HardVery Likely
dynamic-programmingtreedepth-first-search

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

Very Likely

75-100%

Likely

50-74%

Sometimes

25-49%

Rare

0-24%

Preparing for your Graviton coding interview

Graviton interviews focus heavily on depth-first-search, breadth-first-search, graph 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. Graviton 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 Graviton ask in interviews?add

Graviton has been reported to ask 7 distinct coding problems. The most common topics are depth-first-search, breadth-first-search, graph. 0 are Easy difficulty, 5 are Medium, and 2 are Hard. Problems are sorted by frequency - the ones at the top are asked most often.

How hard are Graviton coding interviews?add

Based on 7 reported problems, Graviton interviews are significantly harder than average - 29% Hard vs 18% across all companies. 71% 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 Graviton coding interview?add

Start with the highest-frequency problems listed on this page. Focus on the core topics: depth-first-search, breadth-first-search, graph. 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 Graviton interview?

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

Simulate a Graviton interview with AIarrow_forward