System Engineer
400+ System Engineer Interview Questions and Answers for Freshers

Asked in TCS

Q. Election Winner Determination
In an ongoing election between two candidates A and B, there is a queue of voters that includes supporters of A, supporters of B, and neutral voters. Neutral voters have the power ...read more
Determine the winner of an election between two candidates based on the influence of supporters on neutral voters.
Iterate through the string to count the number of supporters for each candidate.
Simulate the movement of supporters of A and B to influence neutral voters.
Compare the total number of supporters for A and B to determine the election winner.
Handle cases where there is a tie by declaring it as a Coalition.

Asked in TCS

Q. Given a parking lot represented as an RxC matrix where each space is either empty (0) or full (1), find the index of the row (R) with the most full parking spaces (1).
Find the row index with the most number of full parking spaces in a given matrix.
Iterate through each row of the matrix and count the number of 1's in each row.
Keep track of the row index with the maximum count of 1's.
Return the index of the row with the maximum count of 1's.

Asked in TCS iON

Q. GCD (Greatest Common Divisor) Problem Statement
You are given two numbers, X
and Y
. Your task is to determine the greatest common divisor of these two numbers.
The Greatest Common Divisor (GCD) of two integers ...read more
The greatest common divisor (GCD) of two numbers is the largest positive integer that divides both numbers without leaving a remainder.
Use Euclidean algorithm to find GCD efficiently
GCD(X, Y) = GCD(Y, X % Y)
Repeat until Y becomes 0, then X is the GCD

Asked in Nvidia

Q. Check Word Presence in String
Given a string S
and a list wordList
containing N
distinct words, determine if each word in wordList
is present in S
. Return a boolean array where the value at index 'i' indicates ...read more
Given a string and a list of words, determine if each word in the list is present in the string and return a boolean array indicating their presence.
Iterate through each word in the word list and check if it is present in the string.
Use a boolean array to store the presence of each word in the string.
Consider case sensitivity when checking for word presence.
Do not use built-in string-matching methods.
Return the boolean array without printing it.

Asked in Infosys

Q. Khaled has an array A of N elements. It is guaranteed that N is even. He wants to choose at most N/2 elements from array A. It is not necessary to choose consecutive elements. Khaled is interested in XOR of all...
read moreChoose at most N/2 elements from an array A of N elements and find XOR of all the chosen elements.
Choose the N/2 largest elements to maximize the XOR value.
Use a priority queue to efficiently select the largest elements.
If N is small, brute force all possible combinations of N/2 elements.

Asked in Amazon

Q. Pair Sum Problem Statement
You are given an integer array 'ARR' of size 'N' and an integer 'S'. Your task is to find and return a list of all pairs of elements where each sum of a pair equals 'S'.
Note:
Each pa...read more
Find pairs of elements in an array that sum up to a given value, sorted in a specific order.
Iterate through the array and for each element, check if the complement (S - current element) exists in a hash set.
If the complement exists, add the pair to the result list.
Sort the result list based on the criteria mentioned in the question.
Return the sorted list of pairs.
System Engineer Jobs




Asked in Microsoft Corporation

Q. Mirror String Problem Statement
Given a string S
containing only uppercase English characters, determine if S
is identical to its reflection in the mirror.
Example:
Input:
S = "AMAMA"
Output:
YES
Explanation:
T...read more
Check if a given string is identical to its mirror reflection.
Iterate through the string and compare characters from start and end simultaneously.
If any characters don't match, return 'NO'.
If all characters match, return 'YES'.

Asked in Samsung

Q. Reverse Linked List Problem Statement
Given a Singly Linked List of integers, your task is to reverse the Linked List by altering the links between the nodes.
Input:
The first line of input is an integer T, rep...read more
Reverse a singly linked list by altering the links between nodes.
Iterate through the linked list and reverse the links between nodes
Use three pointers to keep track of the current, previous, and next nodes
Update the links while traversing the list to reverse it
Return the head of the reversed linked list
Share interview questions and help millions of jobseekers 🌟

Asked in BNY

Q. Cycle Detection in a Singly Linked List
Determine if a given singly linked list of integers forms a cycle or not.
A cycle in a linked list occurs when a node's next
points back to a previous node in the list. T...read more
Detect if a singly linked list forms a cycle by checking if a node's next points back to a previous node.
Use Floyd's Cycle Detection Algorithm to determine if there is a cycle in the linked list.
Maintain two pointers, one moving at twice the speed of the other, if they meet at some point, there is a cycle.
If one of the pointers reaches the end of the list (null), there is no cycle.

Asked in TCS

Q. Twin Pairs Problem Statement
Given an array A
of size N
, find the number of twin pairs in the array. A twin pair is defined as a pair of indices x
and y
such that x < y
and A[y] - A[x] = y - x
.
Input:
The first...read more
The problem involves finding the number of twin pairs in an array based on a specific condition.
Iterate through the array and check for each pair of indices if they form a twin pair based on the given condition
Keep track of the count of twin pairs found
Return the total count of twin pairs for each test case

