Menu

Navigation

HomeAll CompaniesPrevious Year QuestionsTNP / PlacementsBEU ResultDocumentation

Companies

InfosysTCSWiproAccentureCognizantCapgemini
R's PlacePrep|
CompaniesPYQDocs

Company

TCS

Content

2025 NQT2024 NQTAptitudeCoding

View Options

Display Mode

Sections

Practice Questions10

Export

PDF

Word

Last updated: Feb 11, 2026

TCS

2024 NQT

Display Mode

Jump to Section

Practice Questions10

Other Content

2025 NQT2024 NQTAptitudeCoding

Export

PDF

Word

Home/Companies/TCS/2024-nqt
Back to TCS

TCS 2024-nqt

1 sections, 10 questions

Practice Questions

10 questions
Question 1

Percentage and Profit & Loss

Problem

A shopkeeper marks his goods 20% above cost price but allows a discount of 10%. What is his profit percentage?

Solution

Let CP = ₹100
Marked Price (MP) = 100 + 20% of 100 = ₹120
Discount = 10% of 120 = ₹12
Selling Price (SP) = 120 - 12 = ₹108
Profit = 108 - 100 = ₹8
Profit % = (8/100) × 100 = 8%

Question 2

Time and Work

Problem

A can complete a work in 12 days, B in 15 days, and C in 20 days. If they work together, in how many days will they complete the work?

Solution

Let total work = LCM of 12, 15, 20 = 60 units

A's efficiency = 60/12 = 5 units/day
B's efficiency = 60/15 = 4 units/day
C's efficiency = 60/20 = 3 units/day

Combined efficiency = 5 + 4 + 3 = 12 units/day
Time taken = 60/12 = 5 days

Question 3

Ratio and Proportion

Problem

The ratio of ages of A and B is 3:5. After 8 years, the ratio becomes 5:7. Find the present age of A.

Solution

Let present ages be 3x and 5x.

After 8 years:

  • A's age: 3x + 8
  • B's age: 5x + 8

Given: (3x + 8)/(5x + 8) = 5/7

Cross-multiply:
7(3x + 8) = 5(5x + 8)
21x + 56 = 25x + 40
4x = 16
x = 4

Present age of A = 3x = 3 × 4 = 12 years

Question 4

Reading Comprehension

Problem

Read the passage and answer: "Artificial Intelligence is transforming industries by automating processes and enabling data-driven decisions. However, concerns about job displacement and ethical implications remain significant." What is the main concern mentioned?

Answer: Job displacement and ethical implications

Explanation: The passage explicitly mentions concerns about job displacement and ethical implications as significant issues related to AI.

Question 5

Grammar - Error Spotting

Problem

Identify the error: "Neither of the students were present in the class."

Error: "were" should be "was"

Correct Sentence: "Neither of the students was present in the class."

Explanation: "Neither" is singular and requires singular verb "was".

Question 6

Syllogism

Problem

Statements: All cats are animals. Some animals are dogs. Conclusions: I. Some cats are dogs. II. All dogs are cats.

Solution

Analyzing the statements:

  • All cats are animals (A → B)
  • Some animals are dogs (B → C, some)

Conclusion I: Some cats are dogs

  • Cannot be concluded. Some animals are dogs, but cats are a subset of animals. We cannot say some cats are dogs. Invalid

Conclusion II: All dogs are cats

  • This cannot be concluded. Invalid
Question 7

Coding-Decoding

Problem

If "CAT" is coded as "3120", "DOG" is coded as "4157", then how is "RAT" coded?

Solution

Pattern analysis:

  • C = 3, A = 1, T = 20 → "3120"
  • D = 4, O = 15, G = 7 → "4157"

Pattern: Position of letter in alphabet

For "RAT":

  • R = 18
  • A = 1
  • T = 20
Question 8

Output Prediction

Problem

What will be the output of the following C code?

#include <stdio.h>

int main() {
    int x = 5;
    printf("%d", x++ + ++x);
    return 0;
}

Solution

x++ is post-increment: uses value 5, then increments to 6
++x is pre-increment: increments 6 to 7, then uses value 7

Result: 5 + 7 = 12

Question 9

Array Manipulation

Problem

Find the second largest element in an array.

Example:

Input: [12, 35, 1, 10, 34, 1]
Output: 34

Solution

Iterate through array maintaining first and second largest elements.

Code

Java
public int findSecondLargest(int[] arr) {
    if (arr.length < 2) return -1;
    
    int largest = Integer.MIN_VALUE;
    int secondLargest = Integer.MIN_VALUE;
    
    for (int num : arr) {
        if (num > largest) {
            secondLargest = largest;
            largest = num;
        } else if (num > secondLargest && num != largest) {
            secondLargest = num;
        }
    }
    
    return secondLargest == Integer.MIN_VALUE ? -1 : secondLargest;
}
Python
def find_second_largest(arr):
    if len(arr) < 2:
        return -1
    
    largest = second_largest = float('-inf')
    
    for num in arr:
        if num > largest:
            second_largest = largest
            largest = num
        elif num > second_largest and num != largest:
            second_largest = num
    
    return -1 if second_largest == float('-inf') else second_largest
Time: O(n)Space: O(1)
Question 10

String Processing

Problem

Reverse words in a string.

Example:

Input: "the sky is blue"
Output: "blue is sky the"

Solution

Split string into words, reverse the order, and join.

Code

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();
}
Python
def reverse_words(s):
    words = s.strip().split()
    return ' '.join(reversed(words))
Time: O(n)Space: O(n)

Last updated: 2026-02-11

Radhika's PlacePrep built by Rohan Sharma