Filter interviews by
I appeared for an interview in Sep 2021.
Round duration - 60 Minutes
Round difficulty - Easy
Given a string A
consisting of lowercase English letters, determine the length of the longest palindromic subsequence within A
.
The task is to find the length of the longest palindromic subsequence in a given string.
Iterate through the string and create a 2D array to store the lengths of palindromic subsequences.
Use dynamic programming to fill the array based on the characters in the string.
Consider the cases where characters match or do not match to update the array values.
Return the length of the longest palindromic subsequence for each test ...
Given two strings S
and T
, determine if S
follows the same pattern as T
.
A full match means there is a bijection between a letter of T
and a non-empty word of S
.
Check if two strings follow the same pattern based on bijection between letters and words.
Iterate through each letter in T and corresponding word in S to create a mapping.
Use a hashmap to store the mapping between letters and words.
Check if the mapping is consistent for all test cases.
Round duration - 40 Minutes
Round difficulty - Easy
Given a binary tree of integers, return the level order traversal of the binary tree.
The first line contains an integer 'T', representing the number of te...
Implement a function to return the level order traversal of a binary tree of integers.
Create a queue to store nodes for level order traversal
Start with the root node and enqueue it
While the queue is not empty, dequeue a node, print its value, and enqueue its children
Repeat until all nodes are traversed
In a set of linked ninja villages, the goal is to determine if a stronger ninja exists in the nearest village linked ahead. Given a linked list of 'N' in...
Given a linked list of ninja villages, find the next greater ninja strength in the nearest linked village.
Traverse the linked list and store the elements in an array.
Use a stack to keep track of elements with no next greater element found yet.
Iterate through the array to find the next greater element for each village.
Return the array of next greater elements for each village.
Round duration - 15 Minutes
Round difficulty - Easy
Tip 1 : Be consistent, practice regularly whatever you read/study.
Tip 2 : Apply what you learn through code.
Tip 1 : Have some projects on your resume.
Tip 2 : If you have an internship or training explain it in a proper way like what are the techniques you learned during your training.
Top trending discussions
I applied via Campus Placement and was interviewed before Jun 2020. There was 1 interview round.
I applied via Naukri.com and was interviewed before Dec 2021. There were 5 interview rounds.
It was overall an easy test. It had Aptitude , logical reasoning and technical questions.
It had 2 coding questions. , Both were moderate level questions
I appeared for an interview before Sep 2020.
Round duration - 90 Minutes
Round difficulty - Medium
The test was organized online on Amcat and there were 3 coding problems. There were no MCQs in this round.
Implement a function that determines whether a given numeric string contains any substring whose integer value equals the product of two consecutive integers. The functio...
Implement a function to determine if a numeric string contains a substring whose value equals the product of two consecutive integers.
Iterate through all substrings of the input string and check if their integer value equals the product of two consecutive integers.
Use nested loops to generate all possible substrings efficiently.
Check if the product of two consecutive integers matches the integer value of the substring.
...
Given a binary tree, a target node within this tree, and an integer K
, identify and return all nodes that are exactly K
edges away from the t...
Find nodes at a specific distance from a target node in a binary tree.
Traverse the binary tree to find the target node.
Perform a depth-first search to identify nodes at distance K from the target node.
Return the values of nodes found at distance K in an array.
Round duration - 50 Minutes
Round difficulty - Medium
This round was scheduled by the college Training and Placement team virtually. The interviewer asked me questions pertaining mainly to DSA and we discussed my projects.
You are given the head node of a singly linked list head
. Your task is to modify the linked list so that all the even-valued nodes appear before all the odd-v...
Reorder a singly linked list so that all even-valued nodes appear before odd-valued nodes while preserving the original order.
Create two separate linked lists for even and odd nodes
Traverse the original list and move nodes to respective even or odd lists
Merge the even and odd lists while maintaining the original order
Round duration - 60 Minutes
Round difficulty - Easy
Again, the round was virtual. This was a Tech + Managerial round organized by the college T & P cell. The interviewer asked questions related to fundamental subjects such as Operating Systems, Object-oriented programming, and DBMS. There was one coding round at the end.
Given a binary tree of integers, find its diagonal traversal. Refer to the example for clarification on diagonal traversal.
Consider lines at a...
Diagonal traversal of a binary tree involves printing nodes at 135 degree angle in between lines.
Traverse the tree in a diagonal manner, starting from the root node.
Maintain a map to store nodes at each diagonal level.
Print the nodes at each diagonal level in the order of traversal.
Round duration - 40 Minutes
Round difficulty - Easy
The round was virtual and was organized by the T & P cell of the college. The interviewer asked some behavioural and situation-based questions. There was one puzzle at the end.
Tip 1 : For a product-based company, the first important thing is to solve as many DSA problems as possible. I solved problems mainly on GeeksforGeeks, LeetCode, and Coding Ninjas.
Tip 2 : Prepare 2-3 good projects based on your technical skillset. Prepare it very well as there is a high chance that projects would be discussed in the interview.
Tip 3 : Prepare fundamental college subjects like Operating systems, Object-oriented Programming, Database Management.
Tip 1 : Keep it short and concise
Tip 2 : Describe your projects very specifically
I appeared for an interview before Sep 2020.
Round duration - 70 minutes
Round difficulty - Medium
Timing: 6:00 pm
3 coding questions of medium to be solved in 70 minutes.
Given an array of numbers, the task is to find the maximum sum of any contiguous subarray of the array.
The first line of input contains the size of the arr...
Find the maximum sum of any contiguous subarray in an array of numbers in O(N) time.
Use Kadane's algorithm to find the maximum subarray sum in O(N) time.
Initialize two variables: maxEndingHere and maxSoFar to keep track of the maximum sum.
Iterate through the array and update the variables accordingly.
Return the maxSoFar as the result.
Ninja is stuck in a maze represented as a binary tree, and he is at a specific node ‘X’. Help Ninja find the shortest path to the nearest leaf node, which is considered an ex...
Find the minimum distance from a given node to the nearest leaf node in a binary tree.
Traverse the binary tree from the given node 'X' to find the nearest leaf node.
Use a queue for level order traversal to efficiently find the nearest leaf node.
Calculate the distance from node 'X' to each leaf node and return the minimum distance.
You are given a grid containing oranges where each cell of the grid can contain one of the three integer values:
Find the minimum time required to rot all fresh oranges in a grid.
Use Breadth First Search (BFS) to simulate the rotting process of oranges.
Track the time taken to rot all fresh oranges and return the result.
If any fresh oranges remain after simulation, return -1 as it is impossible to rot all oranges.
Round duration - 45 minutes
Round difficulty - Medium
Timing: 2:00 pm
Online round over google meet, code at google docs.
The interviewer was friendly, encouraging, and humble.
Given a non-decreasing sorted array ARR
of N
positive numbers, determine the smallest positive integer that cannot be expressed as the sum of elements from...
The task is to find the smallest positive integer value that cannot be represented as a sum of elements of any proper subset of the given array.
The array is sorted in non-decreasing order, so we can iterate through the array and keep track of the maximum sum we can form.
If the current element is greater than the maximum sum + 1, then the maximum sum + 1 is the smallest positive integer that cannot be represented.
If all...
Round duration - 45 minutes
Round difficulty - Medium
Timing: 2:00 pm
Online round over google meet, code at google docs.
The interviewer was not speaking much. It was a bit strange.
Your task is to identify and return the bottom right view of a given binary tree.
This involves viewing the binary tree from an angle of 45 degrees from...
Identify and return the bottom right view of a given binary tree by viewing it from an angle of 45 degrees from the bottom right side.
Traverse the binary tree in a right-to-left manner and keep track of the last node encountered at each level.
Use a queue for level order traversal and update the result array with the last node at each level.
Return the result array sorted in ascending order as the bottom right view of th...
Round duration - 30 Minutes
Round difficulty - Easy
Timing: 7:00 pm
The interviewer was friendly and in a bit of a hurry.
Tip 1 : DSA is the key. Starting from scratch, one can become proficients in a couple of months.
Tip 2 : Solve questions just a bit outside your comfort zone. Solve too easy to too hard questions is not of any use.
Tip 3 : Be consistent, make a habit of following good coding practices.
Tip 4 : Get to know the ins and out of your projects. You must be very confident while explaining those.
Tip 5 : Don't just directly to system-design, brush up on OOPS principles, networks, OS, DBMS before that.
Tip 1: Keep it crisp and to the point. Make bullet points.
Tip 2: Bold the things you want to be paid attention to. Use numbers rather than vague sentences.
Tip 3: Only put the things you are confident about.
Tip 4: Don't put things irrelevant to the job, it only dilutes the main content.
I appeared for an interview before Sep 2020.
Round duration - 70 minutes
Round difficulty - Medium
It consisted of three coding questions varying from easy to medium.
You are provided with the root of a binary tree that consists of 'N' nodes. Each node in this tree contains coins, and the total number of coins across all nodes is equ...
Determine the minimum number of moves required to distribute coins in a binary tree so that every node has exactly one coin.
Traverse the binary tree in a bottom-up manner to distribute coins efficiently.
Keep track of the excess or deficit of coins at each node to calculate the minimum moves required.
Transfer coins from nodes with excess coins to nodes with deficits to balance the distribution.
Example: For the input ROO...
Given an array arr
of N integers that may include duplicates, determine the number of subsets of this array containing only distinct elements.
The result should be returned modulo ...
Count the number of distinct-element subsets in an array modulo 10^9+7.
Iterate through the array and keep track of distinct elements using a set.
Calculate the number of subsets using the formula 2^distinct_count - 1.
Return the result modulo 10^9+7 for each test case.
A thief is robbing a store and can carry a maximal weight 'W' in his knapsack. There are 'N' items, where the i-th item has a weight 'wi' and value 'vi'. Consider the maximu...
The 0-1 Knapsack Problem involves maximizing the value of items a thief can steal within a weight limit.
Use dynamic programming to solve the problem efficiently.
Create a 2D array to store the maximum value that can be achieved at each weight limit.
Iterate through the items and weights to fill the array with optimal values.
Return the maximum value achievable at the given weight limit.
Round duration - 60 minutes
Round difficulty - Medium
The interview was focused on data structures as well as computer fundamentals along with puzzles.
You are given an unsorted array ARR
. Your task is to sort it so that it forms a wave-like array.
The first line contains an integer 'T', the number of test cases.
For ea...
Sort an array in wave form where each element is greater than or equal to its adjacent elements.
Iterate through the array and swap adjacent elements to form a wave pattern.
Ensure that the first element is greater than or equal to the second element.
There can be multiple valid wave arrays, so any valid wave array is acceptable.
You are given a Singly Linked List of integers. Your task is to reverse the Linked List by changing the links between nodes.
The first line of input contai...
Reverse a given singly linked list by changing 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 - 90 minutes
Round difficulty - Easy
The Round was mainly focused on resume+ dsa + system design +computer fundamentals
Given a stream of integers, calculate and print the median after each new integer is added to the stream.
Output only the integer part of the median.
N = 5
Stre...
Calculate and print the median after each new integer is added to the stream.
Use a min heap to store the larger half of the numbers and a max heap to store the smaller half.
Keep the two heaps balanced by ensuring the size difference is at most 1.
If the total number of elements is odd, the median is the top of the larger heap. If even, average the tops of both heaps.
LRU cache in a database management system stores most recently used data and removes least recently used data when full.
LRU cache is implemented using a doubly linked list and a hash map.
Each node in the linked list represents a key-value pair.
When a key is accessed, it is moved to the front of the linked list.
If the cache is full, the least recently used node at the end of the list is removed.
Example: If cache size is...
Use two stacks - one to store actual values and one to store minimum values.
Use two stacks - one to store actual values and one to store minimum values
When pushing a new value, check if it is smaller than the current minimum and push it to the min stack if so
When popping a value, check if it is the current minimum and pop from min stack if so
getMin() operation can be done by peeking at the top of the min stack
Tip 1 : Properly grasp over basic concepts
Tip 2 : Prepare good for DS & Algo as most companies have a separate round for it.
Tip 3 : Don't lie over your resume
Tip 1 : Don't Lie over your resume
Tip 2 : Avoid unnecessary details like Hobbies, family details, declaration, date, signature, etc.
I appeared for an interview in Nov 2020.
Round duration - 70 minutes
Round difficulty - Medium
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.
Traverse through tree T and check if any subtree matches tree S
Use recursion to compare nodes of both trees
Handle edge cases like null nodes and empty trees
Given an integer K
, your task is to produce all binary strings of length 'K' that do not contain consecutive '1's.
The input begins with an integer ...
Generate all binary strings of length 'K' with no consecutive '1's in lexicographically increasing order.
Use backtracking to generate all possible binary strings without consecutive '1's.
Start with an empty string and recursively add '0' or '1' based on the condition.
Keep track of the current string and its length to ensure no consecutive '1's are added.
Sort the generated strings in lexicographically increasing order b...
Round duration - 60 minutes
Round difficulty - Medium
This was a data structures round.
You are provided with an unsorted array/list ARR
of N
integers. Your task is to determine the length of the longest consecutive sequence present in the array...
The task is to find the length of the longest consecutive sequence in an unsorted array of integers.
Iterate through the array and store all elements in a set for constant time lookup.
For each element, check if it is the start of a sequence by looking for element-1 in the set.
If it is the start, keep incrementing the count until the next element is not found in the set.
Given an array of distinct integers, find all possible permutations of the array.
A permutation is a mathematical way of determining the number of possible ar...
Find all possible permutations of an array of distinct integers.
Use backtracking to generate all possible permutations
Swap elements to create different permutations
Return the permutations as an array of arrays of integers
Round duration - 60 minutes
Round difficulty - Easy
This was a data structures round.
Your task is to verify if the given string STR1
is a subsequence of the string STR2
. A subsequence means characters from STR2
are retained in their original order but som...
Verify if a string is a subsequence of another string by checking if characters are retained in order.
Iterate through both strings simultaneously, checking if characters match in order.
If a character in STR1 matches a character in STR2, move to the next character in STR2.
If all characters in STR1 are found in STR2 in order, return True; otherwise, return False.
Given a square array VEC
of integers with N
rows and N
columns, you need to determine the minimum sum of a falling path through this square array. The array has ...
Find the minimum sum of a falling path through a square array by selecting one element from each row with constraints on column selection.
Iterate through the array from the second row, updating each element with the minimum sum of the element and its adjacent elements from the previous row.
The minimum sum path will end in the last row with the minimum value.
Use dynamic programming to efficiently calculate the minimum f...
Round duration - 25 minutes
Round difficulty - Easy
This round was all about OS/DBMS questions.
Tip 1 : Practice atleast 100-150 Medium problems and 20-30 hard problems from leetcode
Tip 2 : Try to give a short contest maybe on leetcode, codeforces or codechef as it is beneficial to crack in Online Test.
Tip 3 : Do atleast 2 projects and ask find answers like why are you choosing this tech stack? why did not you choose its alternatives Know your project in and out because they might ask you an modification in your project.
Tip 1 : Have some projects on resume.
Tip 2 : Do not put false things on resume.
Tip 3 : Try to keep a single page resume.
Tip 4 : If your CGPA is quite low do not mention it on the resume.
Tip 5 : In achievements sections only add relevant achievements. Putting achievements like "won painting competition" or "won dancing competition" wont help.
I applied via Naukri.com and was interviewed in Mar 2021. There was 1 interview round.
Program to create a spiral array using 2D-array
Create a 2D-array with given dimensions
Initialize variables for row, column, and direction
Fill the array in a spiral pattern by changing direction when necessary
Return the spiral array
10-12 Yrs
Not Disclosed
Senior Software Engineer
959
salaries
| ₹24 L/yr - ₹40.9 L/yr |
Software Engineer
338
salaries
| ₹12.9 L/yr - ₹23 L/yr |
Software Engineer2
325
salaries
| ₹14.9 L/yr - ₹26 L/yr |
Consultant
200
salaries
| ₹20 L/yr - ₹35 L/yr |
Lead Software Engineer
182
salaries
| ₹35.7 L/yr - ₹63.2 L/yr |
PayPal
Paytm
FIS
PhonePe