Asked in Capgemini Engineering

Q. Quick Sort Problem Statement
You are provided with an array of integers. The task is to sort the array in ascending order using the quick sort algorithm.
Quick sort is a divide-and-conquer algorithm. It involve...read more
To achieve NlogN complexity in the worst case, we can implement the randomized version of quicksort algorithm.
Randomly select a pivot element to reduce the chances of worst-case scenarios.
Implement a hybrid sorting algorithm like Introsort which switches to heap sort when the recursion depth exceeds a certain limit.
Use median-of-three partitioning to select a good pivot element for better performance.
Optimize the algorithm by using insertion sort for small subarrays to reduce...read more

Asked in Oyo Rooms

Q. Candies Distribution Problem Statement
Prateek is a kindergarten teacher with a mission to distribute candies to students based on their performance. Each student must get at least one candy, and if two student...read more
The task is to distribute candies to students based on their performance while minimizing the total candies distributed.
Create an array to store the minimum candies required for each student.
Iterate through the students' ratings array to determine the minimum candies needed based on the given criteria.
Consider the ratings of adjacent students to decide the number of candies to distribute.
Calculate the total candies required by summing up the values in the array.
Implement a fu...read more

Asked in Infosys

Q. String Compression Problem Statement
Ninja needs to perform basic string compression. For any character that repeats consecutively more than once, replace the repeated sequence with the character followed by th...read more
Implement a function to compress a string by replacing consecutive characters with the character followed by the count of repetitions.
Iterate through the input string and keep track of consecutive characters and their counts
Replace consecutive characters with the character followed by the count of repetitions if count is greater than 1
Return the compressed string

Asked in Josh Technology Group

Q. 0/1 Knapsack Problem Statement
A thief is planning to rob a store and can carry a maximum weight of 'W' in his knapsack. The store contains 'N' items where the ith item has a weight of 'wi' and a value of 'vi'....read more
Yes, the 0/1 Knapsack Problem can be solved using dynamic programming with a space complexity of not more than O(W).
Use a 1D array to store the maximum value that can be stolen for each weight capacity from 0 to W.
Iterate through each item and update the array based on whether including the item would increase the total value.
The final element of the array will contain the maximum value that can be stolen within the weight capacity of the knapsack.

Asked in SAP

Q. Binary Pattern Problem Statement
Given an input integer N
, your task is to print a binary pattern as follows:
Example:
Input:
N = 4
Output:
1111
000
11
0
Explanation:
The first line contains 'N' 1s. The next line ...read more
Print a binary pattern based on input integer N in a specific format.
Iterate from N to 1 and print N - i + 1 numbers alternatively as 1 or 0 in each line
Handle the test cases by reading the number of test cases first
Follow the given constraints for input and output format

Asked in TCS

Q. Maximum Vehicle Registrations Problem
Bob, the mayor of a state, seeks to determine the maximum number of vehicles that can be uniquely registered. Each vehicle's registration number is structured as follows: S...read more
The task is to determine the maximum number of unique vehicle registrations given the number of districts, letter ranges, and digit ranges.
Parse the input for each test case: number of districts, letter ranges, and digit ranges.
Calculate the total number of unique registrations based on the given constraints.
Output the maximum number of unique vehicle registrations for each test case.
Consider the ranges of alphabets and digits to determine the total combinations possible.
Ensu...read more

Asked in LinkedIn

Q. Generate All Parentheses Combinations
Given an integer N
, your task is to create all possible valid parentheses configurations that are well-formed using N
pairs. A sequence of parentheses is considered well-fo...read more
Generate all valid parentheses combinations for a given number of pairs.
Use backtracking to generate all possible combinations of parentheses.
Keep track of the number of open and close parentheses used.
Add '(' if there are remaining open parentheses, and add ')' if there are remaining close parentheses.
Stop when the length of the generated string is equal to 2*N.

Asked in Intuit

Q. Count Pairs with Given Sum
Given an integer array/list arr
and an integer 'Sum', determine the total number of unique pairs in the array whose elements sum up to the given 'Sum'.
Input:
The first line contains ...read more
Count the total number of unique pairs in an array whose elements sum up to a given value.
Iterate through the array and for each element, check if the complement (Sum - current element) exists in a hash set.
If the complement exists, increment the count of pairs and add the current element to the hash set.
Return the total count of pairs at the end.

Asked in Amazon

Q. Loot Houses Problem Statement
A thief is planning to steal from several houses along a street. Each house has a certain amount of money stashed. However, the thief cannot loot two adjacent houses. Determine the...read more
Determine the maximum amount of money a thief can steal from houses without looting two consecutive houses.
Create an array 'dp' to store the maximum money that can be stolen up to the i-th house.
Iterate through the houses and update 'dp' based on whether the current house is looted or not.
Return the maximum value in 'dp' as the answer.

Asked in Oyo Rooms

