DE Shaw
60+ Rupeeseed Technology Ventures Interview Questions and Answers
Q1. Tower Building Problem Statement
Given an array 'ARR' of 'N' cubes, you need to construct towers such that each cube can either be placed on top of an existing tower or start a new one. The restriction is that ...read more
The task is to determine the minimum number of towers needed to stack cubes in a specific order.
Iterate through the array of cubes and maintain a stack to keep track of towers.
For each cube, check if it can be placed on an existing tower or start a new one.
Update the stack based on the cube's size and count the number of towers needed.
Return the minimum number of towers required.
Example: For input N = 3, ARR = [3, 2, 1], the output should be 1.
Q2. Rabbit Jumping Problem
Consider 'n' carrots numbered from 1 to 'n' and 'k' rabbits. Each rabbit jumps to carrots only at multiples of its respective jumping factor Aj (i.e., Aj, 2Aj, 3Aj, ...), for all rabbits ...read more
Calculate uneaten carrots by rabbits with specific jumping factors.
Iterate through each carrot and check if any rabbit jumps on it.
Use the jumping factors to determine which carrots will be eaten.
Subtract the eaten carrots from the total to get the uneaten carrots.
Q3. Coin Game Problem Statement
Wong wants to borrow money from Dr. Strange, who insists Wong must win a coin game first. The game involves two players taking turns to remove one coin from either end of a row of co...read more
Given an array of coin values, determine the maximum value Wong can obtain by playing a coin game against Dr. Strange.
Wong plays first and can remove one coin from either end of the array on each turn.
The game ends when no coins are left, and the player with the highest total value wins.
Consider different scenarios like having an odd or even number of coins in the array.
Q4. Money Saving in Bank Problem
Harshit wants to save up money for his first car by depositing money daily in the Ninja bank with a specific increment strategy.
Starting with 1 rupee on the first Monday, the amoun...read more
Calculate the total money accumulated by Harshit in Ninja bank after N days with a specific increment strategy.
Start with 1 rupee on the first Monday and increase by 1 rupee each day from Tuesday to Sunday.
Each new Monday starts with an additional rupee more than the previous Monday's deposit.
Calculate the total amount of money accumulated after N days for each test case.
Example: For N = 2, total amount is 3 rupees; for N = 5, total amount is 15 rupees.
Q5. K Most Frequent Elements Problem Statement
Given an integer array ARR
and an integer K
, identify the K
most frequent elements within ARR
. Return these elements sorted in ascending order.
Example:
Input:
ARR = [...read more
Identify K most frequent elements in an array and return them sorted in ascending order.
Use a hashmap to store the frequency of each element in the array.
Sort the elements based on their frequency in descending order.
Return the first K elements from the sorted list.
Q6. Stock Investment Problem Statement
You are given the prices of a particular stock over 'N' consecutive days. Your task is to find the maximum profit that can be obtained by completing at most two transactions. ...read more
Find the maximum profit that can be obtained by completing at most two transactions of buying and selling a stock.
Iterate through the array of stock prices and calculate the maximum profit that can be obtained by completing at most two transactions.
Keep track of the maximum profit that can be obtained by selling the stock on each day after buying it on a previous day.
Consider all possible combinations of two transactions to find the maximum profit.
Return the maximum profit fo...read more
Q7. Minimum Removals Problem Statement
Given an array ARR
of size N
and an integer K
, determine the minimum number of elements that must be removed from the array so that the difference between the maximum and mini...read more
The problem involves finding the minimum number of elements to remove from an array so that the difference between the maximum and minimum element is less than or equal to a given value.
Iterate through the array and keep track of the minimum and maximum elements.
Calculate the difference between the maximum and minimum elements.
If the difference is greater than the given value, increment the count of elements to remove.
Return the count of elements to remove as the result.
Q8. Conquering the Best Kingdom Problem Statement
Aragorn, an influential ruler, aspires to expand his power by conquering more kingdoms. There are 'N' kingdoms numbered from 0 to N-1, forming a tree structure. The...read more
Given a tree structure of kingdoms, determine if it's possible to conquer more kingdoms than Aragorn by strategically choosing the starting kingdom.
Start at the kingdom adjacent to Aragorn's initial kingdom
Choose the kingdom that allows you to capture the most number of kingdoms in subsequent turns
Consider the tree structure to plan your conquest strategically
Q9. Minimum Number of Taps to Water the Garden
Given a garden that extends along a one-dimensional x-axis from point 0 to point N, your task is to determine the minimum number of taps needed to water the entire gar...read more
Find the minimum number of taps needed to water the entire garden using given tap ranges.
Iterate over taps and update the farthest point each tap can reach.
Use a greedy approach to select the tap that can water the farthest point.
If a tap can't water any point, return -1.
Example: For ranges = [3, 4, 1, 1, 0, 0], tap at position 1 can water the entire garden.
Q10. Find Magic Index in Sorted Array
Given a sorted array A consisting of N integers, your task is to find the magic index in the given array, where the magic index is defined as an index i such that A[i] = i.
Exam...read more
Find the magic index in a sorted array where A[i] = i.
Use binary search to efficiently find the magic index in the sorted array.
Check the middle element of the array and compare it with its index to determine the direction to search.
Repeat the process on the left or right half of the array until the magic index is found or no more elements to search.
Q11. MegaPrime Numbers Problem Statement
Given two integers Left
and Right
, determine the count of 'megaprime' numbers within the inclusive range from 'Left' to 'Right'. A 'megaprime' number is a prime number where ...read more
Q12. K Max Sum Combinations Problem Statement
Given two arrays/lists A
and B
, each of size N
, and an integer K
, you need to determine the K
maximum and valid sum combinations from all possible combinations of sums g...read more
The problem involves finding the K maximum sum combinations from two arrays by adding one element from each array.
Iterate through all possible sum combinations of elements from arrays A and B.
Store the sums in a max heap to keep track of the K maximum sums.
Pop the top K elements from the max heap to get the K maximum sum combinations.
Q13. What is the difference between default and copy constructor?
Default constructor is provided by the compiler if no constructor is defined. Copy constructor creates a new object by copying an existing object.
Default constructor initializes member variables to default values.
Copy constructor creates a new object with the same values as an existing object.
Default constructor is called automatically by the compiler if no constructor is defined.
Copy constructor is called when an object is passed by value or when a new object is initialized ...read more
Q14. What is the difference between primary key and unique key?
Primary key uniquely identifies a record in a table, while unique key ensures that all values in a column are distinct.
Primary key can't have null values, while unique key can have one null value.
A table can have only one primary key, but multiple unique keys.
Primary key is used as a foreign key in other tables, while unique key is not.
Example: Primary key - employee ID, Unique key - email address.
Q15. What is the difference between Truncate and Delete?
Truncate removes all data from a table while Delete removes specific data from a table.
Truncate is faster than Delete as it doesn't log individual row deletions.
Truncate resets the identity of the table while Delete doesn't.
Truncate can't be rolled back while Delete can be.
Truncate doesn't fire triggers while Delete does.
Q16. Majority Element - II Problem Statement
You are given an array ARR
of integers of length N
. Your task is to find all the elements that occur strictly more than floor(N/3)
times in the given array.
Input:
The fi...read more
Q17. Water Equalization Problem Statement
You are provided with an array ARR
of positive integers. Each integer represents the number of liters of water in a bucket. The goal is to make the liters of water in every ...read more
Given an array of water buckets, find the minimum liters of water to remove to make all buckets equal.
Iterate through the array to find the maximum frequency of a water amount
Calculate the total liters to be removed by subtracting the maximum frequency from the total number of buckets
Return the total liters to be removed as the answer
Q18. What is the difference between C and C++?
C++ is an extension of C with object-oriented programming features.
C++ supports classes and objects while C does not.
C++ has better support for polymorphism and inheritance.
C++ has a standard template library (STL) which C does not have.
C++ allows function overloading while C does not.
C++ has exception handling while C does not.
Q19. Bottom View of Binary Tree
Given a binary tree, determine and return its bottom view when viewed from left to right. Assume that each child of a node is positioned at a 45-degree angle from its parent.
Nodes in...read more
Q20. Jump Game Problem Statement
In this problem, you are given an array ARR
consisting of N
integers. Your task is to determine the minimum number of jumps required to reach the last index of the array N - 1
. At an...read more
Q21. Alien Dictionary Problem Statement
You are provided with a sorted dictionary (by lexical order) in an alien language. Your task is to determine the character order of the alien language from this dictionary. Th...read more
Q22. What is the difference between DML and DLL?
DML is Data Manipulation Language used to manipulate data in a database. DLL is Data Definition Language used to define database schema.
DML is used to insert, update, delete data in a database.
DLL is used to create, alter, drop database objects like tables, views, indexes.
DML statements include INSERT, UPDATE, DELETE.
DLL statements include CREATE, ALTER, DROP.
DML affects data in a database, DLL affects the structure of a database.
Q23. What is the difference between DBMS and RDBMs?
DBMS is a software system to manage databases while RDBMS is a type of DBMS that uses a relational model.
DBMS stands for Database Management System while RDBMS stands for Relational Database Management System.
DBMS can manage any type of database while RDBMS uses a relational model to manage data.
DBMS does not enforce any specific data model while RDBMS enforces a relational data model.
Examples of DBMS include MongoDB, Cassandra, and Redis while examples of RDBMS include MySQL...read more
Q24. Chocolate Distribution Problem
You are given an array/list CHOCOLATES
of size 'N', where each element represents the number of chocolates in a packet. Your task is to distribute these chocolates among 'M' stude...read more
Q25. Minimum Fountains Activation Problem
In this problem, you have a one-dimensional garden of length 'N'. Each position from 0 to 'N' has a fountain that can provide water to the garden up to a certain range. Thus...read more
Find the minimum number of fountains to activate to water the entire garden.
Iterate through the array to find the coverage of each fountain.
Keep track of the farthest coverage reached by each activated fountain.
Activate the fountain that covers the farthest distance not yet covered.
Repeat until the entire garden is watered.
Q26. Is Binary Heap Tree Problem Statement
You are given a binary tree of integers. Your task is to determine if it is a binary heap tree or not.
Input:
The first line of input contains an integer ‘T’ denoting the n...read more
Q27. Delete a Node from a Linked List
You are provided with a linked list of integers. Your task is to implement a function that deletes a node located at a specified position 'POS'.
Input:
The first line contains a...read more
Implement a function to delete a node from a linked list at a specified position.
Traverse the linked list to find the node at the specified position.
Update the pointers of the previous and next nodes to skip the node to be deleted.
Handle cases where the position is at the beginning or end of the linked list.
Ensure to free the memory of the deleted node to avoid memory leaks.
Q28. Check if Binary Search Tree (BST)
Given a binary tree with 'N' nodes, verify whether this tree is a Binary Search Tree (BST). Return true if it is a BST and false otherwise.
Definition:
A Binary Search Tree (BS...read more
Verify if a given binary tree is a Binary Search Tree (BST) or not.
Check if the left subtree of a node contains only nodes with values less than the node's value.
Check if the right subtree of a node contains only nodes with values greater than the node's value.
Ensure that both the left and right subtrees are also binary search trees.
Return true if the tree is a BST, false otherwise.
Handle cases with duplicate elements in either subtree.
Q29. Reverse Linked List Problem Statement
Given a singly linked list of integers, return the head of the reversed linked list.
Example:
Initial linked list: 1 -> 2 -> 3 -> 4 -> NULL
Reversed linked list: 4 -> 3 -> 2...read more
Reverse a singly linked list of integers and return the head of the reversed linked list.
Iterate through the linked list and reverse the pointers to point to the previous node instead of the next node.
Use three pointers to keep track of the current, previous, and next nodes while reversing the linked list.
Update the head of the reversed linked list as the last node encountered during the reversal process.
Q30. What is the purpose of Normalisation?
Normalisation is the process of organizing data in a database to reduce redundancy and improve data integrity.
Normalisation helps to eliminate data redundancy and inconsistencies
It ensures that each piece of data is stored in only one place
It helps to improve data integrity and accuracy
It makes it easier to maintain and update the database
There are different levels of normalisation, each with its own set of rules and guidelines
Q31. Ways to Arrange Balls Problem
You are given 'a' balls of type 'A', 'b' balls of type 'B', and 'c' balls of type 'C'. Determine the total number of ways to arrange these balls in a straight line so that no two a...read more
The problem involves arranging balls of different types in a straight line without having two adjacent balls of the same type.
Use recursion to try all possible arrangements while keeping track of the previous ball type.
Handle edge cases where one or more types of balls have a count of 0.
Consider using dynamic programming to optimize the solution by storing intermediate results.
For the given example input (2 1 1), the output is 6 as there are 6 valid arrangements.
For the input...read more
Q32. Ways To Make Coin Change
Given an infinite supply of coins of varying denominations, determine the total number of ways to make change for a specified value using these coins. If it's not possible to make the c...read more
The task is to find the total number of ways to make change for a specified value using given denominations.
Use dynamic programming to solve this problem efficiently.
Create a 2D array to store the number of ways to make change for each value up to the specified value.
Iterate through each denomination and update the array accordingly.
The final answer will be stored in the last cell of the array.
Example: For N=3, D=[1, 2, 3], V=4, the output is 4 as explained in the example.
Q33. Longest Common Subsequence of Three Strings
Given three strings A, B, and C, the task is to determine the length of the longest common subsequence across these three strings.
Explanation:
A subsequence of a str...read more
Find the length of the longest common subsequence among three strings.
Use dynamic programming to solve this problem efficiently.
Create a 3D array to store the lengths of common subsequences.
Iterate through the strings to fill the array and find the longest common subsequence length.
Q34. Best Time To Buy and Sell Stock Problem Statement
You are given an array 'PRICES' of 'N' integers, where 'PRICES[i]' represents the price of a certain stock on the i-th day. An integer 'K' is also provided, ind...read more
The task is to determine the maximum profit achievable with at most K transactions by buying and selling stocks.
Iterate through the array and keep track of the minimum price to buy and maximum profit for each transaction.
Use dynamic programming to store the maximum profit at each day with each possible number of transactions.
Consider edge cases like when K is 0 or when the array is empty.
Example: For input N = 6, PRICES = [3, 2, 6, 5, 0, 3], K = 2, the output would be 7.
Q35. Find the Lone Set Bit
Your task is to identify the position of the only '1' bit in the binary representation of a given non-negative integer N
. The representation contains exactly one '1' and the rest are '0's....read more
Find the position of the only '1' bit in the binary representation of a given non-negative integer.
Iterate through the bits of the integer to find the position of the lone '1' bit.
Use bitwise operations to check if there is exactly one '1' bit in the binary representation.
Return the position of the lone '1' bit or -1 if there isn't exactly one '1'.
Q36. Pythagorean Triplets Detection
Determine if an array contains a Pythagorean triplet by checking whether there are three integers x, y, and z such that x2 + y2 = z2 within the array.
Input:
The first line contai...read more
Detect if an array contains a Pythagorean triplet by checking if x^2 + y^2 = z^2.
Iterate through all possible triplets of numbers in the array and check if they form a Pythagorean triplet.
Use a nested loop to generate all possible combinations of three numbers from the array.
Check if the sum of squares of two numbers is equal to the square of the third number.
Q37. Longest Increasing Subsequence Problem Statement
Given 'N' students standing in a row with specific heights, your task is to find the length of the longest strictly increasing subsequence of their heights, ensu...read more
Find the length of the longest strictly increasing subsequence of heights of students in a row.
Iterate through the heights array and for each student, find the length of the longest increasing subsequence ending at that student.
Use dynamic programming to keep track of the longest increasing subsequence length for each student.
Return the maximum length found in the dynamic programming array as the result.
Example: For heights [10, 20, 10, 30, 40], the longest increasing subsequ...read more
Q38. First Negative Integer in Every Window of Size K
Given an array of integers 'ARR' and an integer 'K', determine the first negative integer in every contiguous subarray (or window) of size 'K'. If a window does ...read more
Find the first negative integer in every window of size K in an array.
Iterate through the array using a sliding window approach of size K
For each window, find the first negative integer and add it to the result array
If no negative integer is found in a window, add 0 to the result array
Q39. 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 adjacent ratings.
Consider both left-to-right and right-to-left passes to ensure fair distribution.
Calculate the total candies required by summing up the values in the array.
Example: For rating...read more
Q40. Validate Binary Search Tree (BST)
You are given a binary tree with 'N' integer nodes. Your task is to determine whether this binary tree is a Binary Search Tree (BST).
BST Definition:
A Binary Search Tree (BST)...read more
Validate if a given binary tree is a Binary Search Tree (BST) or not.
Check if the left subtree of a node contains only nodes with data less than the node's data
Check if the right subtree of a node contains only nodes with data greater than the node's data
Recursively check if both left and right subtrees are also binary search trees
Q41. Validate BST Problem Statement
Given a binary tree with N
nodes, determine whether the tree is a Binary Search Tree (BST). If it is a BST, return true
; otherwise, return false
.
A binary search tree (BST) is a b...read more
Validate if a binary tree is a Binary Search Tree (BST) or not.
Check if the left subtree of a node contains only nodes with data less than the node's data.
Check if the right subtree of a node contains only nodes with data greater than the node's data.
Ensure that both the left and right subtrees are also binary search trees.
Traverse the tree in an inorder manner and check if the elements are in sorted order.
Use recursion to validate each node and its subtrees.
Q42. Find the Missing Number in an Arithmetic Progression
You are given a sorted array consisting of ‘N’ distinct integers, forming a nearly complete Arithmetic Progression, except for one missing element. Your task...read more
Q43. Find the Duplicate Number Problem Statement
Given an integer array 'ARR' of size 'N' containing numbers from 0 to (N - 2). Each number appears at least once, and there is one number that appears twice. Your tas...read more
Find the duplicate number in an array of integers from 0 to (N-2).
Iterate through the array and keep track of the count of each number using a hashmap.
Return the number with a count greater than 1 as the duplicate number.
Alternatively, use Floyd's Tortoise and Hare algorithm to find the duplicate number in O(N) time and O(1) space.
Q44. 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 counting the number of distinct ways to climb N stairs by taking 1 or 2 steps at a time.
Use dynamic programming to solve the problem efficiently.
The number of ways to reach the Nth stair is the sum of the number of ways to reach the (N-1)th stair and the (N-2)th stair.
Handle base cases where N=0 and N=1 separately.
Consider using modulo operation to avoid overflow when dealing with large numbers.
Q45. What are class access modifiers?
Class access modifiers are keywords used to control the visibility and accessibility of class members.
There are four access modifiers in Java: public, private, protected, and default
Public members can be accessed from anywhere
Private members can only be accessed within the same class
Protected members can be accessed within the same class, subclasses, and same package
Default members can be accessed within the same package
Q46. Candy Distribution Problem Statement
Prateek, a kindergarten teacher, needs to distribute candies to his class. Each child has a performance grade, and all students stand in a line.
The rules for distributing c...read more
Calculate the minimum number of candies needed to distribute to students based on their performance grades.
Create an array to store the minimum candies needed for each student.
Iterate through the students' ratings from left to right, comparing each student with the previous one to determine the candy count.
Iterate through the students' ratings from right to left, comparing each student with the next one to ensure the correct candy count.
Sum up the total candies needed for all...read more
Q47. Time to Burn Tree Problem
You are given a binary tree consisting of 'N' unique nodes and a start node where the burning will commence. The task is to calculate the time in minutes required to completely burn th...read more
Calculate the time in minutes required to completely burn a binary tree starting from a given node.
Start burning from the given node and spread fire to adjacent nodes each minute
Track the time taken for each node to burn and return the maximum time taken
Use a queue to keep track of nodes to be burned next
Q48. Binary Ones Count Problem
Develop a program to determine the number of '1's in the binary form of a given integer.
Input:
The input consists of a single line containing an integer N.
Output:
The output should b...read more
Count the number of '1's in the binary form of a given integer.
Convert the given integer to binary representation
Count the number of '1's in the binary representation
Return the count of '1's as output
Q49. Equalize Water in Buckets
You are provided with an array, ARR
, of positive integers. Each integer represents the number of liters of water in a bucket. The goal is to make the water volume in each bucket equal ...read more
Find the minimum amount of water to be removed to equalize water in buckets.
Iterate through the array to find the average water level.
Calculate the total amount of water that needs to be removed to equalize the buckets.
Keep track of the excess water in each bucket and sum them up to get the final result.
Q50. What are access specifiers?
Access specifiers are keywords in object-oriented programming languages that determine the visibility and accessibility of class members.
Access specifiers are used to restrict access to class members.
There are three types of access specifiers: public, private, and protected.
Public members can be accessed from anywhere in the program.
Private members can only be accessed within the class.
Protected members can be accessed within the class and its subclasses.
Example: class MyClas...read more
Q51. What is library functions?
Library functions are pre-written code that can be reused to perform common tasks.
Library functions save time and effort by providing pre-written code.
They are often included in programming languages or external libraries.
Examples include functions for string manipulation, mathematical calculations, and file input/output.
Library functions can be called from within a program to perform specific tasks.
They can also be customized or extended to fit specific needs.
Q52. What is Recursion Function?
Recursion function is a function that calls itself until a base condition is met.
Recursion is a technique used to solve problems by breaking them down into smaller sub-problems.
It involves a function calling itself with a modified input until a base case is reached.
Recursion can be used to solve problems such as factorial, Fibonacci series, and binary search.
Recursion can be implemented using loops as well, but it may not always be efficient.
Recursion can lead to stack overfl...read more
Q53. What is serialization?
Serialization is the process of converting an object into a format that can be stored or transmitted.
Serialization is used to save the state of an object and recreate it later.
It is commonly used in network communication to transmit data between different systems.
Examples of serialization formats include JSON, XML, and binary formats like Protocol Buffers.
Deserialization is the opposite process of converting serialized data back into an object.
Use one wire to measure 30 minutes, then ignite the other wire at one end and the middle point to measure 15 minutes.
Ignite one wire at both ends and the other wire at one end. The first wire will burn out in 30 minutes.
At the same time, ignite the second wire at one end and the middle point. It will take 15 minutes for the fire to reach the middle point from one end.
When the first wire burns out, ignite the other end of the second wire. It will take another 15 minutes for th...read more
Q55. What is inheritance?
Inheritance is a mechanism in object-oriented programming where a new class is created by inheriting properties of an existing class.
Inheritance allows code reusability and saves time and effort in programming.
The existing class is called the superclass or parent class, and the new class is called the subclass or child class.
The subclass inherits all the properties and methods of the superclass and can also add its own unique properties and methods.
For example, a class 'Anima...read more
Q56. What is a stack?
A stack is a data structure that follows the Last-In-First-Out (LIFO) principle.
Elements are added to the top of the stack and removed from the top.
Common operations include push (add element) and pop (remove element).
Stacks can be implemented using arrays or linked lists.
Examples include the call stack in programming and the undo/redo feature in text editors.
Q57. What is an Assembly?
Assembly is a low-level programming language that is used to write programs that can directly interact with computer hardware.
Assembly language is specific to a particular computer architecture.
It is a low-level language that is difficult to read and write.
Assembly language programs are faster and more efficient than programs written in high-level languages.
Examples of assembly language include x86, ARM, and MIPS.
Assembly language is often used for system-level programming, d...read more
Q58. Design a class which has director, HOD, Professor and students. They all are reporting to their respective heads. I have to display the hierarchy structure of the information in a Site
Design a class hierarchy for director, HOD, Professor and students reporting to their respective heads.
Create a base class for all employees with common attributes and methods
Create derived classes for director, HOD, Professor and students
Implement reporting hierarchy using pointers or references
Display hierarchy structure on the site using a tree or graph
Consider adding additional attributes and methods as needed
Q59. OOP Java Design problems
Answering OOP Java design problems
Identify the problem domain and create a class hierarchy
Use encapsulation to hide implementation details
Apply inheritance to reuse code and create subtypes
Implement polymorphism to allow objects to take on multiple forms
Avoid tight coupling and favor composition over inheritance
Use design patterns to solve common problems
Consider SOLID principles for maintainable code
Q60. OOP concepts in Java
OOP concepts in Java
Encapsulation - hiding implementation details
Inheritance - creating new classes from existing ones
Polymorphism - ability of objects to take on multiple forms
Abstraction - focusing on essential features and ignoring the rest
Example: A Car class can inherit from a Vehicle class
Example: A Dog class can have a bark() method that overrides the Animal class's makeSound() method
Example: A Shape class can have an abstract method called calculateArea()
Example: A Ba...read more
Q61. Various sections of memory stack, heap, data. Explain them using a code
Explanation of memory sections: stack, heap, data
Stack: stores function calls and local variables
Heap: dynamically allocated memory
Data: global and static variables
Example: int x; //data, int *y = new int; //heap, void foo() { int z; } //stack
Q62. Find the endianess of a machine using a function
A function to determine the endianess of a machine
Create a variable with value 1
Cast the variable to a byte array
If the first byte is 1, the machine is little endian, else big endian
Q63. Profit on sale of asset impact on financial statements
Q64. Thrashing and why it occurs
Thrashing occurs when a computer's performance suffers due to excessive swapping of data between RAM and virtual memory.
Thrashing happens when the system is overburdened with too many processes and there is not enough physical memory to handle them.
The operating system starts swapping data between RAM and virtual memory, which slows down the system.
This can lead to a vicious cycle where the system spends more time swapping than executing processes, causing further slowdowns.
T...read more
Q65. Median of two sorted arrays
Finding median of two sorted arrays
Merge the two arrays and find the median
Use binary search to find the median in O(log(min(m,n))) time
Divide both arrays into two parts and compare the medians to discard half of the elements
Q66. Creating a pointer array
To create a pointer array of strings:
Declare a pointer array variable with the desired size
Allocate memory for each string in the array using malloc
Assign the memory address of each string to the corresponding array element
Q67. Code for Reverse BST
Code to reverse a binary search tree (BST)
Traverse the BST in post-order
Swap the left and right child of each node
Return the root node of the reversed BST
Q68. 2 dsa with sql
Combining data structures and algorithms with SQL for efficient data manipulation and retrieval.
Use data structures like arrays, linked lists, trees, graphs for efficient storage and retrieval of data in memory.
Implement algorithms like sorting, searching, and graph traversal to manipulate data effectively.
Leverage SQL queries to interact with databases and perform operations like filtering, sorting, and joining data.
Combine data structures and algorithms with SQL to optimize...read more
More about working at DE Shaw
Top HR Questions asked in Rupeeseed Technology Ventures
Interview Process at Rupeeseed Technology Ventures
Top Interview Questions from Similar Companies
Reviews
Interviews
Salaries
Users/Month