Problem database last updated: June 20, 2025

AAccenture logo

Accenture Coding Interview Questions

100 problems · 51 Easy, 45 Medium, 4 Hard · Ranked #1 of 458

Difficulty breakdown

51 Easy

51% · avg 23%

45 Medium

45% · avg 59%

4 Hard

4% · avg 18%

Top topics

array
57%
math
28%2.2x
string
24%
dynamic-programming
20%
hash-table
19%
two-pointers
18%

Interview profile

Based on 100 reported problems, Accenture interviews are easier than average - only 4% Hard compared to 18% across all companies.

Compared to the industry average, Accenture puts unusual emphasis on string-matching (2% of problems, 2.3x the industry average), math (28% of problems, 2.2x the industry average), memoization (3% of problems, 1.9x the industry average). If you're short on time, these are the categories to double down on.

The most common topics are array (57%), math (28%), string (24%), dynamic-programming (20%). Problems below are sorted by frequency, the ones at the top are asked most often.

All 100 problems

Bulb Switcher

Solve

There are n bulbs that are initially off. You first turn on all the bulbs, then you turn off every second bulb.

MediumVery Likely
mathbrainteaser

Happy Number

Solve

Write an algorithm to determine if a number n is happy.

EasyVery Likely
hash-tablemathtwo-pointers

Two Sum

Solve

Given an array of integers nums and an integer target, return the indices of the two numbers that add up to target.

EasyVery Likely
arrayhash-map

Best Time to Buy and Sell Stock

Solve

You are given an array prices where prices[i] is the price of a given stock on the ith day.

EasyVery Likely
arraydynamic-programming

Climbing Stairs

Solve

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

EasyVery Likely
mathdynamic-programmingmemoization

Palindrome Number

Solve

Given an integer x, return true if x is a palindrome, and false otherwise.

EasyVery Likely
math

Rotate Array

Solve

Given an integer array nums, rotate the array to the right by k steps, where k is non-negative.

MediumVery Likely
arraymathtwo-pointers

Maximum Subarray

Solve

Given an integer array nums, find the subarray with the largest sum, and return its sum.

MediumVery Likely
arraydivide-and-conquerdynamic-programming

Roman to Integer

Solve

Roman numerals are represented by seven different symbols: I, V, X, L, C, D and M.

EasyVery Likely
hash-tablemathstring

Delete and Earn

Solve

You are given an integer array nums. You want to maximize the number of points you get by performing the following operation any number of times:

MediumVery Likely
arrayhash-tabledynamic-programming

Minimum Right Shifts to Sort the Array

Solve

You are given a 0-indexed array nums of length n containing distinct positive integers. Return the minimum number of right shifts required to sort nums and -1 i...

EasyVery Likely
array

Find Subsequence of Length K With the Largest Sum

Solve

You are given an integer array nums and an integer k. You want to find a subsequence of nums of length k that has the largest sum.

EasyVery Likely
arrayhash-tablesorting

Maximum Area of Longest Diagonal Rectangle

Solve

You are given a 2D 0-indexed integer array dimensions.

EasyVery Likely
array

Ant on the Boundary

Solve

An ant is on a boundary. It sometimes goes left and sometimes right.

EasyVery Likely
arraysimulationprefix-sum

Count Tested Devices After Test Operations

Solve

You are given a 0-indexed integer array batteryPercentages having length n, denoting the battery percentages of n 0-indexed devices.

EasyVery Likely
arraysimulationcounting

Permutation Difference between Two Strings

Solve

You are given two strings s and t such that every character occurs at most once in s and t is a permutation of s.

EasyVery Likely
hash-tablestring

Sum of Values at Indices With K Set Bits

Solve

You are given a 0-indexed integer array nums and an integer k.

EasyVery Likely
arraybit-manipulation

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

Merge Sorted Array

Solve

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

EasyVery Likely
arraytwo-pointerssorting

Longest Common Prefix

Solve

Write a function to find the longest common prefix string amongst an array of strings.

EasyVery Likely
arraystringtrie

Reverse Integer

Solve

