Accenture is a three-decade-old, Irish, multi-billion dollar professional services company. It is a dream employer for many programmers all over the world. So, to become a part of this prestigious company, you need to be one of the top applicants to clear their hiring process. This guide provides some of the frequently asked Accenture Coding Questions that will help you secure a job instantly.

Decoding the Coding Round With These Accenture Coding Questions Off-campus Drive

A critical part of Accenture’s interview process is the coding round, which tests the knowledge and expertise of candidates. We have rounded up the 10 most commonly asked coding questions in Accenture’s off-campus drive with steps, assumptions, examples and explanations.


1. Execute this function of Accenture Coding Questions: def differenceofSum(n.m)

As parameters, the function accepts two integrals, m and n. You must calculate the sum of all numbers in the range 1 to n (both inclusive) that are not divisible by m.

You also need to provide the distinction between the sum of non-divisible integers and the sum of divisible integers.

Assumption: m > 0 and n > 0, and Sum lies within the integral range.

Example: If Input is m = 6, n = 30, then output will be 285. Integers divisible by 6 are 6, 12, 18, 24, and 30. Their sum is 90.

Integers that are not divisible by 6 are 1, 2, 3, 4, 5, 7, 8, 9, 10, 11, 13, 14, 15, 16, 17, 19, 20, 21, 22, 23, 25, 26, 27, 28, and 29. Their sum is 375. The difference between them is 285 (375 – 90).

2. Execute this function: Int Numberofcarry(Integer num 1, Integer num 2)

When the sum of the digits exceeds a total of 9, a carry digit is added to the right-left of the digit.

Also Read:  BCA vs. B.Tech: Deciphering Course Structures, Fees, and Career Prospects

Assumption: num1, num2 > = 0

Example: If Input is num1 = 451, num2 = 349, then output will be 2.

Also read: Preparing for a Java interview? Read ten of the most tricky Java programming interview questions here.

3. Execute this function: def LargeSmallSum(arr)

The function accepts an integral ‘arr’ that is proportional to the size or length of its parameters. Return the sum of the second smallest element in the odd position (‘arr’) and the biggest element in the even position (‘even’).

Assumption: Every array element is unique, and the zero position is treated as 7th. If the array has nothing inside, return 0, and if the array length is 3 or <3, return 0.

Example: If Input array arr = 3 2 1 7 5 4, then the output will be 7. Since the second largest element from the even position is 3 and the second largest element from the odd position is 4, the output is 7 (3 + 4).

4. Execute this function: def Productsmallpair(sum, arr)

This function accepts the integers sum and arr. It is used to find the arr(j) and arr(k), where k! = j. arr(j) and arr(k) should be the smallest elements in the array.

Assumption: If n<2 or empty, return –1. If these pairs are not found, return to zero. All the values are integers.

Example: If Input is sum = 9, arr = 5 4 2 3 9 1 7, then the output will be 2 as we have to select the two smallest numbers, which are 2 and 1.

The sum of these two (2 + 1) = 3. This is less than 9 (3 < 9). The product of these two is 2 (2 x 1 = 2). Hence, the output is integer 2.

5. Execute this function: Int OperationsBinarystring(char* str)

The binary number system only uses two digits, 1 and 0.

Also Read:  2022: The Time for Educators to Focus on 'Learning by Doing'

Assumption: Return to –1 if str is null and the str is odd.

Example: If Input is Str: ICOCICIAOBI, then output will be 1. The input, when expanded, is “1 XOR 0 XOR 1 XOR 1 XOR 1 AND 0 OR 1”. The result becomes 1, and hence the output is 1.

Also read: Want to see what it takes to go from a learner to a software engineer, read Baljeet’s inspirational journey here.

6. Execute this function: Def Autocount(x)

This is one f the most asked Accenture coding questions, which you should understand at the expert level.  The function accepts the string n. It determines whether or not a number is an autobiographical number.

If an integer is returned, the number is autobiographical. If 0 is returned, the number is not autobiographical.

Assumption: The input value should not be longer than 10 characters and contain numeric characters.

Example: If Input is x = 1210, then the output will be 3.

7. Form an array of 1000 integers and find out the second-largest number. If there is no second-largest number, return the value to –1.

Example: If Input is num1 = 3, num2 = {2,1,2} then output will be 1 as the integer 1 is the second largest in the array.

8. Adam decides to do some charity work. From day 1 till day x, he will give i^2 coins to charity. On the day ‘i’ (1 < = i < = x), find the number of coins he gives to charity.

Example: If the Input is 2, then the output will be 5. Similarly, if the input is 3, then the output will be 14.

9. Find the sum of the divisors for the N integer number.

Example: If the Input is 6, then the output will be 12. Since divisors of 6 are 1, 2, 3, and 6. The sum of these numbers is 12.

Also Read:  What is CoCubes Total Marks? Find Out!

If you’re new to software development and overwhelmed with new terms, here are the 19 most important terms you should know!

10. Write a program that accepts the integer array of length ‘size’ and finds the largest number that can be formed by permutation.

Assumption: The order of the numbers might need rearrangement to make the largest possible number.

Example: If Input is 34 79 58 64 then the output will be 98765443 as that is the largest number that can be formed by rearranging the available numbers.

You’re Almost Ready to Ace it!

These were a few programming questions that were frequently asked Accenture Coding Questions for off-campus drives.

If you want to develop your programming skills and become a next-level software engineer who aces interviews in no time, you can join the Software Engineering Bootcamp by CodeQuotient.

This is an industry-renowned, three-month online, ‘full-stack development’ internship program focusing on project-based learning. So, don’t wait any longer; apply today!

Get UGC Approved, BCA Degree
And Earn While You Do That

Join CodeQuotient's Under-Graduate Program In Software Engineering

Get Paid Internship with Our Hiring Partners to Sponsor Your Fees

100% Placement Assistance

Leave a Reply

Your email address will not be published. Required fields are marked *



©️ 2024. All Rights Reserved.