Add office photos
Employer?
Claim Account for FREE

Accenture

4.0
based on 49.5k Reviews
Proud winner of ABECA 2024 - AmbitionBox Employee Choice Awards

Top 3.2k Interview Questions and Answers 2024

Updated on 5 September 2024
Q1. Triplets with Given Sum You are given an array/list ARR consisting of N integers. Your task is to find all the distinct triplets present in the array which adds up to a given number K. An array is said to have a triplet {ARR[i], ARR[j], ARR[k]} with sum = 'K' if there exists three indices i, j and k such that i!=j, j!=k and i!=j and ARR[i] + ARR[j] + ARR[k] = 'K'. Note: 1. You can return the list of values in any order. For example, if a valid triplet is {1, 2, -3}, then {2, -3, 1}, {-3, 2, 1} etc is also valid triplet. Also, the ordering of different triplets can be random i.e if there are more than one valid triplets, you can return them in any order. 2. The elements in the array need not be distinct. 3. If no suc...read more
View Answers (4)
Q2. If insurance premium is paid for an entire year 1st January to 31st December and books get close on 31st March, what will be the accounting treatment? ...read more
View Answers (126)
Q3. Sum of even & odd Write a program to input an integer N and print the sum of all its even digits and sum of all its odd digits separately. Digits mean numbers, not the places! That is, if the given integer is "13245", even digits are 2 & 4 and odd digits are 1, 3 & 5. Input format : Integer N Output format : Sum_of_Even_Digits Sum_of_Odd_Digits (Print first even sum and then odd sum separated by space) Constraints 0 ...read more
View Answers (6)
Discover interview dos and don'ts from real experiences
Q4. LCA of three Nodes You have been given a Binary Tree of 'N' nodes where the nodes have integer values and three integers 'N1', 'N2', and 'N3'. Find the LCA(Lowest Common Ancestor) of the three nodes represented by the given three('N1', 'N2', 'N3') integer values in the Binary Tree. For example: For the given binary tree: the LCA of (7,8,10) is 1 Note: All of the node values of the binary tree will be unique. N1, N2, and N3 will always exist in the binary tree. Input Format: The first line of input contains a single integer T, representing the number of test cases or queries to be run. Then the T test cases follow. The first line of each test case contains three single space-separated integers N1, N2, and N3, denot...read more
View Answers (3)
Q5. Find Duplicate You have been given an integer array/list(ARR) of size N which contains numbers from 0 to (N - 2). Each number is present at least once. That is, if N = 5, the array/list constitutes values ranging from 0 to 3 and among these, there is a single integer value that is present twice. You need to find and return that duplicate number present in the array. Note : Duplicate number is always present in the given array/list. Input format : The first line contains an Integer 't' which denotes the number of test cases or queries to be run. Then the test cases follow. First line of each test case or query contains an integer 'N' representing the size of the array/list. Second line contains 'N' single space sepa...read more
View Answers (3)
Q6. Reverse String You are given a string ‘S’. You are also given ‘M’ integers in an array ‘A’. You perform ‘M’ operations on this string. The operations are given in an array ‘A’ of size ‘M’. You perform the operations in the order they appear in the array ‘A’. In the ‘i’th operation, you reverse the substring of ‘S’ from the position ‘A[i]’ to ‘len(S)’ - ‘A[i]’ - 1 (0 based). Your task is to find the string after performing all the operations. Example : ‘S’ = “aabcd”, ‘M’ = 2, ‘A’ = [0, 1] After 1st operation i.e, reversing from [0, 4], ‘S’ = “dcbaa”. After 2nd operation i.e, reversing from [1, 3], ‘S’ = “dabca”. Hence, the answer is “dabca”. Input Format : The first line contains a single integer ‘T’ denoting the nu...read more
View Answers (2)
Share interview questions and help millions of jobseekers 🌟
Q7. Case. There is a housing society “The wasteful society”, you collect all the household garbage and sell it to 5 different businesses. Determine what price you will pay to the society members in Rs/kg, given you want to make a profit of 20% for a year. The garbage you collect is sold to the following 5 vendors: a. Compost Manufacturer b. Plastic Recycler c. Paper Recycler d. Metal Recycler e. Miscellaneous...read more
View Answers (7)
Q8. Armstrong Number You are given an integer ‘NUM’ . Your task is to find out whether this number is an Armstrong number or not. A k-digit number ‘NUM’ is an Armstrong number if and only if the k-th power of each digit sums to ‘NUM’. Example 153 = 1^3 + 5^3 + 3^3. Therefore 153 is an Armstrong number. Input Format: The first line contains an integer ‘T’, which denotes the number of test cases to be run. Then, the ‘T’ test cases follow. The first line of each test case contains a single positive integer, ‘NUM’. Output Format: For each test case, print ‘YES’ if it is an Armstrong number otherwise print ‘NO’. The output of each test case will be printed in a separate line. Note: You do not need to print anything. It ha...read more
View Answers (2)
Q9. Kth Smallest and Largest Element of Array You are given an array ‘Arr’ consisting of ‘N’ distinct integers and a positive integer ‘K’. Find out Kth smallest and Kth largest element of the array. It is guaranteed that K is not greater than the size of the array. Example: Let ‘N’ = 4, ‘Arr’ be [1, 2, 5, 4] and ‘K’ = 3. then the elements of this array in ascending order is [1, 2, 4, 5]. Clearly, the 3rd smallest and largest element of this array is 4 and 2 respectively. Input format: The first line of input contains an integer ‘T’ denoting the number of test cases. The next 2*T lines represent the ‘T’ test cases. The first line of each test case contains two space-separated integers ‘N’ and ‘K’ respectively. The secon...read more
View Answers (4)
Q10. What are three golden rules of accounting?...read more
View Answers (189)
Q11. Maximum Subarray Sum You are given an array/list ARR consisting of N integers. Your task is to find the maximum possible sum of a non-empty subarray(contagious) of this array. Note: An array C is a subarray of array D if it can be obtained by deletion of several elements(possibly zero) from the beginning and the end of array D. For e.g.- All the non-empty subarrays of array [1,2,3] are [1], [2], [3], [1,2], [2,3], [1,2,3]. Input Format The first line of input contains a single integer ‘N’ denoting the number of elements in the array/list. The second line of input contains ‘N’ single space-separated integers, denoting the elements of the array. Output Format : Print the maximum possible sum of any subarray of the ar...read more
View Answers (4)
Q12. Product Of Array Except Self You have been given an integer array/list (ARR) of size N. You have to return an array/list PRODUCT such that PRODUCT[i] is equal to the product of all the elements of ARR except ARR[i] Note : Each product can cross the integer limits, so we should take modulo of the operation. Take MOD = 10^9 + 7 to always stay in the limits. Follow up : Can you try solving the problem in O(1) space? Input format : The first line contains an integer 'T' which denotes the number of test cases or queries to be run. Then the test cases follow. The first line of each test case or query contains an integer 'N' representing the size of the array/list. The second line contains 'N' single space-separated inte...read more
View Answers (3)
Q13. Check If The String Is A Palindrome You are given a string 'S'. Your task is to check whether the string is palindrome or not. For checking palindrome, consider alphabets and numbers only and ignore the symbols and whitespaces. Note : String 'S' is NOT case sensitive. Example : Let S = “c1 O$d@eeD o1c”. If we ignore the special characters, whitespaces and convert all uppercase letters to lowercase, we get S = “c1odeedo1c”, which is a palindrome. Hence, the given string is also a palindrome. Input format : The very first line of input contains an integer 'T' denoting the number of test cases. The first line of every test case contains the string 'S'. Output format : For each test case, print “Yes” if 'S' is a pali...read more
View Answers (3)
Q14. Tiling Problem You have been given a board where there are '2' rows and 'N' columns. You have an infinite supply of 2x1 tiles, and you can place a tile in the following ways: 1. Horizontally as 1x2 tile 2. Vertically as 2x1 tile Count the number of ways to tile the given board using the available tiles. Note : The number of ways might be large so output your answer modulo 10^9 + 7. Here an example of tile and board for 'N' = 4 : Input format : The first and only line of each test case contains an Integer 'N' which denotes the size of the board, i.e. '2' rows and 'N' columns. Output format : For each test case, print the number of ways to tile the board modulo 10^9 + 7. Note: You are not required to print the out...read more
View Answers (3)
Q15. Evaluation of postfix expression An expression is called the postfix expression if the operator appears in the expression after the operands. Example : Infix expression: A + B * C - D Postfix expression: A B + C D - * Given a postfix expression, the task is to evaluate the expression. The answer could be very large, output your answer modulo (10^9+7). Also, use modular division when required. Note: 1. Operators will only include the basic arithmetic operators like '*', '/', '+', and '-'. 2. The operand can contain multiple digits. 3. The operators and operands will have space as a separator between them. 4. There won’t be any brackets in the postfix expression. Input format: The first line of input contains an int...read more
View Answer (1)
Q16. Puzzle Question Which number would replace the underline marked in the series 20, 40,100, ...., 820? ...read more
View Answers (2)
Q17. Equilibrium Index You are given an array Arr consisting of N integers. You need to find the equilibrium index of the array. An index is considered as an equilibrium index if the sum of elements of the array to the left of that index is equal to the sum of elements to the right of it. Note: 1. The array follows 0-based indexing, so you need to return the 0-based index of the element. 2. Note that the element at the equilibrium index won’t be considered for either left sum or right sum. 3. If there are multiple indices which satisfy the given condition, then return the left-most index i.e if there are indices i,j,k…. which are equilibrium indices, return the minimum among them 4. If no such index is present in the arr...read more
View Answers (3)
Q18. Balanced parentheses Given an integer ‘N’ representing the number of pairs of parentheses, Find all the possible combinations of balanced parentheses with the given number of pairs of parentheses. Note : Conditions for valid parentheses: 1. All open brackets must be closed by the closing brackets. 2. Open brackets must be closed in the correct order. For Example : ()()()() is a valid parentheses. )()()( is not a valid parentheses. Input format : The first line of input contains an integer ‘T’, which denotes the number of test cases. Then each test case follows. Each line of the test case contains an integer ‘N’ denoting the pair of parentheses. Output format : For each test case print, all the combinations of bal...read more
View Answers (2)
Q19. Chocolate Problem Given an array/list of integer numbers 'CHOCOLATES' of size 'N', where each value of the array/list represents the number of chocolates in the packet. There are ‘M’ number of students and the task is to distribute the chocolate to their students. Distribute chocolate in such a way that: 1. Each student gets at least one packet of chocolate. 2. The difference between the maximum number of chocolate in a packet and the minimum number of chocolate in a packet given to the students is minimum. Example : Given 'N' : 5 (number of packets) and 'M' : 3 (number of students) And chocolates in each packet is : {8, 11, 7, 15, 2} All possible way to distribute 5 packets of chocolates among 3 students are - ( 8...read more
View Answers (2)
Q20. Pair Sum You are given an integer array 'ARR' of size 'N' and an integer 'S'. Your task is to return the list of all pairs of elements such that each sum of elements of each pair equals 'S'. Note: Each pair should be sorted i.e the first value should be less than or equals to the second value. Return the list of pairs sorted in non-decreasing order of their first value. In case if two pairs have the same first value, the pair with a smaller second value should come first. Input Format: The first line of input contains two space-separated integers 'N' and 'S', denoting the size of the input array and the value of 'S'. The second and last line of input contains 'N' space-separated integers, denoting the elements of t...read more
View Answers (3)
1
2
3
4
5
6
7

More about working at Accenture

Top Rated Mega Company - 2024
Top Rated Company for Women - 2024
Top Rated IT/ITES Company - 2024
Contribute & help others!
Write a review
Share interview
Contribute salary
Add office photos
Top Accenture Interview Questions And Answers
Stay ahead in your career. Get AmbitionBox app
qr-code
Helping over 1 Crore job seekers every month in choosing their right fit company
65 Lakh+

Reviews

4 Lakh+

Interviews

4 Crore+

Salaries

1 Cr+

Users/Month

Contribute to help millions
Get AmbitionBox app

Made with ❤️ in India. Trademarks belong to their respective owners. All rights reserved © 2023 Info Edge (India) Ltd.

Follow us
  • Youtube
  • Instagram
  • LinkedIn
  • Facebook
  • Twitter