Home Get Hired L&T Infotech Coding Questions & Answers with Tips for Freshers 2025

Table of content:

L&T Infotech Coding Questions & Answers with Tips for Freshers 2025

The L&T Infotech Coding Test is a critical step for aspiring candidates aiming to secure a position in one of the leading IT services companies. Whether you're a fresher looking to kickstart your career or an experienced professional preparing for a lateral entry, mastering the coding test can significantly enhance your chances of success. 

This article offers an in-depth guide to L&T Infotech's coding test format, sample questions, preparation tips, and insights to help you excel.

L&T Infotech Coding Test Overview

The L&T Infotech coding test is designed to assess candidates' problem-solving abilities and coding proficiency. It typically evaluates programming skills, algorithmic thinking, and logical reasoning.

Feature

Details

Test Duration

60–90 minutes

Number of Questions

2–3 coding problems

Difficulty Level

Moderate to Advanced

Programming Languages

C, C++, Java, Python, etc.

Topics Covered

Data Structures, Algorithms, Strings, Arrays, etc.

Key Topics for the Coding Test

  1. Data Structures and Algorithms
    • Arrays
    • Linked Lists
    • Stacks and Queues
    • Binary Trees and Binary Search Trees
  2. String Manipulations
    • Pattern Matching
    • Anagram Detection
    • Palindrome Verification
  3. Dynamic Programming
    • Knapsack Problems
    • Longest Common Subsequence
    • Coin Change Problems
  4. Mathematical and Logical Problems
    • Prime Number Checks
    • Fibonacci Series
    • Modular Arithmetic
  5. Database Queries (Optional)
    • Basic SQL Queries
    • Joins and Subqueries

Top 5 Sample Q&A for L&T Infotech Coding Test 

Problem Statement 1

In a computer class, students are represented as nodes in a binary search tree (BST), with each student having a unique roll number. Given two nodes, x and y, in this BST, the task is to find their Lowest Common Ancestor (LCA). The LCA is the lowest node in the tree, and it has both x and y as descendants.

Input Format

The first line of the input contains an integer n denoting the number of nodes in the binary search tree.

The second line contains n space-separated integers denoting nodes of the binary search tree. Nodes are in the form of level order traversal of binary search trees.

Third line contains two space-separated integers that is x and y.

Output Format

Print an integer which is the lowest common ancestor (LCA) of nodes x and y.

Solution C++
Solution Java
Solution Python 

Problem Statement 2

Ram had an array of integers. He wants to know whether he can make an arithmetic progression using this sequence or not.

Note: You have to include all elements. Numbers present in the array are unsorted.

Help Ram in finding whether he can make an arithmetic progression using sequence or not.

Return true if he can make a sequence using this; otherwise, it is false.

Input Format

The first line contains the size of the array,i.e. n.

Second line n space-separated integers.

Output Format

true or false.

Solution C++
Solution Java
Solution Python 

Problem Statement 3

You are given a sequence of N tiles, each of which is either Red or Green. You are also provided with an integer K, which indicates the number of consecutive Red tiles you need. In each operation, you can paint one tile Red, using one box of paint per tile.

Your task is to determine the minimum number of paint boxes required to achieve at least K consecutive Red tiles in the given sequence.

Input Format

The first line contains two space-separated integers: N represents the total number of tiles, and K represents the number of consecutive Red tiles required.

The second line contains a string of length N where each character is either 'R' or 'G'.

Output Format

Print a single integer representing the minimum number of paint boxes needed.

Solution C++
Solution Java
Solution Python

Problem Statement 4

Ram gave Shyaam a challenge; he gave Shyaam the head of a linked list and an integer K. He asked Shyaam to swap the values of the Kth node from the beginning and the Kth node from the end (the list is 1-indexed).

Note: The number of nodes in the list is N.

Input Format

The first line contains an integer N, representing the number of nodes in the linked list.

The second line contains N space-separated integers, each representing the value of a node in the linked list.

The third line contains an integer K, indicating the positions of the nodes to be swapped.

Output Format

Output the linked list after swapping the values of the two specified nodes.

Solution C++
Solution Java
Solution Python 

Problem Statement 5

You are given a string S. You have to sort the string so that the character with the greatest number of repetitions comes first. If there are multiple characters with a same number of repetitions, sort them in lexicographically.

Input Format

The first line contains String S.

Output Format

You have to print the string after sorting.

Solution C++
Solution Java
Solution Python

Preparation Tips for L&T Infotech Coding Test

  • Understand the Fundamentals: Strong basics in data structures and algorithms are essential.
  • Mock Tests: Take timed mock tests to simulate the actual test environment.
  • Focus on Efficiency: Optimize your solutions for time and space complexity.
  • Learn from Mistakes: Analyze and improve upon incorrect solutions during practice sessions.

Are you looking for coding assessment questions related to job placement? Click here to access coding practice sessions from moderate to challenging levels.

How to Approach the Coding Test?

  1. Read Questions Carefully: Understand the problem statement before diving into coding.
  2. Plan Your Solution: Draft a clear algorithm or pseudocode.
  3. Write Clean Code: Use meaningful variable names and add comments where necessary.
  4. Test Your Code: Check edge cases and validate your outputs.
  5. Optimise If Time Permits: Refactor your code for better efficiency.

Conclusion

The L&T Infotech coding test is your gateway to joining one of the most esteemed IT firms. With structured preparation, consistent practice, and a strong understanding of the basics, you can ace this challenge. Start your preparation today and move closer to achieving your career goals!

Frequently Asked Questions (FAQs)

1. What is the duration of the L&T Infotech coding test?

The test typically lasts between 60 to 90 minutes.

2. Which programming languages are allowed in the test?

You can use languages such as C, C++, Java, Python, etc.

3. Are there negative marks for incorrect answers?

Generally, there is no negative marking but confirmed during the test instructions.

4. How can freshers prepare effectively for the test?

Focus on practising coding problems, understanding algorithms, and taking mock tests.

5. Is the coding test the same for all roles?

The difficulty level and question type may vary depending on the role and job profile.

Disclaimer: While we strive for accuracy, we do not guarantee its completeness or reliability. Readers are encouraged to verify all facts and statistics from the official company website or check independently before making decisions.

Suggested reads: 

Kaihrii Thomas
Associate Content Writer

Instinctively, I fall for nature, music, humour, reading, writing, listening, travelling, observing, learning, unlearning, friendship, exercise, etc., all these from the cradle to the grave- that's ME! It's my irrefutable belief in the uniqueness of all. I'll vehemently defend your right to be your best while I expect the same from you!

TAGS
Placement
Updated On: 10 Dec'24, 03:10 PM IST