AlphaSense
Bloom AI Interview Questions and Answers
Q1. Connect Nodes at Same Level Problem Statement
An assignment is to link adjacent nodes at the same level in a binary tree. Each node in a binary tree has at most two children (left and right) and a next pointer ...read more
Connect adjacent nodes at the same level in a binary tree by setting next pointers.
Traverse the tree level by level using a queue.
For each level, connect nodes using the next pointer.
Set the next pointer of the last node in each level to NULL.
Use constant space aside from input constraints.
Example: Input - 1 2 3 4 -1 5 6 -1 7 -1 -1 -1 -1 -1 -1, Output - 1 # 2 3 # 4 5 6 # 7 #
Q2. Loop Detection and Removal in Linked List
In a singly linked list, detect if a loop exists and remove the loop if present. Modify the linked list directly to eliminate any loops before returning it.
Input:
The ...read more
Detect and remove loop in a singly linked list efficiently.
Use Floyd's Cycle Detection Algorithm to detect the loop in the linked list.
Once the loop is detected, use two pointers to find the start of the loop.
Break the loop by setting the next pointer of the last node in the loop to null.
Q3. Median of Two Sorted Arrays
Given two sorted arrays A
and B
of sizes N
and M
, find the median of the merged array formed by combining arrays A
and B
. If the total number of elements, N + M
, is even, the median ...read more
Find the median of two sorted arrays by merging them and calculating the median of the combined array.
Merge the two sorted arrays into one sorted array.
Calculate the median of the merged array based on the total number of elements.
If the total number of elements is even, take the mean of the two middle elements as the median.
Q4. Extracting Leaf Nodes from a Binary Tree
Given a binary tree, develop a solution to retrieve a list of all the leaf nodes in the order they appear from left to right. If two leaf nodes are equidistant from the ...read more
Retrieve leaf nodes from a binary tree in left to right order, prioritizing lesser depth or smaller node data if equidistant from leftmost node.
Traverse the binary tree in level order and keep track of leaf nodes.
Prioritize leaf nodes with lesser depth or smaller node data if equidistant from leftmost node.
Return the list of leaf nodes in the order they appear from left to right.
Key concepts related to virtual memory and potential follow-up questions
Key concepts: paging, segmentation, page tables, TLB, page faults, thrashing
Follow-up questions: How does virtual memory differ from physical memory? What is the role of the operating system in managing virtual memory? How does virtual memory improve system performance?
Example: Explain the concept of page tables and how they are used in virtual memory management
Q6. Create a program who prints last 10 lines from a file and that program will trigeer itself in every one minute
Create a program to print last 10 lines from a file and trigger itself every minute.
Read the file and store the last 10 lines in a data structure like a queue or array
Use a timer to trigger the program every minute
Print the last 10 lines from the data structure
A peer-to-peer connection is a network connection between two or more devices without the need for a central server.
Allows devices to communicate directly with each other
Each device can act as both a client and a server
Commonly used in file sharing applications like BitTorrent
Interview Process at Bloom AI
Top Software Developer Interview Questions from Similar Companies
Reviews
Interviews
Salaries
Users/Month