System Engineer
1500+ System Engineer Interview Questions and Answers

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 Nagarro

Q. Count Ways to Reach the N-th Stair Problem Statement
You are provided with a number of stairs, and initially, you are located at the 0th stair. You need to reach the Nth stair, and you can climb one or two step...read more
The problem involves determining the number of distinct ways to climb from the 0th to the Nth stair by climbing one or two steps at a time.
Use dynamic programming to solve this problem efficiently.
Define a recursive function to calculate the number of ways to reach each stair based on the number of ways to reach the previous two stairs.
Consider base cases for 0th and 1st stair.
Keep track of the number of ways modulo 10^9+7 to avoid overflow issues.
System Engineer Interview Questions and Answers for Freshers

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 Amazon

Q. Maximum Subarray Sum Problem Statement
Given an array arr
of length N
consisting of integers, find the sum of the subarray (including empty subarray) with the maximum sum among all subarrays.
Explanation:
A sub...read more
Find the sum of the subarray with the maximum sum among all subarrays in an array of integers.
Iterate through the array and keep track of the maximum sum subarray encountered so far.
Use Kadane's algorithm to efficiently find the maximum subarray sum.
Consider the sum of an empty subarray as 0.

Asked in Infosys

Q. Distinct Strings With Odd and Even Swapping Allowed Problem Statement
You are provided with an array of strings, and your objective is to determine the number of unique strings within it.
A string is deemed uni...read more
Count the number of unique strings in an array by allowing swapping of characters at odd and even indices.
Iterate through each string in the array and check if it can be transformed into another string by swapping characters at odd and even indices.
Keep track of unique strings using a set data structure.
Return the size of the set as the number of unique strings.
System Engineer Jobs




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.
Share interview questions and help millions of jobseekers 🌟

Asked in Amazon

Q. Valid Parenthesis Problem Statement
Given a string str
composed solely of the characters "{", "}", "(", ")", "[", and "]", determine whether the parentheses are balanced.
Input:
The first line contains an integ...read more
The task is to determine if the given string of parentheses is balanced or not.
Use a stack to keep track of opening parentheses
When encountering a closing parenthesis, check if it matches the top of the stack
If the stack is empty or the parentheses do not match, the string is not balanced
Return 'YES' if all parentheses are balanced, 'NO' otherwise

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.

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 Accenture

Q. What are the OOPS concepts?
OOPs concepts are the fundamental principles of Object-Oriented Programming.
Encapsulation: Binding data and functions together in a single unit.
Inheritance: Acquiring properties and behavior of a parent class by a child class.
Polymorphism: Ability of an object to take many forms.
Abstraction: Hiding the implementation details and showing only the necessary information.
Example: A car is an object that encapsulates data like speed, fuel, and functions like start, stop, and accel...read more

Asked in TCS

Q. 1. Explain about ur tech stacks? 2. What is Class loader? 3. What is Auto Configuration? 4. What is an object? 5. How to handle exceptions in spring? 6. Intermediate vs terminal operation? 7. Get vs Load 8. Wha...
read moreSystem Engineer interview questions covering tech stacks, Java, Spring, Hibernate, REST, and API security.
Tech stacks include Java, Spring, Hibernate, REST, and API security.
Class loader loads classes into JVM at runtime.
Auto Configuration automatically configures Spring beans based on classpath and other conditions.
An object is an instance of a class that has state and behavior.
Exceptions in Spring can be handled using try-catch blocks or using @ExceptionHandler annotation.
I...read more

Asked in Urban Company

Q. Print All Subsets Challenge
Given an array arr
containing 'N' distinct integers, your task is to generate all possible non-empty subsets of this array.
Note: While the elements within each subset should be in i...read more
Generate all possible non-empty subsets of an array of distinct integers.
Use recursion to generate subsets by including or excluding each element in the array.
Maintain a current subset and add it to the result when reaching the end of the array.
Ensure elements within each subset are in increasing order.
Handle the input and output format as specified in the question.
Consider edge cases like empty array or array with only one element.

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

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 Infosys

Q. Trie Implementation Task
Create a Trie data structure supporting two operations: inserting words and checking their presence. A Trie organizes data like a tree structure, where each node stores letters of words...read more
Implement a Trie data structure supporting insertion and search operations for words.
Create a TrieNode class with a dictionary to store children nodes.
Implement insert(word) by iterating through each character of the word and creating nodes if necessary.
Implement search(word) by traversing the Trie and checking for the presence of the word.
Use a boolean flag in TrieNode to mark the end of a word.
Handle Type 1 and Type 2 queries accordingly in the main program.

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 Symphony Talent

Q. Merge Sort Linked List Problem Statement
You are given a singly linked list of integers. Your task is to sort the linked list using the merge sort algorithm.
Explanation:
Merge Sort is a divide and conquer algo...read more
Implement the merge sort algorithm to sort a singly linked list of integers.
Divide the linked list into two halves recursively
Merge the sorted halves using the merge() function
Implement the merge() function to merge two sorted subarrays
Ensure the constraints are met for input elements
Return the sorted linked list for each test case

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 Microsoft Corporation

Q. Group Anagrams Problem Statement
Given an array or list of strings called inputStr
, your task is to return the strings grouped as anagrams. Each group should contain strings that are anagrams of one another.
An...read more
Group anagrams in a list of strings and return them as separate groups.
Iterate through the list of strings and sort each string to find anagrams.
Use a hashmap to group anagrams together based on their sorted versions.
Return the grouped anagrams as separate lists of strings.

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 Amazon

Q. Number of Islands Problem Statement
Given a non-empty grid of 0s and 1s, determine the number of distinct islands. An island is a collection of '1's (land) connected horizontally, vertically, or diagonally. It ...read more
The task is to determine the number of distinct islands in a grid of 0s and 1s connected horizontally, vertically, or diagonally.
Iterate through the grid and for each '1' encountered, perform a depth-first search to mark all connected '1's as visited.
Use a set to store the unique shapes of islands encountered during the traversal.
Return the size of the set as the total number of distinct islands in the grid.

Asked in Infosys

Integrity rules in a DBMS ensure data accuracy, consistency, and reliability.
Constraints like primary key, foreign key, unique key enforce data integrity
Referential integrity ensures relationships between tables are maintained
Entity integrity ensures each row has a unique identifier
Domain integrity enforces valid data types and values
Check constraints validate data before insertion or update

Asked in Infosys

INNER JOIN returns only the matching rows between two tables, while OUTER JOIN returns all rows from one table and matching rows from the other.
INNER JOIN is used to retrieve rows from both tables that have matching values based on a specified condition.
OUTER JOIN is used to retrieve all rows from one table and only matching rows from the other table.
Types of OUTER JOIN include LEFT JOIN, RIGHT JOIN, and FULL JOIN.
Example: INNER JOIN would return a list of students who have r...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.
Interview Questions of Similar Designations
Interview Experiences of Popular Companies





Top Interview Questions for System Engineer Related Skills



Reviews
Interviews
Salaries
Users

