Filter interviews by
Be the first one to contribute and help others!
I appeared for an interview before May 2021.
Round duration - 45 Minutes
Round difficulty - Easy
Given an integer N
representing the number of pairs of parentheses, find all the possible combinations of balanced parentheses using the given number of pairs.
Generate all possible combinations of balanced parentheses for a given number of pairs.
Use recursion to generate all possible combinations of balanced parentheses.
Keep track of the number of open and close parentheses used in each combination.
Terminate recursion when the number of open and close parentheses used equals the given number of pairs.
Round duration - 45 Minutes
Round difficulty - Easy
You are given a binary tree of integers. Your task is to print the boundary nodes of this binary tree in an anti-clockwise direction starting from the ro...
Print the boundary nodes of a binary tree in an anti-clockwise direction starting from the root node.
Traverse the left boundary nodes from top to bottom
Traverse the leaf nodes from left to right
Traverse the right boundary nodes from bottom to top
Handle cases where nodes are null (-1)
Print the boundary nodes in the specified order
Round duration - 45 Minutes
Round difficulty - Easy
Given a binary tree, the task is to print its bottom view from left to right. Assume the left and the right child nodes make a 45-degree angle with their paren...
The task is to print the bottom view of a binary tree from left to right.
Traverse the binary tree in level order and keep track of the horizontal distance of each node from the root.
For each horizontal distance, update the node value in a map to get the bottom view nodes.
Print the values of the map in sorted order of horizontal distance to get the bottom view sequence.
Round duration - 45 minutes
Round difficulty - Easy
Bar raiser
Yes, I can design a parking lot using LLD and a tiny URL service using HLD.
For designing a parking lot using LLD, we can create classes like ParkingLot, ParkingSpot, Vehicle, etc. with their respective attributes and methods.
For designing a tiny URL service using HLD, we can focus on scalability, fault tolerance, and performance. We can use techniques like sharding, caching, load balancing, etc.
In the parking lot LLD, ...
Tip 1 : Prepare 1-2 examples for each Leadership Principles
Tip 2 : Prepare questions from the latest interview experiences
Tip 1 : Concise, without errors
Tip 2 : Highlight years of experience
I appeared for an interview in Sep 2020.
Round duration - 180 minutes
Round difficulty - Hard
Timing: 8 a.m. to 11a.m.
Environment was optimum.
No significant activity.
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 minimum edit distance for substrings of the two input strings.
Iterate through the strings and update the array based on the operations needed for each character.
Return the value in the bottom ...
Round duration - 30 minutes
Round difficulty - Medium
Timing: 12:00 p.m. to 12:30 p.m.
The environment was quite good.
No significant activity.
Interviewers were very friendly. They were behaving like friends.
Round duration - 15 minutes
Round difficulty - Easy
Timing: 3:00 p.m. to 3:20 p.m.
Environment was very good.
No significant activity was monitored.
HR was very good and friendly.
Tip 1 : Do minimum 3 projects
Tip 2 : Prepare every topic of DSA for interview
Tip 3 : Hands on experience in performing MySql commands
Tip 1 : Be precise and don't bluff
Tip 2 : Learn atleast 2 programming languages
Tip 3 : Do projects on latest technologies like Artificial Intelligence and Machine Learning
Find sum of all numbers formed from root to leaf path in a binary tree
Traverse the binary tree using DFS
At each leaf node, add the number formed from root to leaf path to a sum variable
Return the sum variable
Time complexity: O(n)
Example: For a binary tree with root value 1, left child 2 and right child 3, the sum would be 12 + 13 = 25
Given a string, print all possible strings that can be made by placing spaces (zero or one) in between them.
Use recursion to generate all possible combinations of spaces
For each recursive call, either add a space or don't add a space between the current character and the next character
Base case is when there are no more characters left to add spaces between
Time complexity is O(2^n) where n is the length of the string
Preorder traversal without recursion
Use a stack to keep track of nodes
Push right child first and then left child onto stack
Pop top of stack and print value
Repeat until stack is empty
Find longest continuous patch on a 12 km road with updates in patches
Maintain a variable to keep track of current patch length
Update the variable whenever a new patch is added
Maintain a variable to keep track of longest patch so far
Compare current patch length with longest patch length and update if necessary
Use a sorted data structure like a binary search tree to store the patches for efficient search
Time complexity: ...
Find median of an unsorted array.
Sort the array and find the middle element
Use quickselect algorithm to find the median in O(n) time
If the array is small, use brute force to find the median
Find 'k' elements closest to a given number from a stream of characters.
Use a priority queue to keep track of closest elements.
Update the queue as new characters come in.
Return the 'k' closest elements from the queue.
Design a data structure with O(1) insert, remove, find-max, and delete-max operations.
Use a doubly linked list to maintain the elements in sorted order.
Use a hash table to store the pointers to the nodes in the linked list.
Maintain a pointer to the maximum element in the hash table.
Update the pointers in the hash table when inserting or removing elements.
Update the maximum pointer when deleting or inserting the maximum
Check if a given linked list is a palindrome.
Traverse the linked list and store the values in an array.
Compare the first and last elements of the array, then move towards the center.
If all elements match, the linked list is a palindrome.
Alternatively, use two pointers to find the middle of the linked list and reverse the second half.
Compare the first half with the reversed second half to check for a palindrome.
I appeared for an interview before May 2021.
Round duration - 30 minutes
Round difficulty - Medium
Given a string S, your task is to recursively remove all consecutive duplicate characters from the string.
String S
Output string
Recursively remove consecutive duplicate characters from a string.
Use recursion to check if the current character is the same as the next character, if so, skip the next character
Base case: if the string is empty or has only one character, return the string
Recursive case: if the current character is the same as the next character, call the function recursively with the string excluding the next character
Round duration - 90 minutes
Round difficulty - Easy
You are provided with a string S
and an array of integers A
of size M
. Your task is to perform M
operations on the string as specified by the indices in array A
...
Perform a series of reverse string operations on a given string based on specified indices.
Iterate through the array of indices and reverse the substring of the string based on the given indices.
Ensure to reverse the substring from the starting index to len(S) - starting index - 1.
Continue the operations in the sequence specified by the array of indices to get the final string.
Round duration - 50 minutes
Round difficulty - Medium
Tip 1 : Prepare well for resume & confidence for basic part of CS.
Tip 2 : Good knowledge of skills set which mentioned in CV.
Tip 3 : Explain about projects which you have worked earlier & your roles and responsibilities.
Tip 1 : Mentioned all the skills & certificate till date update your resume every 3 month's.
Tip 2 : Proper skills set with project explanation and duration of project which you have worked on
I appeared for an interview before May 2021.
Round duration - 60 minutes
Round difficulty - Easy
It is online round and it was conducted around 11 AM on campus. Difficulty was medium. 2 coding questions were asked. One question is based on arrays(easy) and the other question is based on usage of oops concepts like Inheritance, polymorphism. Everything went smooth.
Given an array ARR
of N integers and an integer S, determine if there exists a contiguous subarray within the array with a sum equal to S. If such a subarray exis...
Given an array of integers, find a subarray with a given sum S.
Use a sliding window approach to find the subarray with the given sum.
Keep track of the current sum and adjust the window based on the sum.
Return the start and end indices of the subarray if found, otherwise return [-1, -1].
Round duration - 50 minutes
Round difficulty - Medium
Round started with self introduction and discussion of project. Everything went fine.
Note: we didn't have hr round due to time constraint. You can expect hr round.
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. Yo...
Find the duplicate number in an array of integers from 0 to (N-2).
Iterate through the array and keep track of the frequency of each number using a hashmap.
Return the number with a frequency greater than 1 as the duplicate number.
Normalization is the process of organizing data in a database to reduce redundancy and improve data integrity.
Normalization is used to eliminate data redundancy and ensure data integrity in a database.
There are different normal forms such as 1NF, 2NF, 3NF, BCNF, and 4NF.
Each normal form has specific rules that must be followed to ensure data is properly organized.
Normalization helps in reducing data anomalies and incon...
ACID properties are essential characteristics of a transaction in a database management system.
Atomicity ensures that either all operations in a transaction are completed successfully or none of them are.
Consistency ensures that the database remains in a valid state before and after the transaction.
Isolation ensures that the execution of multiple transactions concurrently does not interfere with each other.
Durability e...
OOP is a programming paradigm based on the concept of objects, which can contain data and code to manipulate that data.
OOP focuses on creating objects that interact with each other to solve complex problems.
Encapsulation: Objects can hide their internal state and require interactions through well-defined interfaces. Example: A car object with methods like start(), stop(), accelerate().
Inheritance: Objects can inherit a...
Tip 1 : Don't get frustrated if not selected, keep believing yourself.
Tip 2 : Prepare data structures and algorithms well. Practice coding daily. OOPS in any programming language will do. Prefer quality of codes to quantity.
Tip 3 : If possible do a project on full stack development.
Tip 1 : Keep it simple and try to adjust everything in one page. As a fresher it is better if you can have 2 projects in your cv.
Tip 2 : Don't add unnecessary details such as parents details.
I appeared for an interview in Apr 2021.
Round duration - 60 Minutes
Round difficulty - Medium
Timing: 10AM-11AM
Interviewer was quite supportive and helpful.
Environment was normal as usual and it was morning time
Round duration - 60 Minutes
Round difficulty - Medium
Timing: 11AM-12PM
The interviewer was SDE2
He was checking the code for edge cases and was hinting if required
Ninja has been tasked with implementing a priority queue using a heap data structure. However, he is currently busy preparing for a tournament and has requested yo...
Implement a priority queue using a heap data structure with push, pop, getMaxElement, and isEmpty functions.
Implement a priority queue using a max heap data structure.
Use the provided class structure and complete the push, pop, getMaxElement, and isEmpty functions.
For push operation, insert the element into the heap and maintain the heap property.
For pop operation, remove the largest element from the heap.
For getMaxEle...
Ninja owns an electronic shop and possesses 'N' bulbs. To verify the quality of the bulbs, Ninja performs a unique technique. After 'N' rounds of this process, bulbs that rem...
Determine the number of good quality bulbs remaining after 'N' rounds of a unique technique.
Start with all bulbs on in the first round
Toggle every 'i' bulb in 'i' round
Count the bulbs that remain on after 'N' rounds
Round duration - 60 Minutes
Round difficulty - Medium
Timing: 6PM-7PM
The interviewer was not interactive and didn't gave any feedback whatsoever.
It was Hiring Manager Round
Interviewer was Software Development Manager at Amazon
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...
Find the maximum sum by traversing through common elements in two sorted arrays.
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
Tip 1 : Focus on internals of Data structure on how it actually works
Tip 2 : Implement the Data Structure from scratch, later you can use the inbuilt packages no problem but you must know the implementation
Tip 3 : Understand System Design concepts
Tip 1 : Highlight your contributions you made and how it impacted the business and be real
Tip 2 : Mention the improvement figures like x% reduction in page load size, improved SEO ranking by x figure, reduce memory usage by y%
I appeared for an interview in Mar 2021.
Round duration - 45 minutes
Round difficulty - Medium
This round was scheduled in the evening hours and all the participants were required to fill a form which was shared 15 minutes prior to the start of the online coding round. This form was filled out probably for the security reasons and to ensure that no one disinterested participant gives the test.
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 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 using different denominations.
Iterate through each denomination and update the array based on the number of ways to make change for each value.
Return the value at the last cell of
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).
A Binary Search Tr...
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
Round duration - 60 minutes
Round difficulty - Hard
This round was on call where I was just supposed to answer the tech questions that were asked. It started with a brief interview with one another and then moved to questions on DBMS, operating systems, computer networks and all. Almost 20-25 questions were asked and I probably answered 90% of them correctly.
Given a Singly Linked List of integers, your task is to reverse the Linked List by altering the links between the nodes.
The first line of input is an intege...
Reverse a singly linked list by altering the links between nodes.
Iterate through the linked list and reverse the links between nodes
Use three pointers to keep track of the current, previous, and next nodes
Update the links between nodes to reverse the list
Return the head of the reversed linked list
Round duration - 30 minutes
Round difficulty - Hard
There was only one interviewer for this round. He continuously interacted with me and was giving me some good situational problems that were not very easy to answer. Basically those were open-minded questions which can be answered oth ways and that's why I found it quiet hard as per my nature but at the end things went well for me.
Tip 1 : practice on gfg and coding ninjas
Tip 2 : compete on codechef and codeforces
Tip 3 : learn DSA and practice regularly
Tip 1 : put your entire valuable experience in brief
Tip 2 : put the handle of you competitive coding profiles
Tip 3 : try to put those things that really attracts the recruiter, will be better if your past experiences relates to the company
I appeared for an interview in Oct 2020.
Round duration - 60 mins
Round difficulty - Medium
3 Questions were asked : 2- Trees and 1- Stack.
Interviewer was not receptive at all, I think this was a stress interview.
Given a binary tree with 'N' nodes, determine if it is a Binary Search Tree (BST). Return true
if the tree is a BST, otherwise return false
.
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 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.
Traverse the tree in-order and check if the elements are in sorted order.
Use a recurs...
Given a binary tree with 'N' nodes, transform it into a Greater Tree. In this transformation, each node's value should be updated to the sum of its original value and...
Convert a binary tree into a Greater Tree by updating each node's value to the sum of its original value and the values of all nodes greater than or equal to it.
Traverse the tree in reverse inorder (right, root, left) to update the nodes' values.
Keep track of the sum of nodes visited so far to update each node's value.
Recursively update the node's value by adding the sum of greater nodes to it.
You are given a string STR
containing only the characters "{", "}", "(", ")", "[", and "]". Your task is to determine if the parentheses in the string are balanced.
Th...
Check if the given string containing only parentheses is balanced or not.
Use a stack to keep track of opening parentheses.
Iterate through the string and push opening parentheses onto the stack.
When a closing parenthesis is encountered, pop from the stack and check if it matches the corresponding opening parenthesis.
If at the end the stack is empty, return 'YES' else return 'NO'.
Round duration - 60 mins
Round difficulty - Hard
2 Coding Questions were asked, both were of Medium to Hard Difficulty.
You are given a multi-level linked list containing 'N' nodes. Each node has 'next' and 'child' pointers that may or may not point to other nodes. Your task is to flatten th...
Flatten a multi-level linked list into a single linked list by rearranging the pointers.
Traverse the linked list and whenever a node has a child, flatten the child list and append it after the current node.
Update the 'next' and 'child' pointers accordingly while flattening the list.
Continue this process until all nodes are rearranged into a single linked list.
Given an array/list ARR
of size N
, representing an elevation map where each element ARR[i]
denotes the elevation of the i-th
bar. Your task is to calculate and print ...
Calculate the total amount of rainwater that can be trapped between given elevations in an elevation map.
Use two-pointer approach to keep track of left and right boundaries.
Calculate the trapped water by finding the minimum of left_max and right_max for each bar.
Subtract the current bar's height from the minimum of left_max and right_max to get the trapped water.
Keep updating the left_max and right_max as you iterate t
Round duration - 90 minutes
Round difficulty - Medium
Timing : It was late night.
How the interviewer was? He was very tired and I had to lead the discussion.
1 System Design Question was asked, had to provide - HLD, LLD, APIs.
Round duration - 60 minutes
Round difficulty - Medium
Timing : Afternoon
How was the environment? Home
Interviewer : Hiring Manager
Discussed about past Projects, challenges faced, disagreements with manager, why looking for job switch, leadership principle questions were asked.
Round duration - 60 minutes
Round difficulty - Medium
Timing - Afternoon
How was the environment? Home
How the interviewer was? Very Helpful Interviewer
Bar raiser Round - Coding + System Design + Leadership principle
Tip 1 : 250 Leetcode ( Easy- 70, Medium- 150, Hard- 30)
Tip 2 : Don't underestimate importance of good projects on your Resume.
Tip 3 : Be Confident.
Tip 1: Resume should not be more than 1 page.
Tip 2: Have Keywords on Resume that match Job descriptions.
I appeared for an interview in Dec 2020.
Round duration - 30 minutes
Round difficulty - Medium
It was in the morning about 10:00AM-10:40AM. The platform used for this round was hackerrank. There are 15 MCQ's which cover portions of Aptitude, Data Structures, DBMS, SQL
You are given an array 'ARR'
of size 'N'
consisting of positive integers. Your task is to determine the minimum number of operations required to make all elements in t...
Minimum number of operations to make all elements in the array equal by performing addition, subtraction, multiplication, or division.
Iterate through the array to find the maximum and minimum values.
Calculate the difference between the maximum and minimum values.
The minimum number of operations needed is the difference between the maximum and minimum values.
Round duration - 15 minutes
Round difficulty - Easy
It was in the night around 7:00PM-7:20PM. Platform used for this round was skype. Interviewer was very serious while taking my interview.
Tip 1 : Practice as much as you can
Tip 2 : Try to get a good hold in Data Structures
Tip 3 : Do atleast 2 projects
Tip 1 : It should not be too long or too short.
Tip 2 : Each skill should be mentioned properly.
Marketing Manager
4
salaries
| ₹15 L/yr - ₹16 L/yr |
Restaurant Manager
3
salaries
| ₹3 L/yr - ₹4.3 L/yr |
Accounts Manager
3
salaries
| ₹4.8 L/yr - ₹7.2 L/yr |
Senior Accountant
3
salaries
| ₹5 L/yr - ₹6.8 L/yr |
TCS
Accenture
Wipro
Cognizant