Syllabus

Accenture Coding Assessment 2024

The Accenture Coding Round Assessment is an in-depth assessment aimed at evaluating a candidate's proficiency in writing, analyzing, and debugging code.

Let's explore the key areas covered in this assessment.

Accenture Coding Questions - Overview

Here's an overview of the Accenture Coding Round Questions section:

Parameter Details

Total number of Questions

2 Questions

Total Time Duration

45 minutes

Type of Test

Non-Adaptive

Negative Marking

No

Accepted Languages

C, C++, Java, Python, Dot Net

Marking Scheme

One Complete Output, One Partial Output

Accenture Coding Syllabus & Topics

Here's a snapshot of the Coding syllabus:

Topic No. of Questions Difficulty Importance

Basics of Programming

0-1

High

High

Input & Output Concepts

0-1

High

High

Flow Control

0-1

High

High

Conditional Looping

0-1

High

High

Arrays

0-1

High

High

Functions

0-1

High

High

Strings

0-1

Medium

High

Data Types & Operators

0-1

Medium

High

Practice Sample Accenture Coding Questions

1.

1. Problem Description :

The function accepts two positive integers ‘r’ and ‘unit’ and a positive integer array ‘arr’ of size ‘n’ as its argument ‘r’ represents the number of rats present in an area, ‘unit’ is the amount of food each rat consumes and each ith element of array ‘arr’ represents the amount of food present in ‘i+1’ house number, where 0 <= i

Note:

Return -1 if the array is null
Return 0 if the total amount of food from all houses is not sufficient for all the rats.
Computed values lie within the integer range.
Example:
Input:

r: 7
unit: 2
n: 8
arr: 2 8 3 5 7 4 1 2

Output:

4

Explanation:

Total amount of food required for all rats = r * unit

= 7 * 2 = 14.

The amount of food in 1st houses = 2+8+3+5 = 18. Since, amount of food in 1st 4 houses is sufficient for all the rats. Thus, output is 4.

solution


#include<bits/stdc++.h>
using namespace std;
int calculate(int r, int unit, int arr[], int n)
{
    if(n==0) return -1;
    int totalFoodRequired=r*unit;
    int foodTillNow=0;
    int house=0;
    for(house=0;house<n;++house)
    {
        foodTillNow+=arr[house];
        if(foodTillNow>=totalFoodRequired)
        {
            break;
        }
    }
    if(totalFoodRequired>foodTillNow) return 0;
    return house+1;
}
int main()
{
    int r;
    cin>>r;
    int unit;
    cin>>unit;
    int n;
    cin>>n;
    int arr[n];
    for(int i=0;i<n;++i)
    {
        cin>>arr[i];
    }
    cout<<calculate(r,unit,arr,n);
    return 0;
}

2.

2. Problem Description :

The Binary number system only uses two digits, 0 and 1 and number system can be called binary string. You are required to implement the following function:

int OperationsBinaryString(char* str);

The function accepts a string str as its argument. The string str consists of binary digits eparated with an alphabet as follows:

  • A denotes AND operation
  • B denotes OR operation
  • C denotes XOR Operation

You are required to calculate the result of the string str, scanning the string to right taking one opearation at a time, and return the same.

Note:

No order of priorities of operations is required
Length of str is odd
If str is NULL or None (in case of Python), return -1

Input:

str: 1C0C1C1A0B1

Output:

1

Explanation:

The alphabets in str when expanded becomes “1 XOR 0 XOR 1 XOR 1 AND 0 OR 1”, result of the expression becomes 1, hence 1 is returned.

Sample Input:

0C1A1B1C1C1B0A0

Output:

0

Solution


#include<bits/stdc++.h>
using namespace std;
int OperationsBinaryString(char *str)
{
    if(str==NULL) return -1;
    int i=1;
    int a=*str-'0';
    str++;
    while(*str!='\0')
    {
        char p=*str;
        str++;
        if(p=='A') a&=(*str-'0');
        else if(p=='B') a|=(*str-'0');
        else a^=(*str-'0');
        str++;
    }
    return a;
}
int main()
{
    string s;
    getline(cin,s);
    int len=s.size();
    char *str=&s[0];
    cout<<OperationsBinaryString(str);
}

1 of 1

Frequently Asked QuestionsFAQ

What programming languages can I use for the Accenture Coding test?

You can use C, C++, Java, Python, or Dot Net for the Accenture Coding test.

How many coding questions will be there in the Accenture coding round?

There will be a total of 2 coding questions in the Accenture coding round.

What is the difficulty level of the Accenture coding questions?

The difficulty level of the Accenture coding questions is high.

How much time is allocated for solving the coding questions in the Accenture test?

A total of 45 minutes is allocated for solving the coding questions in the Accenture test.

What are the selection criteria for clearing the Accenture coding round?

For successfully clearing the Accenture coding round, students need to have 1 Complete Output and 1 Partial Output.

Are there any specific rules for attempting the Accenture coding round questions?

Yes, the rules include starting the code from scratch, writing the whole program, and requiring one partial and one complete output for clearing the round. Errors are also clearly mentioned.

Can you provide more information about the marking scheme for the Accenture coding questions?

The marking scheme requires one complete output and one partial output for the two questions asked in the coding round.

Is there any negative marking in the Accenture coding test?

No, there is no negative marking in the Accenture coding test.