Accenture Acutal Coding Questions & Psudeo Codes
Accenture Acutal Coding Questions & Psudeo Codes
Problem Statement
You are given a string str of length n. You have to find and print the most frequent vowel in
the string str
Note: You may assume that str will always have a unique most frequent vowel
Input Format:
The input consists of two lines:
• The first line contains an integer, i.e. n.
• The second line contains a string str of length n. The input will be read from the STDIN by the candidate
Output Format:
Print a single character which represents the most frequent vowel in the given string. The output will be
matched to the candidate's output printed on the STDOUT
Accenture Actual Coding Questions & Pseudo Codes
Example:
Input:
6
xyuaab
Output:
a
Explanation:
As the vowel 'a' occurs the most in the string str, hence 'a' is printed in the output
Sample input
11
abeaicaidao
Accenture Actual Coding Questions & Pseudo Codes
Q2. Add Alternate Nodes in Linked List
Problem Statement
There is a singly linked list represented by the following structure:
struct Node
{
int data;
struct Node* next;
};
The function accepts a pointer to the start of the linked list, 'head' as its argument. Implement the function to modify the
given list in such a way that original value of each node the value of next to the next node and return the modified list.
Note:
• Return null if list is null. In case of python if list is None return None.
• Do not create new linked list, just modify the input linked list
• 1st and 2nd node values remain unchanged
Accenture Actual Coding Questions & Pseudo Codes
Example:
Input:
head: 1-> 2-> 3-> 4-> 5-> 6-> 7
Output:
1-> 2-> 4-> 6-> 8-> 10 -> 12
Explanation:
Adding original value of the node to its next to next node,
Replace value of '3' with 1+3=4
Replace value of '4' with 2 +4=6
Replace value of '5' with 3+5=8
Replace value of '6' with 4 + 6 = 10
Replace value of '7' with 5+ 7 = 12
Thus obtained linked list is 1-> 2-> 4-> 6 -> 8-10 -> 12
The custom input format for the above case:
7
1234567
(The first line represents the number of nodes, the second line represents the linked list)
Accenture Actual Coding Questions & Pseudo Codes
Sample input
head: 2 -> 1-> 9-> 2
Sample Output
2 - 1 - 11 -> 3
60
55
73
48
Accenture Actual Coding Questions & Pseudo Codes
40
37
35
42
Accenture Actual Coding Questions & Pseudo Codes
52
63
33
43
Accenture Actual Coding Questions & Pseudo Codes
28
37
50
34
Accenture Actual Coding Questions & Pseudo Codes
0
-2
3
8