All question papers

Cognizant

Accenture practice paper 1

Paper structure

SectionTypeQuestionsMarks eachNegative
AptitudeMCQ301-
CodingCoding21-

Sample questions

The first 2 questions of each section. Answers are shown after you take the mock test.

Aptitude

  1. Question 1

    A shopkeeper buys a gas stove and cooker for Rs. 6000 from w…

    A shopkeeper buys a gas stove and cooker for Rs. 6000 from wholesaler. He sells the gas stove at 20% profit and the cooker at 10% loss. Calculate the selling price of the cooker if he makes an overall profit of 2%?

    • A.

      Rs. 3240

    • B.

      Rs. 3600

    • C.

      Rs. 2400

    • D.

      Rs. 2880

  2. Question 2

    Prince’s monthly income is equal to the cost of 75 kg of whe…

    Prince’s monthly income is equal to the cost of 75 kg of wheat. Cost of 20 kg of wheat is equal to the cost of 45 kg of rice. If cost of 18 kg of rice is Rs.2430, what is the Prince’s annual salary?

    • A.

      Rs. 273375

    • B.

      Rs. 273240

    • C.

      Rs. 165957

    • D.

      None of the mentioned options

28 more questions in the full paper

Coding

  1. Question 1

    Longest Harmonic Pattern

    A harmonic pattern in a string is a pattern where the string starts with 'ab' and repeats itself with one additional alphabet in alphabetical order. The moment this pattern breaks, the string is no longer in harmonic pattern. You are given a string S, and you have to find and return an integer value representing the largest contiguous substring which is in harmonic pattern.

    Input Specification:

    input1: A string value S

    Output Specification:

    Return an integer value representing the largest contiguous substring which is in harmonic pattern.

    Example 1:

    input1: ababcabc

    Output: 5

  2. Question 2

    Extract Action and Device from Command

    You are developing a simple module for a home automation AI system. The system receives:

    1. A string W of valid action words (space-separated).
    2. Exactly one command sentence S which contains:
      • Exactly one action word from the given list
      • Exactly one device word.

    Your task is to find and return a string representing the action word and the device word in the sentence. If the sentence does not contain a valid action or device, return "None".

    Note:

    • The device word is assumed to be the word immediately after the action word, or after the word "the" if "the" appears between the action and device.
    • The sentence may contain other words before or after the action-device pair.

    Input Specification: input1: A string W, representing space-separated action words. input2: A string S, representing a single command sentence.

    Output Specification: Return a string value representing the action word and the device word in the sentence.