Add office photos
Employer?
Claim Account for FREE

Adobe

3.9
based on 1.1k Reviews
Video summary
Filter interviews by

10+ Accenture Interview Questions and Answers

Updated 5 Feb 2024
Popular Designations

Q1. Palindromic Partitioning Problem Statement

Given a string ‘str’, calculate the minimum number of partitions required to ensure every resulting substring is a palindrome.

Input:

The first line contains an intege...read more
Ans.

The problem involves calculating the minimum number of partitions needed to ensure every resulting substring is a palindrome.

  • Iterate through the string and check for palindromes at each possible partition point.

  • Keep track of the minimum cuts needed to partition the string into palindromic substrings.

  • Consider edge cases such as when the string is already a palindrome or when all characters are unique.

  • Example: For input 'AACCB', the valid partition 'A | A | CC | B' requires 2 c...read more

Add your answer

Q2. Leaders in an Array Problem Statement

You are given a sequence of numbers. Your task is to find all leaders in this sequence. A leader is defined as an element that is strictly greater than all the elements to ...read more

Ans.

Find all leaders in a sequence - elements greater than all elements to their right.

  • Iterate from right to left, keep track of maximum element encountered so far

  • If current element is greater than maximum, it is a leader

  • Return the leaders in the same order as the input sequence

Add your answer

Q3. Spiral Matrix Path Problem

You are provided with a two-dimensional array named MATRIX of size N x M, consisting of integers. Your task is to return the elements of the matrix following a spiral order.

Input:

Th...read more
Ans.

Implement a function to return elements of a matrix in spiral order.

  • Iterate through the matrix in a spiral order by adjusting the boundaries of rows and columns.

  • Keep track of the direction of traversal (right, down, left, up) to properly move through the matrix.

  • Handle edge cases such as when the matrix is empty or has only one row or column.

Add your answer

Q4. Cycle Detection in a Linked List

Determine if a given Singly Linked List of integers forms a cycle.

Explanation:

A cycle exists in a linked list if a node's next pointer points back to a previous node, creating...read more

Ans.

Detect if a singly linked list forms a cycle by checking if a node's next pointer points back to a previous node.

  • Traverse the linked list using two pointers, one moving at double the speed of the other.

  • If the two pointers meet at any point, there is a cycle in the linked list.

  • Use Floyd's Cycle Detection Algorithm for efficient detection.

  • Example: Input: 3 2 0 -4 -1, 1 Output: true

Add your answer
Discover Accenture interview dos and don'ts from real experiences

Q5. Anagram Pairs Verification Problem

Your task is to determine if two given strings are anagrams of each other. Two strings are considered anagrams if you can rearrange the letters of one string to form the other...read more

Ans.

Check if two strings are anagrams of each other by comparing the sorted characters.

  • Sort the characters of both strings and compare them.

  • Use a dictionary to count the occurrences of characters in each string.

  • Ensure both strings have the same length before proceeding.

  • Handle edge cases like empty strings or strings with different lengths.

  • Example: str1 = 'listen', str2 = 'silent' should return True.

Add your answer

Q6. Binary Tree Mirror Conversion Problem

Given a binary tree, your task is to convert it into its mirror tree.

A binary tree is a data structure where each parent node has at most two children.

The mirror of a bin...read more

Ans.

Convert a binary tree into its mirror tree by interchanging left and right children of non-leaf nodes.

  • Traverse the binary tree in a recursive manner.

  • Swap the left and right children of each non-leaf node.

  • Continue this process until all nodes are visited.

  • Output the inorder traversal of the mirror tree.

Add your answer

Q7. Find K'th Character of Decrypted String

You are given an encrypted string where repeated substrings are represented by the substring followed by its count. Your task is to find the K'th character of the decrypt...read more

Ans.

Given an encrypted string with repeated substrings represented by counts, find the K'th character of the decrypted string.

  • Parse the encrypted string to extract substrings and their counts

  • Iterate through the decrypted string to find the K'th character

  • Handle cases where counts are more than one digit or in parts

Add your answer

Q8. Queue Using Stacks Problem Statement

Implement a queue data structure which adheres to the FIFO (First In First Out) principle, utilizing only stack data structures.

Explanation:

Complete predefined functions t...read more

Ans.

Implement a queue using only stack data structures, supporting FIFO principle.

  • Use two stacks to simulate a queue: one for enqueueing and one for dequeueing.

  • For enQueue operation, push elements onto the enqueue stack.

  • For deQueue operation, if dequeue stack is empty, transfer elements from enqueue stack.

  • For peek operation, return top element of dequeue stack.

  • For isEmpty operation, check if both stacks are empty.

Add your answer

Q9. Stack using Two Queues Problem Statement

Develop a Stack Data Structure to store integer values using two Queues internally.

Your stack implementation should provide these public functions:

Explanation:

1. Cons...read more
Ans.

Implement a stack using two queues to store integer values with specified functions.

  • Create a stack class with two queue data members.

  • Implement push, pop, top, size, and isEmpty functions.

  • Ensure proper handling of edge cases like empty stack.

  • Use queue operations like enqueue and dequeue to simulate stack behavior.

  • Maintain the size of the stack and check for emptiness.

  • Example: Push 42, pop to get 42, push 17, top to get 17.

Add your answer

Q10. Find the Second Largest Element

Given an array or list of integers 'ARR', identify the second largest element in 'ARR'.

If a second largest element does not exist, return -1.

Example:

Input:
ARR = [2, 4, 5, 6, ...read more
Ans.

Find the second largest element in an array of integers.

  • Iterate through the array to find the largest and second largest elements.

  • Handle cases where all elements are identical.

  • Return -1 if a second largest element does not exist.

Add your answer
Contribute & help others!
Write a review
Share interview
Contribute salary
Add office photos
Interview Tips & Stories
Ace your next interview with expert advice and inspiring stories
Share an Interview
Stay ahead in your career. Get AmbitionBox app
qr-code
Helping over 1 Crore job seekers every month in choosing their right fit company
75 Lakh+

Reviews

5 Lakh+

Interviews

4 Crore+

Salaries

1 Cr+

Users/Month

Contribute to help millions

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

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