Accenture Placement Papers 2024
Access 2024 Accenture NLT questions with solutions and exam pattern analysis.
Practice with 20+ Accenture placement paper coding questions covering the Accenture NLT (National Level Test) coding section. These questions are representative of what you’ll encounter in Accenture’s online assessment and technical interviews.
What’s Included:
Accenture Placement Papers 2024
Access 2024 Accenture NLT questions with solutions and exam pattern analysis.
Accenture Placement Papers 2025
Practice latest 2025 Accenture NLT questions with updated patterns.
Complete Accenture guide
Access complete Accenture placement papers guide with eligibility, process, and preparation strategy.
Accenture NLT Coding Section Breakdown:
| Section | Questions | Time | Difficulty | Focus Areas |
|---|---|---|---|---|
| Coding Test | 2 | 30-35 min | Easy-Medium | Arrays, strings, basic algorithms, business logic |
Languages Allowed: C, C++, Java, Python
Passing Criteria: Solve at least 1 problem completely with all test cases passing
Problem: Find the maximum and minimum elements in an array.
Example:
Input: [3, 5, 1, 8, 2]Output: Max: 8, Min: 1Solution (Java):
public int[] findMaxMin(int[] arr) { if (arr == null || arr.length == 0) return new int[]{};
int max = arr[0], min = arr[0];
for (int num : arr) { if (num > max) max = num; if (num < min) min = num; }
return new int[]{max, min};}Solution (Python):
def find_max_min(arr): if not arr: return None, None return max(arr), min(arr)Time Complexity: O(n) | Space Complexity: O(1)
Problem: Find the second largest element in an array without sorting.
Example:
Input: [12, 35, 1, 10, 34, 1]Output: 34Solution (Java):
public int secondLargest(int[] arr) { if (arr.length < 2) return -1;
int first = Integer.MIN_VALUE, second = Integer.MIN_VALUE;
for (int num : arr) { if (num > first) { second = first; first = num; } else if (num > second && num != first) { second = num; } }
return second == Integer.MIN_VALUE ? -1 : second;}Solution (Python):
def second_largest(arr): if len(arr) < 2: return -1
first = second = float('-inf')
for num in arr: if num > first: second = first first = num elif num > second and num != first: second = num
return second if second != float('-inf') else -1Time Complexity: O(n) | Space Complexity: O(1)
Problem: Rotate an array to the left by k positions.
Example:
Input: arr = [1, 2, 3, 4, 5], k = 2Output: [3, 4, 5, 1, 2]Solution (Java):
public void rotateLeft(int[] arr, int k) { int n = arr.length; k = k % n;
reverse(arr, 0, k - 1); reverse(arr, k, n - 1); reverse(arr, 0, n - 1);}
private void reverse(int[] arr, int start, int end) { while (start < end) { int temp = arr[start]; arr[start] = arr[end]; arr[end] = temp; start++; end--; }}Solution (Python):
def rotate_left(arr, k): n = len(arr) k = k % n return arr[k:] + arr[:k]Time Complexity: O(n) | Space Complexity: O(1) or O(n)
Problem: Find if there are any duplicates in an array.
Example:
Input: [1, 2, 3, 1]Output: true (1 appears twice)Solution (Java):
public boolean containsDuplicate(int[] nums) { Set<Integer> seen = new HashSet<>();
for (int num : nums) { if (seen.contains(num)) { return true; } seen.add(num); }
return false;}Solution (Python):
def contains_duplicate(nums): return len(nums) != len(set(nums))Time Complexity: O(n) | Space Complexity: O(n)
Problem: Find the sum of all elements in an array.
Example:
Input: [1, 2, 3, 4, 5]Output: 15Solution (Java):
public int sumArray(int[] arr) { int sum = 0; for (int num : arr) { sum += num; } return sum;}Solution (Python):
def sum_array(arr): return sum(arr)Time Complexity: O(n) | Space Complexity: O(1)
Problem: Find the missing number in an array containing 1 to n.
Example:
Input: [1, 2, 4, 5, 6] (n = 6)Output: 3Solution (Java):
public int findMissing(int[] nums, int n) { int expectedSum = n * (n + 1) / 2; int actualSum = 0;
for (int num : nums) { actualSum += num; }
return expectedSum - actualSum;}Solution (Python):
def find_missing(nums, n): expected = n * (n + 1) // 2 return expected - sum(nums)Time Complexity: O(n) | Space Complexity: O(1)
Problem: Given a string, reverse the order of words.
Example:
Input: "the sky is blue"Output: "blue is sky the"Solution (Java):
public String reverseWords(String s) { String[] words = s.trim().split("\\s+"); StringBuilder result = new StringBuilder();
for (int i = words.length - 1; i >= 0; i--) { result.append(words[i]); if (i > 0) result.append(" "); }
return result.toString();}Solution (Python):
def reverse_words(s): words = s.split() return ' '.join(words[::-1])Time Complexity: O(n) | Space Complexity: O(n)
Problem: Check if a string is a palindrome (ignoring case).
Example:
Input: "Madam"Output: trueSolution (Java):
public boolean isPalindrome(String s) { s = s.toLowerCase().replaceAll("[^a-z0-9]", ""); int left = 0, right = s.length() - 1;
while (left < right) { if (s.charAt(left) != s.charAt(right)) { return false; } left++; right--; }
return true;}Solution (Python):
def is_palindrome(s): cleaned = ''.join(c.lower() for c in s if c.isalnum()) return cleaned == cleaned[::-1]Time Complexity: O(n) | Space Complexity: O(n)
Problem: Count the number of vowels and consonants in a string.
Example:
Input: "Hello World"Output: Vowels: 3, Consonants: 7Solution (Java):
public int[] countVowelsConsonants(String s) { int vowels = 0, consonants = 0; s = s.toLowerCase();
for (char c : s.toCharArray()) { if (Character.isLetter(c)) { if ("aeiou".indexOf(c) != -1) { vowels++; } else { consonants++; } } }
return new int[]{vowels, consonants};}Solution (Python):
def count_vowels_consonants(s): vowels = set('aeiouAEIOU') v_count = c_count = 0
for char in s: if char.isalpha(): if char in vowels: v_count += 1 else: c_count += 1
return v_count, c_countTime Complexity: O(n) | Space Complexity: O(1)
Problem: Check if two strings are anagrams of each other.
Example:
Input: s1 = "listen", s2 = "silent"Output: trueSolution (Java):
public boolean isAnagram(String s1, String s2) { if (s1.length() != s2.length()) return false;
int[] count = new int[26];
for (int i = 0; i < s1.length(); i++) { count[s1.charAt(i) - 'a']++; count[s2.charAt(i) - 'a']--; }
for (int c : count) { if (c != 0) return false; }
return true;}Solution (Python):
def is_anagram(s1, s2): return sorted(s1.lower()) == sorted(s2.lower())Time Complexity: O(n) | Space Complexity: O(1)
Problem: Find the first non-repeating character in a string.
Example:
Input: "leetcode"Output: 'l'Solution (Java):
public char firstUnique(String s) { int[] count = new int[26];
for (char c : s.toCharArray()) { count[c - 'a']++; }
for (char c : s.toCharArray()) { if (count[c - 'a'] == 1) { return c; } }
return '\0';}Solution (Python):
def first_unique(s): from collections import Counter count = Counter(s)
for char in s: if count[char] == 1: return char return NoneTime Complexity: O(n) | Space Complexity: O(1)
Problem: Remove duplicate characters from a string while maintaining order.
Example:
Input: "programming"Output: "progamin"Solution (Java):
public String removeDuplicates(String s) { StringBuilder result = new StringBuilder(); Set<Character> seen = new HashSet<>();
for (char c : s.toCharArray()) { if (!seen.contains(c)) { seen.add(c); result.append(c); } }
return result.toString();}Solution (Python):
def remove_duplicates(s): seen = set() result = []
for char in s: if char not in seen: seen.add(char) result.append(char)
return ''.join(result)Time Complexity: O(n) | Space Complexity: O(n)
Problem: Determine if a given number is prime.
Example:
Input: 17Output: trueSolution (Java):
public boolean isPrime(int n) { if (n <= 1) return false; if (n <= 3) return true; if (n % 2 == 0 || n % 3 == 0) return false;
for (int i = 5; i * i <= n; i += 6) { if (n % i == 0 || n % (i + 2) == 0) { return false; } } return true;}Solution (Python):
def is_prime(n): if n <= 1: return False if n <= 3: return True if n % 2 == 0 or n % 3 == 0: return False
i = 5 while i * i <= n: if n % i == 0 or n % (i + 2) == 0: return False i += 6 return TrueTime Complexity: O(√n) | Space Complexity: O(1)
Problem: Calculate the factorial of a number.
Example:
Input: 5Output: 120Solution (Java):
public long factorial(int n) { if (n <= 1) return 1;
long result = 1; for (int i = 2; i <= n; i++) { result *= i; }
return result;}Solution (Python):
def factorial(n): if n <= 1: return 1 result = 1 for i in range(2, n + 1): result *= i return resultTime Complexity: O(n) | Space Complexity: O(1)
Problem: Generate Fibonacci series up to n terms.
Example:
Input: n = 7Output: [0, 1, 1, 2, 3, 5, 8]Solution (Java):
public int[] fibonacci(int n) { if (n <= 0) return new int[]{}; if (n == 1) return new int[]{0};
int[] fib = new int[n]; fib[0] = 0; fib[1] = 1;
for (int i = 2; i < n; i++) { fib[i] = fib[i-1] + fib[i-2]; }
return fib;}Solution (Python):
def fibonacci(n): if n <= 0: return []
fib = [0, 1] for i in range(2, n): fib.append(fib[-1] + fib[-2])
return fib[:n]Time Complexity: O(n) | Space Complexity: O(n)
Problem: Find the Greatest Common Divisor of two numbers.
Example:
Input: a = 48, b = 18Output: 6Solution (Java):
public int gcd(int a, int b) { while (b != 0) { int temp = b; b = a % b; a = temp; } return a;}Solution (Python):
def gcd(a, b): while b: a, b = b, a % b return aTime Complexity: O(log(min(a,b))) | Space Complexity: O(1)
Problem: Find the sum of digits of a number.
Example:
Input: 12345Output: 15Solution (Java):
public int sumOfDigits(int n) { int sum = 0; n = Math.abs(n);
while (n > 0) { sum += n % 10; n /= 10; }
return sum;}Solution (Python):
def sum_of_digits(n): return sum(int(d) for d in str(abs(n)))Time Complexity: O(d) | Space Complexity: O(1)
Problem: Check if a number is an Armstrong number.
Example:
Input: 153Output: true (1³ + 5³ + 3³ = 153)Solution (Java):
public boolean isArmstrong(int n) { int original = n; int digits = String.valueOf(n).length(); int sum = 0;
while (n > 0) { int digit = n % 10; sum += Math.pow(digit, digits); n /= 10; }
return sum == original;}Solution (Python):
def is_armstrong(n): digits = len(str(n)) total = sum(int(d) ** digits for d in str(n)) return total == nTime Complexity: O(d) | Space Complexity: O(1)
Problem: Print a right triangle pattern.
Example:
Input: n = 5Output:***************Solution (Java):
public void rightTriangle(int n) { for (int i = 1; i <= n; i++) { for (int j = 1; j <= i; j++) { System.out.print("*"); } System.out.println(); }}Solution (Python):
def right_triangle(n): for i in range(1, n + 1): print('*' * i)Time Complexity: O(n²) | Space Complexity: O(1)
Problem: Print an inverted triangle pattern.
Example:
Input: n = 5Output:***************Solution (Java):
public void invertedTriangle(int n) { for (int i = n; i >= 1; i--) { for (int j = 1; j <= i; j++) { System.out.print("*"); } System.out.println(); }}Solution (Python):
def inverted_triangle(n): for i in range(n, 0, -1): print('*' * i)Time Complexity: O(n²) | Space Complexity: O(1)
Problem: Print a pyramid pattern.
Example:
Input: n = 5Output: * *** ***** ****************Solution (Java):
public void pyramid(int n) { for (int i = 1; i <= n; i++) { for (int j = 1; j <= n - i; j++) { System.out.print(" "); } for (int j = 1; j <= 2 * i - 1; j++) { System.out.print("*"); } System.out.println(); }}Solution (Python):
def pyramid(n): for i in range(1, n + 1): spaces = ' ' * (n - i) stars = '*' * (2 * i - 1) print(spaces + stars)Time Complexity: O(n²) | Space Complexity: O(1)
Problem: Print a number pattern.
Example:
Input: n = 5Output:112123123412345Solution (Java):
public void numberPattern(int n) { for (int i = 1; i <= n; i++) { for (int j = 1; j <= i; j++) { System.out.print(j); } System.out.println(); }}Solution (Python):
def number_pattern(n): for i in range(1, n + 1): for j in range(1, i + 1): print(j, end='') print()Time Complexity: O(n²) | Space Complexity: O(1)
Master one language
Focus on common patterns
Time management
Common mistakes to avoid
Accenture 2024 papers
Previous year papers with coding questions
Accenture 2025 papers
Latest papers with current year questions
Accenture aptitude questions
Aptitude questions with solutions
Accenture interview experience
Real interview experiences
Accenture preparation guide
Comprehensive preparation strategy
Accenture main page
Complete Accenture placement guide
TCS · Infosys · Wipro · HCL · Cognizant · Capgemini
Practice Accenture coding questions regularly! Focus on array manipulation, string processing, and mathematical problems. These are the most common problem types in Accenture NLT.
Pro Tip: Accenture values working code that handles all test cases. Focus on correctness first, then optimize if time permits.