Media.net Software Services (India)
Thodeti Professional Education and Careers Interview Questions and Answers
Q1. Interleaving Two Strings Problem Statement
You are given three strings 'A', 'B', and 'C'. Determine if 'C' is formed by interleaving 'A' and 'B'.
String 'C' is an interleaving of 'A' and 'B' if the length of 'C...read more
The problem involves determining if a string 'C' is formed by interleaving two given strings 'A' and 'B'.
Check if the length of 'C' is equal to the sum of the lengths of 'A' and 'B'.
Verify if all characters of 'A' and 'B' exist in 'C' while maintaining their order.
Return 'True' if 'C' is an interleaving of 'A' and 'B', otherwise return 'False'.
Q2. Construct Binary Tree from Inorder and Postorder Traversal
Given two lists representing the inorder and postorder traversal of a binary tree of integer type with 'N' nodes, construct the binary tree and return ...read more
Construct a binary tree from inorder and postorder traversal lists and return its root.
Create a map to store the indices of elements in the inorder traversal list for quick access during tree construction.
Use the postorder list to determine the root of the tree and recursively build left and right subtrees.
Construct the tree by recursively dividing the inorder list based on the root index in postorder list.
Return the root of the constructed binary tree.
Example: IN_ORDER = [9,...read more
Q3. Nodes at Distance K from Target Node in Binary Tree
Given a Binary Tree of distinct integers and two integers, target
and K
, return a list of values of all nodes located at a distance K
from the target node.
Ex...read more
Find nodes at distance K from target node in a Binary Tree.
Use BFS to traverse the tree and keep track of the distance of each node from the target node.
Maintain a set to keep track of visited nodes to avoid revisiting them.
Return the values of nodes at distance K from the target node.
Q4. Boxes of Power Problem Statement
Given a set of boxes represented by an array gainPower
, where each box has a certain power value, along with an initial power value 'power', your task is to maximize the total s...read more
Maximize total score by selecting boxes optimally based on power values and operations.
Iterate through the boxes and perform operations based on power values and current score
Keep track of power, score, and selected boxes to maximize total score
Example: For input [3, 50, [20, 30, 40]], select boxes with power 20 and 30 to get a score of 2
Q5. Subarray Challenge: Largest Equal 0s and 1s
Determine the length of the largest subarray within a given array of 0s and 1s, such that the subarray contains an equal number of 0s and 1s.
Input:
Input begins with...read more
Find the length of the largest subarray with equal number of 0s and 1s in a given array.
Iterate through the array and maintain a count of 0s and 1s encountered so far.
Store the count difference in a hashmap with the index as key.
If the same count difference is encountered again, the subarray between the two indices has equal 0s and 1s.
Return the length of the longest subarray found.
To find and correct a bug in code, analyze problem statement, review code, use debugging tools, and test different scenarios.
Understand the problem statement and expected output
Review the code for syntax errors, logical errors, and potential bugs
Use debugging tools like breakpoints, print statements, and IDE debuggers
Test the code with different inputs and edge cases to identify the bug
Make necessary corrections and retest the code to ensure bug is fixed
Interview Process at Thodeti Professional Education and Careers
Top Software Developer Interview Questions from Similar Companies
Reviews
Interviews
Salaries
Users/Month