i
Eternal
Limited
Work with us
Filter interviews by
SQL query to find the X percentile of students
Use the NTILE() function to divide students into X groups
Calculate the total number of students and the number of students in each group
Select the students from the group that corresponds to the X percentile
Given a binary tree of integers, convert the binary tree into a sum tree where each node's value is replaced by the sum of the values of its left and right subtrees in t...
Convert a binary tree into a sum tree where each node's value is replaced by the sum of its left and right subtrees.
Traverse the tree in postorder fashion to calculate the sum of left and right subtrees for each node.
Set leaf nodes to zero.
Update the node values with the sum of left and right subtrees.
Given an array of integers ARR
of length N
and an integer Target
, your task is to return all pairs of elements such that they add up to the Target
.
The first line c...
Given an array of integers and a target, find all pairs of elements that add up to the target.
Iterate through the array and for each element, check if the complement (target - current element) exists in a hash set.
If the complement exists, add the pair to the result. If not, add the current element to the hash set.
Handle cases where the same element is used twice in a pair by keeping track of the frequency of elem...
Polymorphism is the ability of a function or method to behave differently based on the object it is called on.
Polymorphism allows objects of different classes to be treated as objects of a common superclass.
Real-time polymorphism is achieved through method overloading, where multiple methods have the same name but different parameters.
Run-time polymorphism is achieved through method overriding, where a subclass pr...
Design and implement a Least Frequently Used (LFU) Cache with the following functionalities:
1. put(U__ID, value): Insert the value in the cache if the key ('U__ID') is not alread...
Design and implement a Least Frequently Used (LFU) Cache with put and get functionalities, handling capacity and frequency of use.
Implement a LFU cache with put and get functions
Handle capacity and frequency of use for eviction
Return the value of key if present, -1 otherwise
Consider multiple elements with least frequency, remove least recently used
Example: Insert, update, and retrieve values based on operations
Given a Snake and Ladder Board with 'N' rows and 'N' columns filled with numbers from 1 to N*N starting from the bottom left of the board, and alternating direction each ...
Find the minimum number of dice throws required to reach the last cell on a Snake and Ladder board.
Use Breadth First Search (BFS) algorithm to find the shortest path on the board.
Create a mapping of each cell to its next possible moves based on dice outcomes.
Consider the snakes and ladders on the board while calculating the next possible moves.
Track the number of dice throws needed to reach each cell and update it...
You are given a Doubly Linked List with 'N' positive integers. Your task is to delete a node at a given position 'POS' in this linked list.
The first line of input s...
Implement a function to delete a node at a given position in a Doubly Linked List.
Traverse to the node at the specified position in the Doubly Linked List.
Adjust the pointers of the previous and next nodes to remove the node at the specified position.
Update the pointers accordingly to maintain the integrity of the Doubly Linked List.
Handle edge cases such as deleting the head or tail node.
Ensure to free the memory...
You are given two sorted arrays of distinct integers, ARR1
and ARR2
. If there is a common element in both arrays, you can switch from one array to the other.
Your task ...
Given two sorted arrays, find the path through common elements for maximum sum.
Start with the array containing the smaller first common element
Switch arrays at common elements to maximize the sum
Continue adding elements until the end of the arrays
You are provided with a Doubly Linked List consisting of integers and a positive integer 'K', which represents the size of the group. Your task is to modify the...
Reverse groups of K nodes in a doubly linked list
Iterate through the linked list in groups of size K
Reverse each group of nodes
Handle cases where the number of remaining nodes is less than K
You are provided with a 2-dimensional matrix having N
rows and M
columns, containing only 1s (land) and 0s (water). Your goal is to determine the number of islands in th...
Count the number of islands in a 2D matrix of 1s and 0s.
Use Depth First Search (DFS) or Breadth First Search (BFS) to traverse the matrix and identify connected groups of 1s.
Maintain a visited array to keep track of visited cells to avoid redundant traversal.
Increment the island count each time a new island is encountered.
Consider all eight possible directions for connectivity between cells.
Handle edge cases such ...
I appeared for an interview in May 2022.
Round duration - 150 minutes
Round difficulty - Medium
The interview was scheduled at 6 pm and the duration of the interview was 1.5 hrs but went for around 2.5 hrs. The interviewer started with a brief intro about me. Asked me some coding questions. After coding questions he started asking questions on dbms like difference between sql and no sql, what is horizontal and vertical scaling and when we use them. Then some questions on computer networks like how web browsers works, different between http and HTTPS, what is TCP. After this he asked about my projects and the technology I worked on during the intern.
Given a Snake and Ladder Board with 'N' rows and 'N' columns filled with numbers from 1 to N*N starting from the bottom left of the board, and alternating direction each...
Find the minimum number of dice throws required to reach the last cell on a Snake and Ladder board.
Use Breadth First Search (BFS) algorithm to find the shortest path on the board.
Create a mapping of each cell to its next possible moves based on dice outcomes.
Consider the snakes and ladders on the board while calculating the next possible moves.
Track the number of dice throws needed to reach each cell and update it as y...
You are given a Doubly Linked List with 'N' positive integers. Your task is to delete a node at a given position 'POS' in this linked list.
The first line of input ...
Implement a function to delete a node at a given position in a Doubly Linked List.
Traverse to the node at the specified position in the Doubly Linked List.
Adjust the pointers of the previous and next nodes to remove the node at the specified position.
Update the pointers accordingly to maintain the integrity of the Doubly Linked List.
Handle edge cases such as deleting the head or tail node.
Ensure to free the memory of t...
Round duration - 20 minutes
Round difficulty - Easy
Tip 1 : Study all the concepts of dbms and cn deeply
Tip 2 : Zomato focus on development, so you have to do some good projects or should have previous internship experience.
Tip 1 : Have good Projects
Tip 2 : Study all the topics deeply that u mentioned in your resume.
I appeared for an interview in Aug 2021.
Round duration - 90 minutes
Round difficulty - Medium
The interview started in the evening on google meet. and extended for 90 minutes. The interviewer was very helpful and he shared a collaborative code editor to discuss several problems.
Given an array of integers ARR
of length N
and an integer Target
, your task is to return all pairs of elements such that they add up to the Target
.
The first line ...
Given an array of integers and a target, find all pairs of elements that add up to the target.
Iterate through the array and for each element, check if the complement (target - current element) exists in a hash set.
If the complement exists, add the pair to the result. If not, add the current element to the hash set.
Handle cases where the same element is used twice in a pair by keeping track of the frequency of elements.
...
Given a binary tree of integers, convert the binary tree into a sum tree where each node's value is replaced by the sum of the values of its left and right subtrees in ...
Convert a binary tree into a sum tree where each node's value is replaced by the sum of its left and right subtrees.
Traverse the tree in postorder fashion to calculate the sum of left and right subtrees for each node.
Set leaf nodes to zero.
Update the node values with the sum of left and right subtrees.
Design and implement a Least Frequently Used (LFU) Cache with the following functionalities:
1. put(U__ID, value): Insert the value in the cache if the key ('U__ID') is not alrea...
Design and implement a Least Frequently Used (LFU) Cache with put and get functionalities, handling capacity and frequency of use.
Implement a LFU cache with put and get functions
Handle capacity and frequency of use for eviction
Return the value of key if present, -1 otherwise
Consider multiple elements with least frequency, remove least recently used
Example: Insert, update, and retrieve values based on operations
SQL query to find the X percentile of students
Use the NTILE() function to divide students into X groups
Calculate the total number of students and the number of students in each group
Select the students from the group that corresponds to the X percentile
Polymorphism is the ability of a function or method to behave differently based on the object it is called on.
Polymorphism allows objects of different classes to be treated as objects of a common superclass.
Real-time polymorphism is achieved through method overloading, where multiple methods have the same name but different parameters.
Run-time polymorphism is achieved through method overriding, where a subclass provide...
Tip 1 : Practice at-least 300 problems.
Tip 2 : Add at-least 2 projects and prepare them well for the interview.
Tip 3 : Practice mock interviews with your friends to learn how to explain problems.
Tip 1 : Follow some standard resume format and add 2-3 projects with explanations in point, also include technologies used in the project.
Tip 2 : Make sure you add all the technologies you are aware of in your resume and also, add links to competitive profiles (if you have good coding profiles).
Tip 3 : Add your achievements in the resume in points.
I appeared for an interview before Sep 2020.
Round duration - 60 Minutes
Round difficulty - Easy
The overall interview experience was quite smooth and the interviewers were very kind.
I was asked 2 coding questions.
You are provided with a Doubly Linked List consisting of integers and a positive integer 'K', which represents the size of the group. Your task is to modify th...
Reverse groups of K nodes in a doubly linked list
Iterate through the linked list in groups of size K
Reverse each group of nodes
Handle cases where the number of remaining nodes is less than K
You are given an array/list HEIGHTS
of length N
, where each element represents the height of a histogram bar. The width of each bar is considered to be 1.
Calculate the area of the largest rectangle that can be formed within the bounds of a given histogram.
Iterate through the histogram bars and maintain a stack to keep track of increasing heights.
Calculate the area of the rectangle formed by each bar as the smallest height in the stack multiplied by the width.
Update the maximum area found so far and return it as the result.
Round duration - 50 Minutes
Round difficulty - Medium
3 coding questions were asked and 1 on system design.
You are given two sorted arrays of distinct integers, ARR1
and ARR2
. If there is a common element in both arrays, you can switch from one array to the other.
Your task...
Given two sorted arrays, find the path through common elements for maximum sum.
Start with the array containing the smaller first common element
Switch arrays at common elements to maximize the sum
Continue adding elements until the end of the arrays
You are provided with a 2-dimensional matrix having N
rows and M
columns, containing only 1s (land) and 0s (water). Your goal is to determine the number of islands in t...
Count the number of islands in a 2D matrix of 1s and 0s.
Use Depth First Search (DFS) or Breadth First Search (BFS) to traverse the matrix and identify connected groups of 1s.
Maintain a visited array to keep track of visited cells to avoid redundant traversal.
Increment the island count each time a new island is encountered.
Consider all eight possible directions for connectivity between cells.
Handle edge cases such as bo...
Designing Instagram involves creating a user-friendly platform for sharing photos and videos with social networking features.
Focus on a clean and intuitive user interface for easy navigation
Implement features like photo filters, stories, direct messaging, and explore page
Incorporate algorithms for personalized content recommendations
Ensure robust security measures for user data protection
Integrate advertising options f...
Round duration - 15 Minutes
Round difficulty - Medium
Tip 1 : Practice previous interview questions from LeetCode, GeeksForGeeks.
Tip 2 : Revise Computer Science subjects like DBMS, OOPS etc
Tip 3 : Confidence is a key of success
Tip 1 : Mention those things which your confident about
Tip 2 : Add projects and Internships
What people are saying about Eternal Limited
I appeared for an interview before Sep 2020.
Round duration - 90 minutes
Round difficulty - Easy
This was an online technical round on the mettl platform, the test window was open from 22 to 25 May 2020
The test had 28 mcqs and 2 coding questions.
The test was proctored. One needed to have webcam on.
A sample test link was provided before test to get familiar with the mettl platform.
Given an integer array ARR
of size N
, your task is to find the total number of inversions that exist in the array.
An inversion is defined for a pair of integers in the...
Count the total number of inversions in an integer array.
Iterate through the array and for each pair of elements, check if the conditions for inversion are met.
Use a nested loop to compare each pair of elements efficiently.
Keep a count of the inversions found and return the total count at the end.
Given an array of positive integers, your task is to find the GCD (Greatest Common Divisor) of a pair of elements such that it is the maximum among all possible pair...
Find the pair with the maximum GCD in an array of positive integers.
Iterate through all pairs of elements in the array.
Calculate the GCD of each pair using Euclidean algorithm.
Keep track of the maximum GCD found so far.
Return the maximum GCD value.
Round duration - 60 minutes
Round difficulty - Medium
Time : 12pm to 1pm
Mode of Interview : Amazon Chime Video
LiveCode : To write code, it was not a compiler
The interviewer was quite supportive.
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.
Find the majority element in an array, return -1 if no majority element exists.
Iterate through the array and keep track of the count of each element using a hashmap.
Check if any element's count is greater than floor(N/2) to determine the majority element.
Return the majority element or -1 if no majority element exists.
You are provided with an array/list ARR
of length N
containing only 0s and 1s. Your goal is to determine the number of non-empty subarrays where the numbe...
Count the number of subarrays where the number of 0s is equal to the number of 1s in a given array of 0s and 1s.
Iterate through the array and keep track of the count of 0s and 1s encountered so far.
Use a hashmap to store the difference between the counts of 0s and 1s seen at each index.
Increment the count of subarrays whenever the difference between the counts seen before matches the current difference.
Round duration - 60 minutes
Round difficulty - Medium
Time : 11 am to 12am
Mode of Interview : Amazon Chime Video
LiveCode : To write code, it was not a compiler
The interviewer was quite supportive.
Given a singly linked list where nodes contain values in increasing order, your task is to convert it into a Balanced Binary Search Tree (BST) using th...
Convert a sorted linked list into a Balanced Binary Search Tree (BST) using the same data values.
Create a function to convert the linked list to an array for easier manipulation.
Implement a function to build a Balanced BST from the array recursively.
Ensure the height difference of the subtrees is no more than 1 for each node.
Use level order traversal to output the values of the BST nodes.
Handle NULL nodes by representi...
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 in O(1) time.
Create a class named Stack with getSize, isEmpty, push, pop, and getTop methods.
Use a Singly Linked List to store the elements of the stack.
Ensure each operation runs in O(1) time complexity.
Handle edge cases like empty stack appropriately.
Test the implementation with sample queries to verify correctness.
Tip 1 : Practice questions from all the topics as much as possible
Tip 2 : Be very much attentive while doing projects in college or anywhere, they are asked in detail if mentioned in resume.
Tip 3 : Be consistent while practicing and do a variety of questions rather than doing more questions of same kind.
Tip 1 : You should know whatever you have mentioned in your resume. Don't brag in your resume ever. Be very precise. It doesn't matter how much you have done, what matters is you are very much confident and clear about what you have done.
Tip 2 : Put your projects and the language you code in for sure in your resume.
I appeared for an interview before Sep 2020.
Round duration - 45 minutes
Round difficulty - Medium
The first Round was held on Hackerrank and the questions were of medium difficulty based on Data Structures and Algorithms.
The time of test was 1:00 PM and it was of 45 minutes with 2 coding questions to be solved.
Given a specified number of intervals, where each interval is represented by two integers denoting its boundaries, the task is to merge all overlapping interv...
Merge overlapping intervals and return sorted list of merged intervals.
Identify overlapping intervals based on start and end times
Merge overlapping intervals to form new intervals
Sort the merged intervals in ascending order of start times
Consider 'N' individuals standing in a circle, numbered consecutively from 1 to N, in a clockwise direction. Initially, the person at position 1 starts counting and will skip K-...
The Josephus problem involves eliminating individuals in a circle until only one remains, based on a specific counting rule.
Start counting from position 1, skip K-1 individuals, eliminate the Kth person, and continue until only one person remains.
The position of the last surviving person can be determined based on the initial numbering and the value of K.
Example: For N=5 and K=2, the last person standing is at position...
Round duration - 75 minutes
Round difficulty - Medium
A google Doc was shared with us and we were supposed to write code there.
Use of IDEs was not allowed so we had to write correct code on Google Docs which was later checked by them through online IDEs.
The Interviewer were friendly and observative and helped us through code if we made some silly error.
You are given an array/list HEIGHTS
of length N
, where each element represents the height of a histogram bar. The width of each bar is considered to be 1.
Compute the area of the largest rectangle that can be formed within the bounds of a given histogram.
Iterate through the histogram bars and maintain a stack to keep track of increasing heights.
Calculate the area of the rectangle formed by each bar as the smallest height in the stack times the width.
Update the maximum area found so far.
Time complexity can be optimized to O(N) using a stack-based approach.
Given a binary tree of integers, your task is to return the boundary nodes of the tree in Anti-Clockwise direction starting from the root node.
The first line ...
Return the boundary nodes of a binary tree in Anti-Clockwise direction starting from the root node.
Traverse the left boundary nodes in top-down order
Traverse the leaf nodes in left-right order
Traverse the right boundary nodes in bottom-up order
Handle duplicates in boundary nodes by including them only once
Round duration - 60 minutes
Round difficulty - Medium
The face to face round was held on Google Meet where initially Interviewer asked a DS/Algo problem and then Later Manager Joined and asked about our resume projects in detail.
The time was 10:00 AM
Given an M x N matrix of integers ARR
, your task is to identify the rectangle within the matrix that has the greatest sum of its elements.
The first line of input co...
Find the rectangle within a matrix with the greatest sum of elements.
Iterate through all possible rectangles within the matrix and calculate their sums
Use Kadane's algorithm to find the maximum sum subarray for each row combination
Keep track of the maximum sum found so far
You are provided with a sorted array that has undergone 'K' rotations (the exact value of 'K' is unknown). A rotation involves shifting each element of the array to the right,...
Find the minimum number in a rotated sorted array efficiently.
Use binary search to find the minimum element in the rotated array.
Compare mid element with the last element to determine which half to search.
Adjust the search space based on the comparison to find the minimum element efficiently.
Tip 1 : Prepare OS,DBMS,OOPs too
Tip 2 : Mention atleast one project or past work experience in your resume
Tip 3 : Try maintaining 8+ CGPA as sometimes shortlist is done based on CGPA
Tip 4 : Try past interview questions from Leetcode,Interviewbit.
Tip 1 : Try to Keep Resume 1 Pager
Tip 2 : Have atleast one project or past work experience mentioned
Tip 3 : Don't put false things on Resume as questions are asked in detail from Resume
I appeared for an interview in Dec 2020.
Round duration - 150 minutes
Round difficulty - Medium
Given a singly linked list of integers, determine if the linked list is a palindrome.
A linked list is considered a palindrome if it reads the same forwar...
Check if a given singly linked list of integers is a palindrome or not.
Traverse the linked list to find the middle element using slow and fast pointers.
Reverse the second half of the linked list.
Compare the first half with the reversed second half to determine if it's a palindrome.
You are given an integer array 'ARR' of size 'N' and an integer 'S'. Your task is to find and return a list of all pairs of elements where each sum of a pair equals 'S'.
Find pairs of elements in an array that sum up to a given value, sorted in a specific order.
Iterate through the array and for each element, check if the complement (S - current element) exists in a hash set.
If the complement exists, add the pair (current element, complement) to the result list.
Sort the result list based on the first element of each pair, and then based on the second element if the first elements are eq...
Round duration - 60 minutes
Round difficulty - Medium
You are provided with two integers, 'N' and 'D'. Your objective is to determine the square root of the number 'N' with a precision up to 'D' decimal pl...
Implement a function to find the square root of a number with a specified decimal precision.
Implement a function that takes two integers N and D as input and returns the square root of N with precision up to D decimal places.
Use mathematical algorithms like Newton's method to approximate the square root with the required precision.
Ensure that the difference between the computed result and the true square root is less t...
Tip 1 : Have more understanding and confidence over Data Structures and get good understanding of its concepts. At least practice 5-6 coding questions everyday on any coding platform. I had completed around 150+ questions on Leetcode and 250+ questions on Geek For Geeks. Practice regularly rather than completing all coding questions in one go.
Tip 2 : While attempting the questions analyze its time and space complexity. Always work on the strategies to further optimize your solution. Sometimes the interviewer asks only one question and keep on increasing its difficulty by asking for its optimization and will what kind of strategies you implement.
Tip 3 : Along with coding questions keep on studying concepts in details of Operating Systems, databases and object oriented programming. Refer to Geeks For Geeks articles for it. Also refer, Coding Ninja's Data Structures and algorithms course in C++ helped me a lot in improving my OOPS concepts specifically.
Tip 1 : Mention only those skills, projects or achievements which you have completed yourselves and thorough knowledge. Because there will be question around these and in case if you are not able to answer these basic questions it leaves a bad impact on interviewer.
Tip 2 : No need to add too many projects. Only one or two good projects with proper knowledge is fine. Also do the same for skills, do not add so many skills only add those one in which you can discuss and answer.
Tip 3 : Mention achievements which showcase your technical skills, communication skills, leadership quality or teamwork
I appeared for an interview in Sep 2020.
Round duration - 145 minutes
Round difficulty - Easy
The online assessment consisted of four components, a code debugging section (20 minutes), a coding test (70 minutes), a workstyles assessment (20 minutes) and a reasoning ability section (35 minutes). Code debugging questions were pretty simple and straightforward. The coding test consisted of 2 questions, first was similar to two Sum problem. Second question was similar to find the critical edges in a graph. The workstyles assessment section contained certain behavioural questions.
Reasoning ability section consisted of aptitude questions. This round was basically to check the problem solving skills of the candidate.
Given an array of integers ARR
of length N
and an integer Target
, your task is to return all pairs of elements such that they add up to the Target
.
The first line ...
Given an array of integers and a target, find all pairs of elements that add up to the target.
Iterate through the array and for each element, check if the difference between the target and the element exists in a hash set.
If it exists, then print the pair (element, target-element), else add the element to the hash set.
If no pair is found, print (-1, -1).
In an undirected graph consisting of V
vertices and E
edges, your task is to identify all the bridges within the graph. A bridge is an edge which, when removed, result...
Identify bridges in an undirected graph by finding edges that, when removed, increase the number of connected components.
Use depth-first search (DFS) to find bridges in the graph.
Keep track of discovery time and low time for each vertex during DFS.
An edge (u, v) is a bridge if low[v] > disc[u].
Sort and print the bridge pairs in ascending order of vertices.
Example: If the input graph has vertices 0, 1, 2, 3, 4 and ed...
Round duration - 60 minutes
Round difficulty - Medium
I was asked two coding questions. First question was related to binary tree and second question was to implement LRU cache.
I had to code both questions. The interviewer asked me the time and space complexity for both the questions.
Given a circular array ARR
of size N
consisting of positive and negative integers, determine if there is a cycle present in the array. You can make movements based on...
Determine if a circular array has a cycle present, following specific movement rules.
Iterate through the array and check for cycles following the given movement rules.
Keep track of visited indices to detect cycles.
Handle both clockwise and counterclockwise movements separately.
Return 'True' if a cycle is found, 'False' otherwise.
Design and implement a Least Recently Used (LRU) cache data structure, which supports the following operations:
get(key)
- Return the value of the key if it exists in the cach...Implement a Least Recently Used (LRU) cache data structure with get and put operations.
Use a combination of a hashmap and a doubly linked list to efficiently 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.
For get operation, return the value of th...
Round duration - 60 minutes
Round difficulty - Medium
I was asked two coding questions and some conceptual questions about priority heap data structure. I was able to code the optimized approach for the first question. But second question was a little tricky for me as I had never heard it before. But I explained my approach confidently. The interviewer also helped me and finally I was able to code it.
Given 'N' ropes, each having different lengths, your task is to connect these ropes into one single rope. The cost to connect two particular ropes is equal to the sum of th...
Connect ropes with different lengths into one single rope with minimum cost by merging the smallest ropes first.
Sort the lengths of ropes in ascending order.
Merge the two smallest ropes at each step to minimize cost.
Keep track of the total cost as you merge the ropes.
Repeat the merging process until all ropes are connected.
Return the total cost as the minimum cost to connect all ropes.
Given a positive integer N
, you are required to generate a list of integers of size 2N
such that it contains all the integers from 1 to N
, both included, twice. These in...
Generate Langford pairing for given N, return 'Valid' if correct, 'Invalid' if not.
Generate a list of integers of size 2N with all integers from 1 to N twice.
Arrange integers according to Langford pairing rules.
Return 'Valid' if pairing is correct, 'Invalid' if not.
If no valid pairing possible, return list with only -1 element.
Tip 1 : Be very clear with the basics of each topic.
Tip 2 : Be thorough with the projects mentioned in the resume.
Tip 1 : Don't lie on your resume.
Tip 2 : The number of projects on the resume does not matter, what matters is that you must be thorough with your projects.
I appeared for an interview in Nov 2020.
Round duration - 120 minutes
Round difficulty - Medium
This was an online coding, mcq and debugging round round held on Amcat platform, there were 3 sections in the test.
1)20 MCQ questions {10 involving mathematics and the other 10 on programming fundamentals}; duration:20 mins;
you cannot navigate back to a questions after moving further, so have to answer carefully
2)debugging section- it involved 7 questions which were to be completed within 20 mins, 5 of them were very easy, each question only took almost a minute to figure out the problem with the code, last 2 questions were relatively moderate and there were errors at 3-4 sections of the entire code. I was able to solve all the questions in 15 mins
3)2 Coding questions- duration:80 mins, one was moderate on string while the other one involved dynamic programming, I was able to successfully execute all the available test cases.
Given two strings, S
and X
, your task is to find the smallest substring in S
that contains all the characters present in X
.
S = "abdd", X = "bd"
Find the smallest substring in S that contains all characters in X.
Use a sliding window approach to find the smallest window in S containing all characters of X.
Maintain a hashmap to keep track of characters in X and their frequencies.
Slide the window by moving the right pointer until all characters in X are found, then move the left pointer to minimize the window size.
Return the smallest window found.
Example: S = 'abd...
You are given a 2D matrix 'ARR' of size 'N x 3' with integers, where 'N' is the number of rows. Your task is to compute the smallest sum achievable by selecting one...
Find the smallest sum achievable by selecting one element from each row of a 2D matrix, following certain constraints.
Iterate through each row and find the minimum element that does not violate the constraints.
Keep track of the minimum sum achieved by selecting elements from each row.
Avoid selecting elements directly beneath previously selected elements.
Round duration - 45 minutes
Round difficulty - Hard
The interview started with introduction, there were two interviewers, they both introduced themselves and then asked me to introduce myself. Then we had a brief description on my projects, and they really appreciated my projects. Then as they were more concerned with DSA part, so we moved towards solving a coding problem. It was a famous rotten oranges problem with some change in language but as I haven't seen it beforehand, I wasn't able to give them an optimal approach and had to ask for some hints, but with a certain amount of help and hints, I was able to solve the problem and successfully coded it in 5 mins. Then the interviewers went for a dry run of the algorithm and tried to run it on each and every corner case, but as my algorithm was kind of bullet proof, it successfully passed all the corner cases.
Then they went for some questions on OOPS concepts involving inheritance and we had a long discussion on virtual function and runtime polymorphism. Then the interview was ended after a Q/A round that lasted for 3-4 minutes.
Given a grid containing oranges in three possible states:
Every second, any fresh orange adjac...
Given a grid with fresh and rotten oranges, determine the minimum time for all oranges to become rotten.
Create a queue to store the coordinates of rotten oranges and perform BFS to rot adjacent fresh oranges
Track the time taken to rot all oranges and return -1 if some fresh oranges remain
Handle edge cases like empty grid or no fresh oranges present
Example: For input grid = [[2,1,1],[1,1,0],[0,1,1]], the minimum time to...
Tip 1 : Try to keep yourself involved in competitive programming on regular basis {ex-Codechef, codeforces etc}
Tip 2 : brush up concepts on DSA and practice at least all questions from interviewbit and around 300 questions from GFG and Leetcode of upto intermediate level, this will help you in building your concepts and you will be quickly able to answer the questions in face to face interviews
Tip 3 : Complete some courses on data structures and algorithms and some programming languages{coding ninjas courses are preferable for valuable content}
Tip 1 : Try to keep only those things in resume on which you have very good command and you should be able to answer all of the questions(upto moderate level) related to your technical skills
Tip 2 : Mention your projects with brief description, try avoiding very high level description because some times reader might not be able to understand your work, keep it descriptive and understandable
I appeared for an interview in Nov 2020.
Round duration - 120 Minutes
Round difficulty - Medium
Around 4-5 pm
2 coding questions
7 debugging and output questions
20-30 aptitude questions
A section to test psychology based on various questions and situations.
Given a linked list where each node has two pointers: one pointing to the next node and another which can point randomly to any node in the list or ...
Cloning a linked list with random pointers by creating new nodes rather than copying references.
Create a deep copy of the linked list by iterating through the original list and creating new nodes with the same values.
Update the random pointers of the new nodes by mapping the original node's random pointer index to the corresponding new node.
Ensure the cloned linked list is an exact copy of the original by validating th...
You are provided with an array of integers ARR
of length N
. Your task is to determine the next smaller element for each array element.
The Next Smalle...
Given an array of integers, find the next smaller element for each element in the array.
Iterate through the array from right to left and use a stack to keep track of elements.
Pop elements from the stack until a smaller element is found or the stack is empty.
If no smaller element is found, output -1 for that element.
Round duration - 50 Minutes
Round difficulty - Medium
Timing - 4pm
Just asked one question based on DSA and asked to make the code modular and well indented.
Didn’t even ask for introduction.
You are given a grid containing oranges where each cell of the grid can contain one of the three integer values:
Find minimum time to rot all fresh oranges in a grid if adjacent to rotten oranges.
Use Breadth First Search (BFS) to simulate the rotting process of oranges.
Keep track of the time taken to rot all fresh oranges.
If at the end there are still fresh oranges left, return -1 as it is impossible to rot all oranges.
Round duration - 60 Minutes
Round difficulty - Medium
Started at 4pm
Interviewer introduced himself and then asked me for a brief introduction.
Went ahead to ask 2 DSA based questions.
You are provided with 'K' sorted linked lists, each sorted in increasing order. Your task is to merge all these lists into one single sorted linked list and return the head of ...
Merge k sorted linked lists into one single sorted linked list.
Create a min-heap to store the heads of all k linked lists.
Pop the smallest element from the heap and add it to the result list.
If the popped element has a next element, push it back into the heap.
Repeat until all elements are merged into a single sorted list.
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 current direction to the path and backtrack if the path leads to a dead end.
Return all valid paths found in alphabetical order as an ar...
Tip 1 : Smart Preparation is very important instead of just preparing everything.
Tip 2 : Going through previous interview experiences helps a lot.
Tip 3 : Focussing on time and space complexities instead of just the logic.
Tip 4 : Be thorough with the projects mentioned in resume.
Tip 5 : Daily practice of as many questions as possible with at least a couple of questions with level:Hard
Tip 1 : Keep it technical and to the point with no catch phrases.
Tip 2 : Use of action verbs to highlight the work put in projects or any previous internships.
Tip 3 : Use of bullet points.
Tip 4 : Mention clickable links of your projects, github account and certificates whenever possible.
I appeared for an interview in Oct 2020.
Round duration - 120 minutes
Round difficulty - Medium
Evening test around 5
Platform :- SHL
Environment was amazing
Given two binary trees, T and S, determine whether S is a subtree of T. The tree S should have the same structure and node values as a subtree of T.
Given two binary trees T and S, determine if S is a subtree of T with the same structure and node values.
Check if the second tree is a subtree of the first tree by comparing their structures and node values.
Use a recursive approach to traverse both trees and check for equality.
Handle cases where one tree is null or the values do not match.
Return true if S is a subtree of T, false otherwise.
You are given an N * N matrix of integers where each row and each column is sorted in increasing order. Your task is to find the positi...
Given a sorted N*N matrix, find the position of a target integer X.
Iterate over each row and column to find the target integer X
Utilize the sorted nature of the matrix to optimize the search process
Return the position of X if found, else return -1 -1
Round duration - 60 minutes
Round difficulty - Medium
1 Hour
Afternoon
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 t...
Find the node where two linked lists merge, return -1 if no merging occurs.
Traverse both lists to find their lengths and the difference in lengths
Move the pointer of the longer list by the difference in lengths
Traverse both lists simultaneously until they meet at the merging point
Given a Binary Search Tree (BST) and an integer 'S', your task is to find all pairs of nodes within the BST that total to 'S' and return these pairs. If no such p...
Find pairs of nodes in a BST that sum up to a given value 'S'.
Traverse the BST in-order to get a sorted list of nodes.
Use two pointers approach to find pairs with sum 'S'.
Keep track of visited nodes to avoid using the same node twice in a pair.
Round duration - 60 minutes
Round difficulty - Medium
Online Round held on Chime
You are given a binary tree of integers. Your task is to determine if it is a binary heap tree or not.
The first line of input contains an integer ‘T’ denoti...
Determine if a given binary tree is a binary heap tree or not based on certain properties.
Check if the binary tree is a complete binary tree where every level, except the last level, is completely filled and the last level is as far left as possible.
Ensure that every parent node is greater than all its children nodes, forming a max-heap.
If any node does not have a left or right child, it should be represented as -1 in ...
Given two strings S
and T
with lengths N
and M
respectively, your task is to find the "Edit Distance" between these strings.
The Edit Distance is defined as the minimum nu...
The task is to find the minimum number of operations required to convert one string into another using delete, replace, and insert operations.
Use dynamic programming to solve the problem efficiently.
Create a 2D array to store the edit distances between substrings of the two input strings.
Fill up the array based on the minimum of three possible operations: insert, delete, or replace.
The final answer will be the value at...
Tip 1 : 1 Programming Language
Tip 2 : Practice Data Structures with atleast 300 ques.
Tip 3 : CS Fundamental
Tip 1 : 1 Pager
Tip 2 : Add top 3 projects in Resume.
based on 2 reviews
Rating in categories
Delivery Boy
1k
salaries
| ₹1.7 L/yr - ₹4 L/yr |
Key Account Manager
1k
salaries
| ₹6 L/yr - ₹14 L/yr |
Business Analyst
550
salaries
| ₹9.7 L/yr - ₹15 L/yr |
Accounts Manager
328
salaries
| ₹4 L/yr - ₹12.1 L/yr |
Senior Associate
287
salaries
| ₹4.2 L/yr - ₹8.5 L/yr |
Swiggy
Amazon
Dunzo
Flipkart