i
Box8
Filter interviews by
Clear (1)
I applied via Campus Placement and was interviewed in Apr 2024. There was 1 interview round.
3 coding questions, 1.5 hr
Top trending discussions
I applied via Campus Placement
Regex for email validation
Start with a string of characters followed by @ symbol
Followed by a string of characters and a period
End with a string of characters with a length of 2-6 characters
Allow for optional subdomains separated by periods
Disallow special characters except for . and _ in username
Print prime numbers in a given range and optimize the solution.
Use Sieve of Eratosthenes algorithm to generate prime numbers efficiently
Start with a boolean array of size n+1, mark all as true
Loop through the array and mark all multiples of each prime as false
Print all the indexes that are still marked as true
Find angle between hour and minute hand in a clock given the time.
Calculate the angle made by the hour hand with respect to 12 o'clock position
Calculate the angle made by the minute hand with respect to 12 o'clock position
Find the difference between the two angles and take the absolute value
If the angle is greater than 180 degrees, subtract it from 360 degrees to get the smaller angle
To un-hash a string, use a reverse algorithm to convert the hash back to the original string.
Create a reverse algorithm that takes the hash as input and outputs the original string
Use the same logic as the hash function but in reverse order
If the hash function used a specific algorithm, use the inverse of that algorithm to un-hash the string
I was interviewed before Sep 2020.
Round duration - 60 minutes
Round difficulty - Medium
Given an array of integers with 'N' elements, determine the length of the longest subsequence where each element is greater than the previous element. This...
Find the length of the longest strictly increasing subsequence in an array of integers.
Use dynamic programming to keep track of the longest increasing subsequence ending at each element.
Initialize an array to store the length of the longest increasing subsequence ending at each index.
Iterate through the array and update the length of the longest increasing subsequence for each element.
Return the maximum value in the ar...
Ninja has a string of characters from 'A' to 'Z', encoded using their numeric values (A=1, B=2, ..., Z=26). The encoded string is given as a sequence of digits (SEQ). The task is t...
The task is to determine the number of possible ways to decode a sequence of digits back into a string of characters from 'A' to 'Z'.
Use dynamic programming to keep track of the number of ways to decode the sequence at each position.
Consider different cases when decoding the sequence, such as single digit decoding and double digit decoding.
Handle edge cases like '0' and '00' appropriately.
Return the final count modulo
Round duration - 60 minutes
Round difficulty - Medium
Given a binary tree with 'N' nodes, determine if all the leaf nodes are situated at the same level. Return true
if all the leaf nodes are at the same level, otherwis...
Check if all leaf nodes in a binary tree are at the same level.
Traverse the binary tree and keep track of the level of each leaf node.
Compare the levels of all leaf nodes at the end to determine if they are at the same level.
Use a queue for level order traversal of the binary tree.
Given an array of integers, determine the maximum sum of a subsequence without choosing adjacent elements in the original array.
The first line consists of an...
Find the maximum sum of a subsequence without choosing adjacent elements in an array.
Use dynamic programming to keep track of the maximum sum of non-adjacent elements at each index.
At each index, the maximum sum is either the sum of the current element and the element two positions back, or the sum at the previous index.
Iterate through the array and update the maximum sum at each index accordingly.
Return the maximum su
Round duration - 60 minutes
Round difficulty - Medium
Design a data structure for a Least Recently Used (LRU) cache that supports the following operations:
1. get(key)
- Return the value of the key if it exists in the cache; otherw...
Design a Least Recently Used (LRU) cache data structure that supports get and put operations with capacity constraint.
Use a combination of hashmap and doubly linked list to implement the LRU cache.
Keep track of the least recently used item and update it accordingly when inserting new items.
Ensure to handle the capacity constraint by evicting the least recently used item when the cache is full.
Implement get(key) and put...
Mutex is used for exclusive access to a resource by only one thread at a time, while Semaphores can allow multiple threads to access a resource simultaneously.
Mutex is binary and can be locked by only one thread at a time, while Semaphores can have a count greater than one.
Mutex is used for protecting critical sections of code, while Semaphores can be used for controlling access to a pool of resources.
Mutex is simpler ...
Use SQL Joins to find the number of employees in each department.
Use a JOIN statement to combine the employee and department tables based on the department ID.
Group the results by department ID and use COUNT() function to find the number of employees in each department.
Example: SELECT department.department_id, COUNT(employee.employee_id) AS num_employees FROM department JOIN employee ON department.department_id = emplo...
Tip 1 : Work on communicating effectively, give a lot of mock interviews. There is no point studying so hard if your thoughts or solution don't reach the interviewer.
Tip 2 : Practice variety of questions. 50 questions of different topics, patterns are better that 50 questions done for same topic.
Tip 3 : Try to think of solution by different approaches, this will expand your horizon by doing less questions.
Tip 1 : Don't make a fancy resume, keep it simple, you can use Latex templates from overleaf.com.
Tip 2 : Make it short and crisp. Resume should not be more than 1 page. And don't write anything you're not confident about. For experienced people, read the JD first and design your resume accordingly.
I was interviewed before Sep 2020.
Round duration - 90 minutes
Round difficulty - Medium
Coding question of medium level difficulty, from DP.
18 MCQs were core CSE related concepts e.g: OS, OOPs, DBMS, Networking
Time was 90 minutes.
You are given an NxM matrix consisting of '0's and '1's. A '1' signifies that the cell is accessible, whereas a '0' indicates that the cell is blocked. Your task is to compute ...
Find the minimum cost to reach a destination in a matrix with blocked cells.
Use Breadth First Search (BFS) algorithm to explore all possible paths from the starting point to the destination.
Keep track of the cost incurred at each cell and update it as you move through the matrix.
Return the minimum cost to reach the destination or -1 if it is unreachable.
Round duration - 30 minutes
Round difficulty - Medium
It was an one-to-one interview. It checks your problem solving ability and a few OOPs, OS, DBMS etc concepts. Coding questions were related to array, queue and DP.
Given an integer array/list ARR
of length 'N', determine if it is possible to form at least one non-degenerate triangle using the values of the array as the sides o...
Determine if it is possible to form a non-degenerate triangle using array elements as sides.
Check if the sum of any two sides is greater than the third side for all combinations of sides.
If the above condition is met for any combination, return true; otherwise, return false.
You are given an array/list of integers. The task is to return the maximum sum of a subsequence such that no two elements in the subsequence are adjacent in the given ...
Find the maximum sum of non-adjacent elements in an array.
Use dynamic programming to keep track of the maximum sum at each index, considering whether to include the current element or not.
At each index, the maximum sum can be either the sum excluding the current element or the sum including the current element but excluding the previous element.
Iterate through the array and update the maximum sum accordingly.
Example: F...
Round duration - 45 minutes
Round difficulty - Easy
It was also a problem solving round. However after coding questions, they also asked CSE conceptual questions.
Convert a given binary tree into its sum tree. In a sum tree, every node's value is replaced with the sum of its immediate children's values. Leaf nodes are set to 0. Finally, return th...
Convert a binary tree into a sum tree by replacing each node's value with the sum of its children's values. Return preorder traversal.
Traverse the tree in a bottom-up manner, starting from the leaf nodes.
For each node, update its value to the sum of its children's values.
Set leaf nodes to 0.
Return the preorder traversal of the modified tree.
Core concepts of indexing in DBMS include types of indexes, benefits of indexing, and factors affecting index performance.
Types of indexes: B-tree, Hash, Bitmap, etc.
Benefits of indexing: Faster data retrieval, improved query performance, reduced disk I/O.
Factors affecting index performance: Selectivity, clustering factor, index fragmentation.
Examples: Creating an index on a column in a table to speed up search queries
Tip 1 : Strengthen your coding, algorithms. This is one most important thing for OYO. Practice Graph, tree, DP, greedy, recursion, data structures questions.
Tip 2 : OS, DBMS concepts will give you an edge over others. Like serialisation, index, deadlock, semaphore
Tip 3 : Only mention those projects in your resume which you are very clear about. They don't ask for detailed explanation, just an overall idea about your projects will increase your chances
Tip 1 : Mention college projects wisely. No need to mention fancy projects. Any project that you can describe to the interviewer will be a best solution
Tip 2 : Neat & clean resume with your skills, technical stacks that you mastered. That's all. They don't require you to be very active in extra-curricular activities, and these things will not give you any advantage.
Tip 3 : Keep it of single page
posted on 5 Apr 2024
I applied via Recruitment Consulltant and was interviewed before Apr 2023. There were 2 interview rounds.
I was interviewed in Nov 2020.
Round duration - 90 minutes
Round difficulty - Medium
The test was scheduled at 2:30 PM, IST. The test was conducted online, due to the ongoing pandemic situation. Webcam was required to be switched on during the complete duration of the test. I had solved 2/2 coding questions with all test cases successfully passing. Out of the 10 MCQ questions, I had done 6. Around 90 students sat for the online coding round, 19 were shortlisted for the interview. Those who had solved both coding questions were called for interview.
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 s...
The task is to distribute candies to students based on their performance while minimizing the total candies distributed.
Iterate through the array of student ratings to determine the minimum number of candies required.
Assign each student at least one candy.
Adjust the number of candies based on the ratings of adjacent students to minimize the total candies distributed.
Example: For ratings [5, 8, 1, 5, 9, 4], the optimal ...
Ninja Yuki wants to purchase ninja blades at the Spring Fair in his village. Initially, he has 0 blades, and his goal is to buy 'N' blades. The merchant...
Calculate the minimum cost to acquire a specific number of ninja blades using a given pricing mechanism.
Iterate through each test case to determine the minimum cost needed to acquire the desired number of blades.
Consider the cost of adding 1 blade versus doubling the current number of blades to reach the target quantity.
Keep track of the total cost as blades are acquired based on the pricing mechanism.
Return the minimu
Round duration - 60 minutes
Round difficulty - Medium
This was a pure DSA based round. Two questions were asked in this round. The interviewer was quite good, and helped in between.
Given a string A
consisting of lowercase English letters, determine the first non-repeating character at each point in the stream of characters.
Given a string of lowercase English letters, find the first non-repeating character at each point in the stream.
Iterate through the characters in the string and maintain a count of each character.
Use a queue to keep track of the order of characters encountered.
For each character, check if it is the first non-repeating character by looking at its count in the map.
If a character's count is 1, it is the first non-repeatin...
Given a 2-dimensional boolean matrix mat
of size N x M, your task is to modify the matrix such that if any element is 1, set its entire row and column to 1. Specifi...
Modify a boolean matrix such that if any element is 1, set its entire row and column to 1 in-place.
Iterate through the matrix to find elements with value 1.
Use additional arrays to keep track of rows and columns to be modified.
Update the matrix in-place based on the identified rows and columns.
Round duration - 75 minutes
Round difficulty - Medium
This round was also again focused on DSA. Two interviewers were present. This round was very extensive and everything was asked in depth as well as they asked to write the codes as well for all the questions. I was also asked to explain my projects, they were based on ML. Many aspects of OOPs, POP, memory allocation was asked as well.
Given an array ARR
of size N
, determine the maximum sum of i * ARR[i]
possible through any number of rotations. Both left and right rotations are allowed, and can...
Find maximum sum of i * ARR[i] possible through any number of rotations in an array.
Calculate the sum of i * ARR[i] for each rotation and find the maximum sum.
Consider both left and right rotations.
Optimize the solution to avoid redundant calculations.
Handle edge cases like empty array or single element array.
Given an arbitrary binary tree consisting of 'N' nodes numbered from 1 to 'N'. Each node is associated with a positive integer value. Your task is to ca...
Calculate the average of node values at each level in a binary tree.
Traverse the binary tree level by level using BFS
Calculate the sum of node values at each level and divide by the number of nodes at that level
Print the floor value of the average for each level
Tip 1 : Primary skill to be developed is problem solving, i.e proficient in data structures and algorithms.
Tip 2 : After this, practice competitive programming, start giving contests, this will make you faster.
Tip 3 : Then take any technology, e.g., machine learning, web development etc., make few but good projects using these technologies.
Tip 1 : Make it short, 1-2 pages max. Only mention those projects that you know the best.
Tip 2 : While mentioning projects, do mention numbers in them, like what was the accuracy(in case of ML projects).
I was interviewed before Sep 2020.
Round duration - 90 minutes
Round difficulty - Medium
You are given a matrix MAT
of size 'N' * 'M', where 'N' is the number of rows and 'M' is the number of columns, along with a positive integer 'K'. Your task is to rotate the ma...
Rotate a matrix to the right 'K' times by shifting each column to the right 'K' times.
Iterate 'K' times to perform right rotation on the matrix
Shift each column to the right by one position in each rotation
Handle wrapping around the matrix when shifting columns
Return the matrix elements row-wise after 'K' rotations
Given a two-dimensional grid of size N x M
consisting of upper case characters and a string 'WORD', determine how many times the 'WORD' appears in the grid.
The 'WORD' can b...
Count how many times a given word appears in a 2D grid by moving in any of the eight possible directions.
Iterate through each cell in the grid and check if the word can be formed starting from that cell in any of the eight directions.
Use recursion to explore all possible paths from a starting cell to form the word.
Keep track of visited cells to avoid revisiting the same cell in the same path.
Return the count of how man
Round duration - 75 minutes
Round difficulty - Medium
Interview started with an introduction and walk through the resume for first 5 minutes. After that, interview asked few coding questions.
You are provided with a non-empty grid consisting of only 0s and 1s. Your task is to determine the maximum area of an island within the given grid.
An island consists of a...
Find the maximum area of an island in a grid of 0s and 1s.
Iterate through the grid and perform depth-first search (DFS) to find connected 1s.
Keep track of the area of each island found and return the maximum area.
Consider all four directions (horizontal, vertical, and diagonal) while exploring the island.
Handle edge cases like grid boundaries and already visited cells during DFS.
If no island is present, return 0 as the
Determine if there exists a Pythagorean triplet within a given array of integers. A Pythagorean triplet consists of three numbers, x, y, and z, such that x^2 + y^2 = z^2.
Check if there exists a Pythagorean triplet in a given array of integers.
Iterate through all possible triplets 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.
Given a Binary Tree of integers, you are tasked with finding the top view of the binary tree. The top view is the set of nodes visible when the tree is viewed fro...
Find the top view of a Binary Tree by returning a list of visible nodes when viewed from the top.
Traverse the Binary Tree in level order and keep track of the horizontal distance of each node from the root.
Use a map to store the nodes at each horizontal distance, and only keep the topmost node for each horizontal distance.
Return the values of the topmost nodes in the map as the top view of the Binary Tree.
Round duration - 90 minutes
Round difficulty - Medium
This round was focused on DSA along with short discussion on computer science fundamentals. For coding problems, I was asked to code the first problem only. For others, had to discuss the approach only. For computer science fundamentals, discussion on OOPS. Differences between process and threads were discussed.
Given a Binary Search Tree (BST) where two nodes have been swapped by mistake, your task is to restore or fix the BST without changing its structure.
The first...
Restore a Binary Search Tree by fixing two swapped nodes without changing its structure.
Identify the two nodes that are swapped by mistake in the BST.
Swap the values of the two identified nodes to restore the BST.
Perform an in-order traversal of the BST to verify the correct restoration.
Ensure no extra space other than the recursion stack is used for the solution.
Your task is to implement a Stack data structure using a Singly Linked List.
Create a class named Stack
which supports the following operations, each in O(1...
Implement a Stack data structure using a Singly Linked List with operations like getSize, isEmpty, push, pop, and getTop in O(1) time.
Create a class named Stack with methods for getSize, isEmpty, push, pop, and getTop.
Use a Singly Linked List to store the elements of the stack.
Ensure that each operation runs in constant time O(1).
Handle edge cases like empty stack appropriately.
Test the implementation with sample queri
Tip 1 : Focus on DSA as you will be judged mostly on that for entry-level software engineer profiles.
Tip 2 : Don't mug up the solution as you might not be able to recall the approach or you might face new question that you haven't seen earlier.
Tip 3 : Practice as much as possible from platforms like InterviewBit, LeetCode.
Tip 1 : Try not to mention those things about which you are not comfortable.
Tip 2 : Having one or two good projects in resume helps.
Tip 3 : Mention good competitive programming ranks (if any)
Tip 4 : Use overleaf.com for making a resume using Latex.
I was interviewed in Jan 2021.
Round duration - 90 minutes
Round difficulty - Hard
Timing was 11 am. Platform was quite well.
You need to determine all possible paths for a rat starting at position (0, 0) in a square maze to reach its destination at (N-1, N-1). The maze is represented as an N*N ma...
Find all possible paths for a rat in a maze from source to destination.
Use backtracking to explore all possible paths in the maze.
Keep track of visited cells to avoid revisiting them.
Recursively try moving in all directions (up, down, left, right) until reaching the destination.
Add the path to the result list when the destination is reached.
Sort the result list alphabetically before returning.
You are given an NxM matrix consisting of '0's and '1's. A '1' signifies that the cell is accessible, whereas a '0' indicates that the cell is blocked. Your task is to compute ...
Find the minimum cost to reach a destination in a matrix with specified rules.
Use BFS traversal to explore all possible paths from the starting point to the destination.
Keep track of the cost incurred at each cell and update it accordingly.
Return the minimum cost to reach the destination or -1 if unreachable.
Tip 1 : Practice data structure based questions.
Tip 2 : OOPS is very important.
Tip 3 : Prepare OS and DBMS for mcq.:
Tip 1 : Have some projects on resume.
Tip 2 : Keep it short.
Use merge sort algorithm to sort the array in O(nlogn) time complexity.
Implement merge sort algorithm which divides the array into two halves, recursively sorts the halves, and then merges the sorted halves.
Time complexity of merge sort is O(nlogn) where n is the number of elements in the array.
Example: ['apple', 'banana', 'cherry', 'date'] can be sorted using merge sort in O(nlogn) time complexity.
Use binary search to find element in sorted array efficiently.
Start with middle element and compare with target
If target is less, search left half, if greater search right half
Repeat until element is found or search space is empty
based on 1 interview
Interview experience
Operations Manager
134
salaries
| ₹0 L/yr - ₹0 L/yr |
Store Manager
72
salaries
| ₹0 L/yr - ₹0 L/yr |
Senior Operations Manager
53
salaries
| ₹0 L/yr - ₹0 L/yr |
Junior Operations Manager
27
salaries
| ₹0 L/yr - ₹0 L/yr |
Business Analyst
22
salaries
| ₹0 L/yr - ₹0 L/yr |
Faasos Food Services
InnerChef
EAT.
Swiggy