InfyTQ Questions & Solutions | Detailed Explanations

InfyTQ Questions & Solutions | Detailed Explanations

InfyTQ Questions & Solutions | Detailed Explanations

InfyTQ is an online certification and recruitment exam conducted by Infosys for engineering students. It assesses candidates on programming, database management, and aptitude skills. This article covers commonly asked InfyTQ questions along with detailed solutions and explanations.


InfyTQ Exam Pattern

The InfyTQ exam consists of the following sections:

  1. Hands-on Coding Questions (Languages: Python, Java)
  2. Database Management System (DBMS) Questions
  3. Aptitude & Logical Reasoning Questions
  4. Verbal Ability Questions

1. InfyTQ Coding Questions with Solutions

Question 1: Find the Second Largest Number in an Array

Problem Statement: Write a program to find the second largest number in an array without sorting.

Solution in Python:

def second_largest(arr):
    first, second = float('-inf'), 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 "No second largest element"

arr = [10, 20, 4, 45, 99]
print("Second Largest Number:", second_largest(arr))

Explanation:

  • The program initializes two variables (first and second) to store the largest and second-largest numbers.
  • It iterates through the array to find the second largest without sorting.
  • Time Complexity: O(n)

2. InfyTQ DBMS Questions

Question: What is the difference between Primary Key and Unique Key?

FeaturePrimary KeyUnique Key
UniquenessEnsures unique valuesEnsures unique values
NULL ValuesNot AllowedAllowed
Number of KeysOnly one per tableMultiple unique keys allowed
UsageUsed to uniquely identify a recordUsed for uniqueness but not as an identifier

Example:

CREATE TABLE Students (
    StudentID INT PRIMARY KEY,
    Email VARCHAR(50) UNIQUE,
    Name VARCHAR(50)
);

3. InfyTQ Aptitude Questions

Question: Time & Work

Problem Statement: A and B together can complete a task in 10 days. A alone can complete the work in 15 days. In how many days can B alone complete the work?

Solution:

  • Work done by A in 1 day = 1/15
  • Work done by A & B in 1 day = 1/10
  • Work done by B in 1 day = (1/10 – 1/15) = 1/30
  • Therefore, B alone can complete the work in 30 days

4. InfyTQ Verbal Ability Questions

Question: Sentence Correction

Identify the incorrect part of the sentence:

“Each of the boys in the class are responsible for keeping their desk clean.”

Answer: “are” should be replaced with “is”

Corrected Sentence: “Each of the boys in the class is responsible for keeping their desk clean.”

Explanation:

  • “Each” is a singular subject, so it requires a singular verb (is instead of are).

Final Thoughts

Practicing InfyTQ questions on programming, DBMS, aptitude, and verbal ability can significantly improve your chances of success. Keep practicing coding problems, SQL queries, and aptitude questions to strengthen your preparation.


Recommended Articles:

  • Infosys Coding Questions & Solutions
  • SQL Queries for Placement Exams
  • Logical Reasoning Questions with Answers

For more such InfyTQ questions and solutions, stay tuned!