Optum Global Solutions
30+ L&T Construction Interview Questions and Answers
Q1. Count Pairs Problem Statement
You are given an array A
of length N
consisting only of integers. Additionally, you are provided with three integers X
, Y
and SUM
. Your task is to count the number of pairs (i, j)
...read more
Count the number of pairs in an array that satisfy a given equation.
Iterate through all pairs of indices in the array and check if the equation is satisfied.
Use a hashmap to store the frequency of values that can be used to form pairs.
Optimize the solution by using two pointers approach to find pairs efficiently.
Q2. Delete a Node from a Linked List
You are provided with a linked list of integers. Your task is to implement a function that deletes a node located at a specified position 'POS'.
Input:
The first line contains a...read more
Implement a function to delete a node from a linked list at a specified position.
Traverse the linked list to find the node at the specified position.
Update the pointers of the previous and next nodes to skip the node to be deleted.
Handle edge cases such as deleting the head or tail of the linked list.
Ensure to free the memory of the deleted node to avoid memory leaks.
Q3. Array Intersection Problem Statement
Given two integer arrays/ lists ARR1
and ARR2
of sizes N
and M
respectively, you are required to determine their intersection. An intersection is defined as the set of commo...read more
Find the intersection of two integer arrays/lists in the order they appear in the first array/list.
Iterate through the elements of the first array/list and check if they exist in the second array/list.
Use a hash set to store elements of the first array/list for efficient lookups.
Print the common elements in the order they appear in the first array/list.
Q4. Author and Books Formatting
Given a structured list of books and their authors, format the information as specified.
Input:
The first line of input contains an integer ‘T' representing the number of test cases....read more
The task is to format a list of authors and their books in a specific way as per the given input format.
Parse the input to extract the number of test cases, number of authors, author names, and their respective books.
Format the output by printing the author names and their books in the specified format.
Ensure correct sequence and labeling of authors and books as per the example provided.
Handle multiple test cases and authors with varying numbers of books.
Focus on the structur...read more
Q5. Longest Palindromic Substring Problem Statement
You are provided with a string STR
of length N. The task is to find the longest palindromic substring within STR
. If there are several palindromic substrings of t...read more
Find the longest palindromic substring in a given string.
Iterate through the string and expand around each character to find palindromes
Keep track of the longest palindrome found so far
Return the longest palindromic substring
Q6. Longest Substring Without Repeating Characters Problem Statement
Given a string S
of length L
, determine the length of the longest substring that contains no repeating characters.
Example:
Input:
"abacb"
Output...read more
Find the length of the longest substring without repeating characters in a given string.
Use a sliding window approach to keep track of the longest substring without repeating characters.
Use a hashmap to store the index of each character in the string.
Update the start index of the window when a repeating character is encountered.
Calculate the maximum length of the substring as you iterate through the string.
Return the maximum length of the substring at the end.
Q7. Maximum XOR Problem Statement
You are given an integer X
. Your goal is to find an integer Y
such that the bitwise XOR of X
and Y
yields the maximum possible value. The integer Y
must not exceed 2305843009213693...read more
Find an integer Y such that XOR of X and Y yields maximum value within given constraints.
Iterate through each test case and find the maximum possible Y by flipping all bits of X except the most significant bit.
The maximum value of Y is 2^61 - 1, which is 2305843009213693951.
Ensure that the obtained Y does not exceed the given constraints.
Q8. Minimum Days to Complete Work
You have 'N' tasks to complete. Each task can only be done on one of two specific days provided in two arrays: day1
and day2
.
For each task i, day1[i]
represents the earliest day t...read more
Find the minimum number of days required to complete all tasks given specific completion days for each task.
Sort the tasks based on day1 in ascending order.
For each task, choose the minimum of day1 and day2 as the completion day.
Keep track of the maximum completion day for each task.
The final answer is the maximum completion day of all tasks.
Q9. Graph Coloring Problem
You are given a graph with 'N' vertices numbered from '1' to 'N' and 'M' edges. Your task is to color this graph using two colors, such as blue and red, in a way that no two adjacent vert...read more
Given a graph with 'N' vertices and 'M' edges, determine if it can be colored using two colors without adjacent vertices sharing the same color.
Use graph coloring algorithm like BFS or DFS to check if the graph can be colored with two colors without conflicts.
Check if any adjacent vertices have the same color. If so, it is not possible to color the graph as described.
If the graph has connected components, color each component separately to determine if the entire graph can be...read more
Q10. Kth Largest Element Problem
Given an array containing N
distinct positive integers and a number K
, determine the Kth largest element in the array.
Example:
Input:
N = 6, K = 3, array = [2, 1, 5, 6, 3, 8]
Output...read more
Find the Kth largest element in an array of distinct positive integers.
Sort the array in non-increasing order to easily find the Kth largest element.
Ensure all elements in the array are distinct for accurate results.
Handle multiple test cases efficiently by iterating through each case.
Q11. Bubble Sort Problem Statement
Sort the given unsorted array consisting of N non-negative integers in non-decreasing order using the Bubble Sort algorithm.
Input:
The first line contains an integer 'T' represent...read more
Bubble Sort algorithm is used to sort an array of non-negative integers in non-decreasing order.
Implement the Bubble Sort algorithm to sort the array in place.
Compare adjacent elements and swap them if they are in the wrong order.
Repeat this process until the array is sorted.
Time complexity of Bubble Sort is O(n^2) in the worst case.
Example: For input [6, 2, 8, 4, 10], the output should be [2, 4, 6, 8, 10].
Data abstraction in a DBMS involves hiding complex details from users, allowing them to interact with data at different levels of complexity.
Data abstraction in DBMS involves three levels: Physical level, Logical level, and View level.
Physical level deals with how data is stored on the storage medium, including details like data structures and file formats.
Logical level defines the structure of the database, including tables, relationships, and constraints.
View level provides...read more
ACID properties in DBMS ensure data integrity and consistency.
Atomicity: All operations in a transaction are completed successfully or none are. For example, transferring money from one account to another.
Consistency: Database remains in a consistent state before and after the transaction. For example, maintaining referential integrity.
Isolation: Transactions are executed independently without interference. For example, concurrent transactions should not affect each other.
Dur...read more
Measure 9 minutes using a 4-minute hourglass and a 7-minute hourglass
Start both hourglasses at the same time
When the 4-minute hourglass runs out, flip it immediately
When the 7-minute hourglass runs out, flip it immediately
When the 4-minute hourglass runs out for the second time, 9 minutes have passed
Use SQL query with ORDER BY and LIMIT to find the 5th highest salary.
Use ORDER BY clause to sort salaries in descending order
Use LIMIT 4,1 to skip the first 4 salaries and get the 5th highest salary
Q16. What is the difference between obj open and obj open by handle
obj open vs obj open by handle
obj open opens a file and returns a file object
obj open by handle opens a file using a file descriptor
obj open by handle is faster than obj open
obj open by handle is used when you already have a file descriptor
Q17. How to change the work object status of the multiple cases from pending to closed.
To change work object status of multiple cases from pending to closed.
Identify the cases that need to be closed
Update the status of each case to closed
Save the changes made to the cases
Use a loop to perform the above steps for multiple cases
Example: Use a query to identify all cases with pending status and update their status to closed
Constraints in SQL are rules that are enforced on data columns in a table.
Constraints ensure data integrity by enforcing rules on data columns
Common constraints include NOT NULL, UNIQUE, PRIMARY KEY, FOREIGN KEY, CHECK
Example: NOT NULL constraint ensures a column cannot have NULL values
Q19. What is the one thing you want to expereince?
I want to experience living in a different country and immersing myself in a new culture.
Traveling to a foreign country and learning about their customs and traditions
Trying new foods and experiencing different ways of life
Making friends with locals and exploring the local attractions
Q20. Difference between append to and append to map to
Append to adds an element to a list while append to map adds a key-value pair to a map.
Append to is used for lists while append to map is used for maps.
Append to adds an element to the end of the list while append to map adds a key-value pair to the map.
Append to map can also update the value of an existing key in the map.
Q21. Queue processor and job schedule difference
Queue processor manages tasks in a queue while job scheduler schedules tasks based on time or event triggers.
Queue processor manages tasks in a queue and processes them in a first-in, first-out (FIFO) order.
Job scheduler schedules tasks based on time or event triggers, and can prioritize tasks based on their importance.
Queue processor is typically used for real-time processing of tasks, while job scheduler is used for batch processing.
Examples of queue processors include Rabb...read more
Q22. Why blocked rules are carry forward
Blocked rules are carry forward to ensure consistency and prevent errors in future processing.
Blocked rules are rules that have been prevented from executing due to certain conditions not being met.
These rules are carried forward to ensure that they are not missed in future processing.
This helps to maintain consistency and prevent errors in the system.
For example, if a rule is blocked due to a missing data field, it will be carried forward until the missing field is filled in...read more
Q23. Use of superclass data transform check box
Superclass data transform checkbox is used to inherit data transform rules from a parent class.
When checked, the subclass will inherit the data transform rules from the superclass
This can save time and effort in creating duplicate data transform rules
Example: A superclass has a data transform rule to convert a date format, when the checkbox is checked in a subclass, it will also use the same rule
This checkbox is available in Pega platform for software development
Q24. Difference between relational and non relational dbms
Relational DBMS stores data in tables with predefined relationships, while non-relational DBMS stores data in flexible, schema-less formats.
Relational DBMS uses structured query language (SQL) for querying data
Non-relational DBMS can store data in various formats like key-value pairs, document-based, graph databases
Relational DBMS ensures data integrity through normalization and constraints
Non-relational DBMS offers better scalability and flexibility for handling unstructured...read more
Q25. difference betweeen class,abstract class,interface in python
Class is a blueprint for creating objects, abstract class cannot be instantiated and can have abstract methods, interface is a contract for classes to implement certain methods.
Class is a blueprint for creating objects with attributes and methods.
Abstract class cannot be instantiated and can have abstract methods that must be implemented by subclasses.
Interface is a contract for classes to implement certain methods, but does not provide any implementation.
Q26. What is the use of previliges
Privileges are permissions granted to users or processes to perform specific actions or access certain resources.
Privileges are used to control access to sensitive data or critical system resources.
They can be assigned to individual users or groups.
Examples include read, write, execute, and delete permissions.
Privileges can also be used to restrict access to certain functions or features within an application.
Without proper privileges, users may not be able to perform necessa...read more
Q27. Difference between interface and abstract class
Interface is a contract with no implementation, while abstract class can have some implementation.
Interface cannot have any implementation, only method signatures.
Abstract class can have both abstract methods and concrete methods.
A class can implement multiple interfaces but can only inherit from one abstract class.
Interfaces are used to achieve multiple inheritance in Java.
Example: interface Shape { void draw(); } abstract class Shape { abstract void draw(); }
Q28. what is binary search
Binary search is a search algorithm that finds the position of a target value within a sorted array.
Divide and conquer approach
Compares target value with middle element of array
If target value is smaller, search left half; if larger, search right half
Repeat process until target value is found or subarray is empty
Q29. Find the kth element in an array
Find the kth element in an array
Use array indexing to access the kth element
Remember that array indices start from 0
Handle cases where k is out of bounds of the array
Q30. What are closer in js
Closures in JavaScript are functions that have access to variables from their outer scope even after the outer function has finished executing.
Closures allow for maintaining state in an asynchronous environment.
They are created whenever a function is defined within another function.
Closures can be used to create private variables and functions in JavaScript.
Q31. what is linked list
A linked list is a data structure consisting of nodes where each node contains a data field and a reference to the next node in the sequence.
Linked list elements are not stored in contiguous memory locations like arrays.
Each node in a linked list contains data and a reference to the next node.
Linked lists can be singly linked (each node points to the next node) or doubly linked (each node points to both the next and previous nodes).
Q32. Write a code on debouncing
Debouncing is a technique used to limit the rate at which a function is called.
Use a timer to delay the execution of a function until a certain amount of time has passed without the function being called again.
Reset the timer each time the function is called to prevent it from being executed multiple times in quick succession.
Debouncing is commonly used in scenarios like handling button clicks to prevent multiple rapid clicks from triggering the function multiple times.
Q33. find next max element
Find the next maximum element in an array of strings.
Iterate through the array and keep track of the current maximum element.
Compare each element with the current maximum and update if a larger element is found.
Return the next maximum element after the current maximum.
Q34. Longest Consecutive Sequence
Find the longest consecutive sequence in an array of integers.
Sort the array to make it easier to identify consecutive numbers.
Iterate through the array and keep track of the current consecutive sequence length.
Update the longest consecutive sequence length as you iterate through the array.
Q35. Reverse a string
Reverse a given string
Use a loop to iterate through the characters of the string
Append each character to a new string in reverse order
Return the reversed string
Interview Process at L&T Construction
Top Software Developer Interview Questions from Similar Companies
Reviews
Interviews
Salaries
Users/Month