Bounteous x Accolite
20+ Women Hope Foundation Interview Questions and Answers
Q1. Maximum Subarray Problem Statement
Ninja has been given an array, and he wants to find a subarray such that the sum of all elements in the subarray is maximum.
A subarray 'A' is considered greater than a subarr...read more
Q2. Rotting Oranges Problem Statement
You are given a grid containing oranges where each cell of the grid can contain one of the three integer values:
- 0 - representing an empty cell
- 1 - representing a fresh orange...read more
Q3. Intersection of Linked List Problem
You are provided with two singly linked lists containing integers, where both lists converge at some node belonging to a third linked list.
Your task is to determine the data...read more
Q4. Left View of a Binary Tree Problem Statement
Given a binary tree, your task is to print the left view of the tree.
Example:
Input:
The input will be in level order form, with node values separated by a space. U...read more
Q5. 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
Q6. Minimum Time To Solve The Problems
Given 'N' subjects, each containing a certain number of problems, and 'K' friends, assign subjects to friends such that each subject goes to exactly one friend, maintaining co...read more
Q7. Merge K Sorted Arrays Problem Statement
You are provided with 'K' different arrays/lists, each sorted in ascending order. Your task is to merge all these arrays/lists into one sorted array/list in ascending ord...read more
Q8. Reverse Words in a String: Problem Statement
You are given a string of length N
. Your task is to reverse the string word by word. The input may contain multiple spaces between words and may have leading or trai...read more
Q9. Majority Element Problem Statement
Given an array/list 'ARR' consisting of 'N' integers, your task is to find the majority element in the array. If there is no majority element present, return -1.
Example:
Inpu...read more
Q10. Maximum Path Sum Between Two Leaves Problem Description
You are provided with a non-empty binary tree in which each node contains a non-negative integer value. Your task is to find and return the maximum possib...read more
Q11. Sum Root to Leaf Numbers
You are given an arbitrary binary tree consisting of N nodes, each associated with an integer value from 1 to 9. Each root-to-leaf path can be considered a number formed by concatenatin...read more
Q12. N-th Node From The End Problem Statement
You are given a Singly Linked List of integers. The task is to find the N-th node from the end of the list.
Example:
Input:
If the given list is (1 -> -2 -> 0 -> 4) and ...read more
Q13. LCA of Binary Tree Problem Statement
You are given a binary tree consisting of distinct integers and two nodes, X
and Y
. Your task is to find and return the Lowest Common Ancestor (LCA) of these two nodes.
The ...read more
Q14. Topological Sort Problem Statement
Given a Directed Acyclic Graph (DAG) consisting of V
vertices and E
edges, your task is to find any topological sorting of this DAG. You need to return an array of size V
repr...read more
Q17. 1. Write a code to split an array of integers into two subarray where both the array has equal sum.
Code to split an array of integers into two subarrays with equal sum.
Iterate through the array and calculate the total sum.
Divide the sum by 2 to get the target sum for each subarray.
Use dynamic programming to find a subset of the array that adds up to the target sum.
Return the two subarrays.
Example: [1, 2, 3, 4, 5, 6] -> [1, 2, 3, 6], [4, 5]
Example: [1, 2, 3, 4, 5] -> [1, 4, 5], [2, 3]
Q19. To write code to build up a binary tree from scratch (implement a BST) and then to write all the methods like all the tree traversal algo, and all other stuffs.
Implementing a binary search tree and its traversal methods.
Start by defining a Node class with left and right child pointers.
Implement insert() method to add nodes to the tree.
Implement inorder(), preorder(), and postorder() traversal methods.
Implement search() method to find a node in the tree.
Implement delete() method to remove a node from the tree.
Consider edge cases like empty tree, duplicate nodes, etc.
Q21. 2. find unique character in a window of k size in a string
Find unique characters in a window of k size in a string.
Use a sliding window approach.
Maintain a hash table to keep track of character frequency.
Remove characters from hash table as the window slides.
Q22. 1. If you given a no return its corresponding excel no.
Convert given no to corresponding excel no.
Excel no starts from 1 and goes up to 16384
Excel no is calculated using column and row numbers
For example, 1 corresponds to A, 27 corresponds to AA, 28 corresponds to AB, and so on
Q23. How to find the Second highest salary from employees table. Write the logic for pre-order, inorder and post-order traversal of a binary tree
To find the second highest salary from employees table and traverse a binary tree in pre-order, in-order, and post-order.
To find the second highest salary, you can use a subquery or window function like ROW_NUMBER() or DENSE_RANK().
For pre-order traversal, visit the root node first, then recursively do a pre-order traversal of the left subtree, followed by the right subtree.
For in-order traversal, recursively do an in-order traversal of the left subtree, visit the root node, ...read more
Q24. Tell me about spring boot
Spring Boot is a framework that simplifies the development of Java applications by providing pre-configured settings and tools.
Spring Boot eliminates the need for manual configuration by providing defaults for most settings.
It allows developers to create stand-alone, production-grade Spring-based Applications.
Spring Boot includes an embedded Tomcat, Jetty, or Undertow server, making it easy to deploy web applications.
It provides a range of features such as auto-configuration,...read more
Interview Process at Women Hope Foundation
Top Software Developer Interview Questions from Similar Companies
Reviews
Interviews
Salaries
Users/Month