Josh Technology Group
10+ Systems Plus Interview Questions and Answers
You are given ‘N’ binary tree nodes numbered from 0 to N - 1 where node ‘i’ has two children LEFT_CHILD[i] and RIGHT_CODE[i]. Return ‘True’ if and only if all the given nodes form exac...read more
The task is to determine if the given binary tree nodes form exactly one valid binary tree.
Check if there is only one root node (a node with no parent)
Check if each node has at most one parent
Check if there are no cycles in the tree
Check if all nodes are connected and form a single tree
You are given an integer 'H'. Your task is to count and print the maximum number of balanced binary trees possible with height 'H'.
The balanced binary tree is one in which, for every node, ...read more
The maximum number of balanced binary trees possible with a given height is to be counted and printed.
A balanced binary tree is one in which the difference between the left and right subtree heights is less than or equal to 1.
The number of balanced binary trees can be calculated using dynamic programming.
The number of balanced binary trees with height 'H' can be obtained by summing the product of the number of balanced binary trees for each possible left and right subtree hei...read more
You have been given an unsorted array ‘ARR’.
Your task is to sort the array in such a way that the array looks like a wave array.
Example:
If the given sequence ‘ARR’ has ‘N’ elements ...read more
The task is to sort an array in a wave form, where each element is greater than or equal to its adjacent elements.
Iterate through the array and swap adjacent elements if they do not follow the wave pattern
Start from the second element and compare it with the previous element, swap if necessary
Continue this process until the end of the array
Repeat the process for the remaining elements
Return the sorted wave array
You are given a Binary Search Tree (BST) and a target value ‘K’. Your task is to check if there exist two unique elements in the given BST such that their sum is equal to the given target ‘K’.
A...read more
The task is to check if there exist two unique elements in the given BST such that their sum is equal to the given target 'K'.
Traverse the BST in-order and store the elements in a sorted array
Use two pointers, one at the beginning and one at the end of the array
Check if the sum of the elements at the two pointers is equal to the target 'K'
If the sum is less than 'K', move the left pointer to the right
If the sum is greater than 'K', move the right pointer to the left
Repeat the...read more
You are given a Binary Tree ‘root’. The given Binary Tree may or may not be a Binary Search Tree(BST) itself. Your task is to find the maximum sum of node values of any subtree that is a Binary S...read more
The task is to find the maximum sum of node values of any subtree that is a Binary Search Tree(BST).
Traverse the binary tree in a bottom-up manner
For each node, check if it forms a BST and calculate the sum of its subtree
Keep track of the maximum sum encountered so far
Return the maximum sum
You are given an unsorted array containing ‘N’ integers. You need to find ‘K’ largest elements from the given array. Also, you need to return the elements in non-decreasing order.
Input Format...read more
You are given an arbitrary binary tree, a node of the tree, and an integer 'K'. You need to find all such nodes which have a distance K from the given node and return ...read more
The task is to find all nodes in a binary tree that are at a distance K from a given node.
Implement a function that takes the binary tree, target node, and distance K as input.
Use a depth-first search (DFS) algorithm to traverse the tree and find the nodes at distance K.
Keep track of the distance from the current node to the target node while traversing.
When the distance equals K, add the current node to the result list.
Continue the DFS traversal to explore other nodes in the...read more
A thief is robbing a store and can carry a maximal weight of W into his knapsack. There are N items and the ith item weighs wi and is of value vi. Considering the constraints of the maximum weight t...read more
You are given a string ('STR') of length 'N'. Find the longest palindromic substring. If there is more than one palindromic substring with the maximum length, return the one with th...read more
You have been given two Strings “STR1” and “STR2” of characters. Your task is to find the length of the longest common subsequence.
A String ‘a’ is a subsequence of a String ‘b’ if ‘a’...read more
You are given a binary tree with 'N' nodes. Your task is to return the size of the largest subtree of the binary tree which is also a BST.
A binary search tree (BST) is a binar...read more
You are given ‘N’ 2-D matrices and an array/list “ARR” of length ‘N + 1’ where the first ‘N’ integers denote the number of rows in the Matrices and the last element denotes the number...read more
You have been given a Linked List having ‘N’ nodes and an integer ‘K’. You have to rotate the Linked List by ‘K’ positions in a clockwise direction.
Example :
Given Linked List : 1 2 3 4 -1 a...read more
Interview Process at Systems Plus
Top Software Developer Interview Questions from Similar Companies
Reviews
Interviews
Salaries
Users/Month