Q. Maximum Profit Problem Statement
Ninja has a rod of length 'N' units and wants to earn the maximum money by cutting and selling the rod into pieces. Each possible cut size has a specific cost associated with it...read more
The problem involves maximizing profit by cutting a rod into pieces with different costs associated with each length.
Iterate through all possible cuts and calculate the maximum profit for each length
Use dynamic programming to store and reuse subproblem solutions
Choose the cut that maximizes profit at each step
Return the maximum profit obtained by selling the pieces

Asked in Amazon

Q. Minimum Cost to Connect All Points Problem Statement
Given an array COORDINATES
representing the integer coordinates of some points on a 2D plane, determine the minimum cost required to connect all points. The ...read more
Calculate the minimum cost to connect all points on a 2D plane using Manhattan distance.
Iterate through all pairs of points and calculate Manhattan distance between them
Use a minimum spanning tree algorithm like Kruskal's or Prim's to find the minimum cost
Ensure all points are connected with one simple path only

Asked in TCS

Q. Space Survival Game Challenge
Ninja is in space with unlimited fuel in his super spaceship. He starts with a health level H
and his spaceship has an armour A
. Ninja can be on only one of the three planets at a ...read more
Determine the maximum time Ninja can survive in a space survival game challenge with different planet effects on health and armour.
Create a function that takes initial health and armour as input for each test case
Simulate Ninja's movement between planets and update health and armour accordingly
Keep track of the maximum time Ninja can survive before health or armour reaches 0

Asked in SAP

Q. Remove Duplicates Problem Statement
You are given an array of integers. The task is to remove all duplicate elements and return the array while maintaining the order in which the elements were provided.
Example...read more
Remove duplicates from an array of integers while maintaining the order.
Use a set to keep track of unique elements while iterating through the array.
Add elements to the set if they are not already present.
Convert the set back to an array to maintain order.

Asked in TCS

Q. What is the difference b/w Procedural Programming and OOP Concept? What are the problems with C in this context?
Procedural programming focuses on procedures and functions, while OOP emphasizes objects and classes.
Procedural programming uses a top-down approach, while OOP uses a bottom-up approach.
In procedural programming, data and functions are separate, while in OOP, they are encapsulated within objects.
Procedural programming is more suitable for small-scale programs, while OOP is better for large-scale projects.
C is a procedural programming language, lacking the features of OOP like...read more

Asked in Oracle Cerner

List of 15 Linux commands with their functions
ls - list directory contents
pwd - print working directory
cd - change directory
mkdir - make a new directory
rm - remove files or directories
cp - copy files and directories
mv - move or rename files and directories
grep - search for patterns in files
chmod - change file permissions
ps - display information about running processes
top - display and update sorted information about processes
kill - send signals to processes
tar - create or ext...read more

Asked in TCS

Q. Explain the difference between a constructor and a method, and provide code examples to illustrate the difference.
A constructor is a special method used to initialize an object, while a method is a function that performs a specific task.
Constructors are called automatically when an object is created, while methods need to be called explicitly.
Constructors have the same name as the class, while methods can have any valid name.
Constructors do not have a return type, while methods can have a return type.
Constructors are used to set initial values of instance variables, while methods are use...read more

Asked in Infosys

Q. What are OOP concepts? Tell me about the pillars of Object Oriented Programming.
OOP concepts are the building blocks of Object Oriented Programming. The four pillars of OOP are Abstraction, Encapsulation, Inheritance, and Polymorphism.
Abstraction: Hiding implementation details and showing only necessary information to the user.
Encapsulation: Binding data and functions together to protect data from outside interference.
Inheritance: Creating new classes from existing ones, inheriting properties and methods.
Polymorphism: Ability of objects to take on multip...read more

Asked in Wipro

Q. If you were assigned to a domain different from your preferred one, would you be willing to work on it?
Yes, I am open to working on different domains as it will broaden my knowledge and skills.
I am always eager to learn new things and take on new challenges.
Working on a different domain will give me the opportunity to expand my knowledge and skills.
I am confident that I can adapt quickly and efficiently to a new domain.
Examples: If I have experience in software engineering and I am asked to work on a networking project, I will be willing to learn and work on it.
Examples: If I ...read more

Asked in Infosys

Q. Can you tell me the difference between C and C++?
C is a procedural programming language while C++ is an extension of C with added features of object-oriented programming.
C is a procedural language, while C++ supports both procedural and object-oriented programming.
C++ has additional features like classes, objects, inheritance, and polymorphism.
C++ supports function overloading and exception handling, which are not present in C.
C++ has a standard template library (STL) that provides useful data structures and algorithms.
C++ ...read more

Asked in Salesforce

Early binding is resolved at compile time while late binding is resolved at runtime in C++.
Early binding is also known as static binding, where the function call is resolved at compile time based on the type of the object.
Late binding is also known as dynamic binding, where the function call is resolved at runtime based on the actual type of the object.
Early binding is faster as the function call is directly linked during compilation.
Late binding allows for more flexibility a...read more
Interview Questions of Similar Designations
Interview Experiences of Popular Companies





Top Interview Questions for System Engineer Related Skills



Reviews
Interviews
Salaries
Users