Given a signed 32-bit integer x, return x with its digits reversed. If reversing x causes the value to go outside the signed 32-bit integer range [-231, 231 - 1...

MediumVery Likely
math

Longest Palindromic Substring

Solve

Given a string s, return the longest palindromic substring in s.

MediumVery Likely
two-pointersstringdynamic-programming

Spiral Matrix

Solve

Given an m x n matrix, return all elements of the matrix in spiral order.

MediumLikely
arraymatrixsimulation

Shortest Palindrome

Solve

You are given a string s. You can convert s to a palindrome by adding characters in front of it.

HardLikely
stringrolling-hashstring-matching

Majority Element

Solve

Given an array nums of size n, return the majority element.

EasyLikely
arrayhash-tabledivide-and-conquer

Sort Integers by The Number of 1 Bits

Solve

You are given an integer array arr. Sort the integers in the array in ascending order by the number of 1's in their binary representation and in case of two or...

EasyLikely
arraybit-manipulationsorting

3Sum

Solve

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.

MediumLikely
arraytwo-pointerssorting

Perfect Squares

Solve

Given an integer n, return the least number of perfect square numbers that sum to n.

MediumLikely
mathdynamic-programmingbreadth-first-search

Longest Substring Without Repeating Characters

Solve

Given a string s, find the length of the longest substring without duplicate characters.

MediumLikely
hash-tablestringsliding-window

Find Peak Element

Solve

A peak element is an element that is strictly greater than its neighbors.

MediumLikely
arraybinary-search

Reverse Words in a String

Solve

Given an input string s, reverse the order of the words.

MediumLikely
two-pointersstring

Valid Anagram

Solve

Given two strings s and t, return true if t is an anagram of s, and false otherwise.

EasyLikely
hash-tablestringsorting

Integer Break

Solve

Given an integer n, break it into the sum of k positive integers, where k >= 2, and maximize the product of those integers.

MediumLikely
mathdynamic-programming

Valid Parentheses

Solve

Given a string s containing just the characters '(', ')', '{', '}', '[' and ']', determine if the input string is valid.

EasyLikely
stringstack

Plus One

Solve

You are given a large integer represented as an integer array digits, where each digits[i] is the ith digit of the integer. The digits are ordered from most sig...

EasyLikely
arraymath

Remove Duplicates from Sorted Array

Solve

Given an integer array nums sorted in non-decreasing order, remove the duplicates in-place such that each unique element appears only once. The relative order o...

EasyLikely
arraytwo-pointers

Fibonacci Number

Solve

The Fibonacci numbers, commonly denoted F(n) form a sequence, called the Fibonacci sequence, such that each number is the sum of the two preceding ones, startin...

EasyLikely
mathdynamic-programmingrecursion

Container With Most Water

Solve

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

MediumLikely
arraytwo-pointersgreedy

Add Two Numbers

Solve

You are given two non-empty linked lists representing two non-negative integers. The digits are stored in reverse order, and each of their nodes contains a sing...

MediumLikely
linked-listmathrecursion

Product of Array Except Self

Solve

Given an integer array nums, return an array answer such that answer[i] is equal to the product of all the elements of nums except nums[i].

MediumLikely
arrayprefix-sum

Candy

Solve

There are n children standing in a line. Each child is assigned a rating value given in the integer array ratings.

HardLikely
arraygreedy

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

MediumLikely
arraysorting

Reverse Vowels of a String

Solve

Given a string s, reverse only all the vowels in the string and return it.

EasyLikely
two-pointersstring

Find First and Last Position of Element in Sorted Array

Solve

Given an array of integers nums sorted in non-decreasing order, find the starting and ending position of a given target value.

MediumLikely
arraybinary-search

Nth Digit

Solve

Given an integer n, return the nth digit of the infinite integer sequence [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, ...].

MediumLikely
mathbinary-search

Assign Cookies

Solve

Assume you are an awesome parent and want to give your children some cookies. But, you should give each child at most one cookie.

EasyLikely
arraytwo-pointersgreedy

House Robber

Solve

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

MediumLikely
arraydynamic-programming

Longest Increasing Subsequence

Solve

Given an integer array nums, return the length of the longest strictly increasing subsequence.

MediumLikely
arraybinary-searchdynamic-programming

Coin Change

Solve

You are given an integer array coins representing coins of different denominations and an integer amount representing a total amount of money.

MediumLikely
arraydynamic-programmingbreadth-first-search

Koko Eating Bananas

Solve

Koko loves to eat bananas. There are n piles of bananas, the ith pile has piles[i] bananas. The guards have gone and will come back in h hours.

MediumLikely
arraybinary-search

Count Primes

Solve

Given an integer n, return the number of prime numbers that are strictly less than n.

MediumLikely
arraymathenumeration

Pascal's Triangle

Solve

Given an integer numRows, return the first numRows of Pascal's triangle.

EasyLikely
arraydynamic-programming

Contains Duplicate

Solve

Given an integer array nums, return true if any value appears at least twice in the array, and return false if every element is distinct.

EasySometimes
arrayhash-tablesorting

Remove Element

Solve

Given an integer array nums and an integer val, remove all occurrences of val in nums in-place. The order of the elements may be changed. Then return the number...

EasySometimes
arraytwo-pointers

Find the Index of the First Occurrence in a String

Solve

Given two strings needle and haystack, return the index of the first occurrence of needle in haystack, or -1 if needle is not part of haystack.

EasySometimes
two-pointersstringstring-matching

Peak Index in a Mountain Array

Solve

You are given an integer mountain array arr of length n where the values increase to a peak element and then decrease.

MediumSometimes
arraybinary-search

Max Consecutive Ones

Solve

Given a binary array nums, return the maximum number of consecutive 1's in the array.

EasySometimes
array

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

Majority Element II

Solve

Given an integer array of size n, find all elements that appear more than ⌊ n/3 ⌋ times.

MediumSometimes
arrayhash-tablesorting

Remove Duplicates from Sorted List

Solve

Given the head of a sorted linked list, delete all duplicates such that each element appears only once. Return the linked list sorted as well.

EasySometimes
linked-list

Is Subsequence

Solve

Given two strings s and t, return true if s is a subsequence of t, or false otherwise.

EasySometimes
two-pointersstringdynamic-programming

Reverse Linked List

Solve

Given the head of a singly linked list, reverse the list, and return the reversed list.

EasySometimes
linked-listrecursion

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

EasySometimes
math

Sort Array by Increasing Frequency

Solve

Given an array of integers nums, sort the array in increasing order based on the frequency of the values. If multiple values have the same frequency, sort them...

EasySometimes
arrayhash-tablesorting

Find the Winner of the Circular Game

Solve

There are n friends that are playing a game. The friends are sitting in a circle and are numbered from 1 to n in clockwise order. More formally, moving clockwis...

MediumSometimes
arraymathrecursion

Next Greater Element I

Solve

The next greater element of some element x in an array is the first greater element that is to the right of x in the same array.

EasySometimes
arrayhash-tablestack

Valid Palindrome

Solve

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

EasySometimes
two-pointersstring

Edit Distance

Solve

Given two strings word1 and word2, return the minimum number of operations required to convert word1 to word2.

MediumSometimes
stringdynamic-programming

Rotate Image

Solve

You are given an n x n 2D matrix representing an image, rotate the image by 90 degrees (clockwise).

MediumSometimes
arraymathmatrix

Next Permutation

Solve

A permutation of an array of integers is an arrangement of its members into a sequence or linear order.

MediumSometimes
arraytwo-pointers

Basic Calculator II

Solve

Given a string s which represents an expression, evaluate this expression and return its value.

MediumSometimes
mathstringstack

Pow(x, n)

Solve

Implement pow(x, n), which calculates x raised to the power n (i.e., xn).

MediumSometimes
mathrecursion

Ugly Number II

Solve

An ugly number is a positive integer whose prime factors are limited to 2, 3, and 5.

MediumSometimes
hash-tablemathdynamic-programming

Intersection of Two Linked Lists

Solve

Given the heads of two singly linked-lists headA and headB, return the node at which the two lists intersect. If the two linked lists have no intersection at al...

EasySometimes
hash-tablelinked-listtwo-pointers

Group Anagrams

Solve

Given an array of strings strs, group the anagrams together. You can return the answer in any order.

MediumSometimes
arrayhash-tablestring

Department Top Three Salaries

Solve

Table: Employee

HardSometimes
database

Kth Largest Element in an Array

Solve

Given an integer array nums and an integer k, return the kth largest element in the array.

MediumSometimes
arraydivide-and-conquersorting

How Many Numbers Are Smaller Than the Current Number

Solve

Given the array nums, for each nums[i] find out how many numbers in the array are smaller than it. That is, for each nums[i] you have to count the number of val...

EasySometimes
arrayhash-tablesorting

Palindromic Substrings

Solve

Given a string s, return the number of palindromic substrings in it.

MediumSometimes
two-pointersstringdynamic-programming

Min Cost Climbing Stairs

Solve

You are given an integer array cost where cost[i] is the cost of ith step on a staircase. Once you pay the cost, you can either climb one or two steps.

EasySometimes
arraydynamic-programming

Truncate Sentence

Solve

A sentence is a list of words that are separated by a single space with no leading or trailing spaces. Each of the words consists of only uppercase and lowercas...

EasySometimes
arraystring

Binary Search

Solve

Given an array of integers nums which is sorted in ascending order, and an integer target, write a function to search target in nums. If target exists, then ret...

EasySometimes
arraybinary-search

Median of Two Sorted Arrays

Solve

Given two sorted arrays nums1 and nums2 of size m and n respectively, return the median of the two sorted arrays.

HardSometimes
arraybinary-searchdivide-and-conquer

Make The String Great

Solve

Given a string s of lower and upper case English letters.

EasySometimes
stringstack

Maximum Depth of Binary Tree

Solve

Given the root of a binary tree, return its maximum depth.

EasySometimes
treedepth-first-searchbreadth-first-search

01 Matrix

Solve

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

MediumSometimes
arraydynamic-programmingbreadth-first-search

Average Value of Even Numbers That Are Divisible by Three

Solve

Given an integer array nums of positive integers, return the average value of all even integers that are divisible by 3.

EasySometimes
arraymath

Integer to Roman

Solve

Seven different symbols represent Roman numerals with the following values:

MediumSometimes
hash-tablemathstring

Single Number II

Solve

Given an integer array nums where every element appears three times except for one, which appears exactly once. Find the single element and return it.

MediumSometimes
arraybit-manipulation

Daily Temperatures

Solve

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

MediumSometimes
arraystackmonotonic-stack

Search a 2D Matrix

Solve

You are given an m x n integer matrix matrix with the following two properties:

MediumSometimes
arraybinary-searchmatrix

Count Pairs Whose Sum is Less than Target

Solve

Given a 0-indexed integer array nums of length n and an integer target, return the number of pairs (i, j) where 0 <= i < j < n and nums[i] + nums[j] < target.

EasySometimes
arraytwo-pointersbinary-search

Substrings of Size Three with Distinct Characters

Solve

A string is good if there are no repeated characters.

EasySometimes
hash-tablestringsliding-window

Count Operations to Obtain Zero

Solve

You are given two non-negative integers num1 and num2.

EasySometimes
mathsimulation

Number of Days Between Two Dates

Solve

Write a program to count the number of days between two dates.

EasySometimes
mathstring

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.

EasySometimes
mathbinary-search

Excel Sheet Column Title

Solve

Given an integer columnNumber, return its corresponding column title as it appears in an Excel sheet.

EasySometimes
mathstring

Second Highest Salary

Solve

Table: Employee

MediumSometimes
database

Find Original Array From Doubled Array

Solve

An integer array original is transformed into a doubled array changed by appending twice the value of every element in original, and then randomly shuffling the...

MediumSometimes
arrayhash-tablegreedy

N-th Tribonacci Number

Solve

The Tribonacci sequence Tn is defined as follows:

EasySometimes
mathdynamic-programmingmemoization

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

Very Likely

75-100%

Likely

50-74%

Sometimes

25-49%

Rare

0-24%

Preparing for your Accenture coding interview

Accenture interviews focus heavily on array, math, string 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. Accenture 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 Accenture ask in interviews?add

Accenture has been reported to ask 100 distinct coding problems. The most common topics are array, math, string. 51 are Easy difficulty, 45 are Medium, and 4 are Hard. Problems are sorted by frequency - the ones at the top are asked most often.

How hard are Accenture coding interviews?add

Based on 100 reported problems, Accenture interviews are easier than average - only 4% Hard compared to 18% across all companies. 45% 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 Accenture coding interview?add

Start with the highest-frequency problems listed on this page. Focus on the core topics: array, math, string. 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 Accenture interview?

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

Simulate a Accenture interview with AIarrow_forward