Zenon
Optimal Virtual Employee Interview Questions and Answers
Q1. Infinite stream of numbers, store 10 maximum number. (Heap)
Use a max heap to store the 10 maximum numbers from an infinite stream of numbers.
Implement a max heap data structure to keep track of the 10 maximum numbers.
As new numbers come in from the infinite stream, compare them with the root of the heap.
If the new number is greater than the root, replace the root with the new number and heapify.
Keep the heap size limited to 10 to store only the 10 maximum numbers.
Q2. How pandas groupby works internally?
Pandas groupby function in Python is used to split data into groups based on some criteria and then apply a function to each group.
Groupby function splits the data into groups based on the specified criteria
It then applies a function to each group separately
The result is a new object with the function applied to each group
Q3. Difference between Linear and tree models
Linear models assume a linear relationship between variables, while tree models use a hierarchical structure of decisions.
Linear models assume a linear relationship between input variables and output, while tree models can capture non-linear relationships.
Linear models are simpler and easier to interpret, while tree models can handle complex interactions between variables.
Linear models are prone to overfitting with high-dimensional data, while tree models can handle high-dime...read more
Q4. Save bst to disk
To save a binary search tree (BST) to disk, you can serialize the tree and write it to a file.
Serialize the BST using pre-order, in-order, or post-order traversal
Write the serialized data to a file on disk
When reading the data back, deserialize it to reconstruct the BST
Q5. Buid a binary tree
A binary tree is a data structure where each node has at most two children.
Start by creating a Node class with left and right child pointers.
Implement methods to insert nodes, search for a specific value, and traverse the tree (inorder, preorder, postorder).
Consider edge cases like inserting duplicate values or handling empty trees.
Q6. write sql query
Write a SQL query
Understand the requirements of the query
Identify the tables and columns needed
Use appropriate joins and conditions
Test the query before executing
Q7. write java 8 code
Write Java 8 code to demonstrate array manipulation
Use Stream API for array manipulation
Use lambda expressions for concise code
Use method references for cleaner code
Interview Process at Optimal Virtual Employee
Top Interview Questions from Similar Companies
Reviews
Interviews
Salaries
Users/Month