Filter interviews by
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 mat...
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 valid path to the result list when the destination is reached.
Sort the result list in alphabetical order before returning.
You are given a continuous stream of numbers, and the task is to determine the kth largest number at any moment during the stream.
A specialized data str...
Design a data structure to find the kth largest number in a continuous stream of integers.
Design a specialized data structure to handle continuous stream of numbers
Implement add(DATA) function to add integers to the pool
Implement getKthLargest() function to retrieve the kth largest number
Maintain the pool of numbers and update it based on queries
Output the kth largest number for each Type 2 query
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 inversion condition is 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.
In this problem, you have a one-dimensional garden of length 'N'. Each position from 0 to 'N' has a fountain that can provide water to the garden up to a certain range....
Find the minimum number of fountains to activate to water the entire garden.
Iterate through the array to find the coverage of each fountain.
Keep track of the farthest coverage reached by activating fountains.
Activate the fountain that covers the farthest distance to minimize the number of fountains activated.
Given an array ARR
consisting of N
integers and a non-negative integer K
. An operation on the array replaces each element ELE
with MX - ELE
, where MX
is the maximum element of ...
Given an array and a non-negative integer K, perform K operations on the array by replacing each element with MX - element, where MX is the maximum element of the array.
Find the maximum element in the array.
Perform the operation on each element K times.
Update the array after each operation.
Print the transformed array elements after K operations.
Given an array of positive integers, determine the number of distinct values obtained by applying the bitwise OR operation on all possible subarrays.
Count distinct values obtained by applying bitwise OR operation on all possible subarrays of an array of positive integers.
Use a set to store distinct values obtained by bitwise OR operation on all subarrays.
Iterate through all subarrays efficiently to calculate distinct values.
Optimize the solution to handle large input sizes efficiently.
Handle bitwise OR operation on subarrays using bitwise operators.
Consider us...
You are given a graph with 'N' vertices numbered from '1' to 'N' and 'M' edges. Your task is to color this graph using two colors, such as blue and red, in a way that no two adjacent...
The task is to color a graph with two colors in a way that no two adjacent vertices share the same color.
Check if the graph can be colored using two colors without any adjacent vertices sharing the same color.
Use graph coloring algorithms like BFS or DFS to solve the problem.
If there are odd cycles in the graph, it is not possible to color the graph as described.
If the graph is bipartite, then it is possible to co...
I appeared for an interview before Sep 2020.
Round duration - 90 minutes
Round difficulty - Hard
The test was from 10 pm to 11:30 pm at night, Since we had to give the test from home so it was not an uncomfortable timing for me. The test was conducted on hackerrank. Personally I find Hackerrank a better test platform than others like Amcat or Mettle.
In this problem, you have a one-dimensional garden of length 'N'. Each position from 0 to 'N' has a fountain that can provide water to the garden up to a certain range...
Find the minimum number of fountains to activate to water the entire garden.
Iterate through the array to find the coverage of each fountain.
Keep track of the farthest coverage reached by activating fountains.
Activate the fountain that covers the farthest distance to minimize the number of fountains activated.
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 inversion condition is 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 ARR
consisting of N
integers and a non-negative integer K
. An operation on the array replaces each element ELE
with MX - ELE
, where MX
is the maximum element of...
Given an array and a non-negative integer K, perform K operations on the array by replacing each element with MX - element, where MX is the maximum element of the array.
Find the maximum element in the array.
Perform the operation on each element K times.
Update the array after each operation.
Print the transformed array elements after K operations.
Round duration - 90 minutes
Round difficulty - Hard
This interview was at 10 am in the morning and was taken by a SDE 3 of the company who had a very great background in Competitive Coding.
The interview started with me introducing myself. The interviewer then gave me a google doc which had 2 coding questions written . He asked me to go through the first question and explain the approach. After which he asked me to code the solution as well. Same procedure was followed for the second question. The most difficult part in using Google Doc to write code is that it doesn't has automatic indentation like the code editors, so I had to put much efforts in keeping my code readable.
Given an array of positive integers, determine the number of distinct values obtained by applying the bitwise OR operation on all possible subarrays.
Count distinct values obtained by applying bitwise OR operation on all possible subarrays of an array of positive integers.
Use a set to store distinct values obtained by bitwise OR operation on all subarrays.
Iterate through all subarrays efficiently to calculate distinct values.
Optimize the solution to handle large input sizes efficiently.
Handle bitwise OR operation on subarrays using bitwise operators.
Consider using d...
You are given a graph with 'N' vertices numbered from '1' to 'N' and 'M' edges. Your task is to color this graph using two colors, such as blue and red, in a way that no two adjacen...
The task is to color a graph with two colors in a way that no two adjacent vertices share the same color.
Check if the graph can be colored using two colors without any adjacent vertices sharing the same color.
Use graph coloring algorithms like BFS or DFS to solve the problem.
If there are odd cycles in the graph, it is not possible to color the graph as described.
If the graph is bipartite, then it is possible to color t...
Round duration - 60 minutes
Round difficulty - Hard
The round was at 4 pm evening. This round was taken by one of the Vice President of the company, this made me anxious from the very beginning.
The interviewer was a knowledgeable man and had great knowledge in every field. He always demanded exact answers.
The round started with my resume walk through. Then came open ended questions followed by a system design question in which I failed miserably.
Tip 1 : For company like codenation you need to be great in competitive programming as the online test is very difficult to crack
Tip 2 : Focus on leetcode during final months of preparation of interview
Tip 3 : Try to have at least 3 flagship projects in at least 2 different domains
Tip 1 : Keep the resume clean with good text to space ratio.
Tip 2 : Don't mention tech slacks that you have only a little knowledge about as it can backfire if the interviewer is good in that tech slack.
I appeared for an interview before Sep 2020.
Round duration - 45 Minutes
Round difficulty - Medium
This was a straight coding round with three questions , I was able to solve all 3
You are given a continuous stream of numbers, and the task is to determine the kth largest number at any moment during the stream.
A specialized data st...
Design a data structure to find the kth largest number in a continuous stream of integers.
Design a specialized data structure to handle continuous stream of numbers
Implement add(DATA) function to add integers to the pool
Implement getKthLargest() function to retrieve the kth largest number
Maintain the pool of numbers and update it based on queries
Output the kth largest number for each Type 2 query
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 valid path to the result list when the destination is reached.
Sort the result list in alphabetical order before returning.
Round duration - 60 Minutes
Round difficulty - Medium
As this was my first system design round, I was not expecting to be able to tell anything , but to my surprize he interested in just the idea what I can think , how I can solve some issues which need not be definitely to have a solution / or multiple solutions are possible from common sense.
I was given an Idea based question
Tip 1 : Be focused on the question and keep trying, Project needs to be well understood and somewhat on your tips.
Tip 2 : Don't code till you are sure and got a green signal about the efficiency and correctness of logic
Tip 3 : Just brush up your DS basics and some logical algorithms (Dijkstra, Shortest spanning tree , etc)
Tip 1 : Experience must be highlighted, or the Project whichever you would like to discuss
Tip 2 : Links are always a great way to show your work (deployed/code)
posted on 22 Nov 2015
Top trending discussions
I appeared for an interview in Sep 2020.
Round duration - One hour aptitude,1.5 hour coding
Round difficulty - Medium
First round was of aptitude that was easy and second round was of coding which had medium level questions.
Given a positive integer N
, your task is to identify all prime numbers less than or equal to N
.
A prime number is a natural number greater than 1 that has no po...
Identify all prime numbers less than or equal to a given positive integer N.
Iterate from 2 to N and check if each number is prime
Use the Sieve of Eratosthenes algorithm for efficient prime number identification
Optimize by only checking up to the square root of N for divisors
Round duration - 20 minutes
Round difficulty - Medium
First I was asked about my projects and then 2 questions on array were given.
Given an integer array/list arr
and an integer 'Sum', determine the total number of unique pairs in the array whose elements sum up to the given 'Sum'.
The first line c...
Count the total number of unique pairs in an array whose elements sum up to a given value.
Use a hashmap to store the frequency of each element in the array.
Iterate through the array and for each element, check if (Sum - current element) exists in the hashmap.
Increment the count of pairs if the complement exists in the hashmap.
Divide the count by 2 to avoid counting duplicates (arr[i], arr[j]) and (arr[j], arr[i]) separ...
Tip 1 : Data structures should be on your tips.
Tip 2 : Learn how to make logic.
Tip 3 : Be confident while giving the interview.
Tip 1 : Add projects with description.
Tip 2 : Be true to yourself in resume.
I appeared for an interview in Dec 2020.
Round duration - 30 Minutes
Round difficulty - Easy
he interviews were conducted simultaneously for all on BlueJeans along with a code sharing website. After the initial set up and introduction, a set of 2 questions from DSA were asked from all candidates. The results were announced the same day.
Given an undirected and disconnected graph G(V, E)
, where V
is the number of vertices and E
is the number of edges, the connections between vertices are provided in the 'GR...
DFS traversal to find connected components in an undirected and disconnected graph.
Use Depth First Search (DFS) algorithm to traverse the graph and find connected components.
Maintain a visited array to keep track of visited vertices.
For each unvisited vertex, perform DFS to explore all connected vertices and form a connected component.
Given two sorted arrays A
and B
of sizes N
and M
, find the median of the merged array formed by combining arrays A
and B
. If the total number of elements, N + M
, is even, the m...
Find the median of two sorted arrays by merging them and calculating the middle element(s).
Merge the two sorted arrays into one sorted array.
Calculate the median based on the total number of elements in the merged array.
If the total number of elements is even, take the mean of the two middle elements as the median.
Tip 1 : Don't forget to revise OOPS, OS, DBMS too.
Tip 2 : During the interview, one thing that is asked for sure is the time complexity of your solution, so always know the complexity of your algorithms.
Tip 3 : Try out mock interviews with friends, that's the best thing you can do for yourself other than practicing
questions
Tip 1 : Make sure that there are no formatting errors
Tip 2 : Have your projects clearly mentioned and well explained
I appeared for an interview in Oct 2020.
Round duration - 120 mintues
Round difficulty - Medium
Aptitude round was in afternoon around 3 pm and every person who has given aptitude round was also given an other chance which was coding round. There was a time gap of 1 hr between two test. both of these went online. Environment was good without any lag. Webcam was on throughout the test. There were 3 coding questions, of which 2 were medium and one was easy. I attempted all of them.
You are given a string named str
and an integer D
. Your task is to perform both left (anticlockwise) and right (clockwise) rotations on the given string by D
units, start...
Implement left and right string rotations by D units on a given string.
Implement leftRotate() function to return string after left rotation by D units.
Implement rightRotate() function to return string after right rotation by D units.
Consider handling edge cases like empty string or D exceeding string length.
Example: For input 'coding', D=2, leftRotate() should return 'dingco' and rightRotate() should return 'ngcodi'.
You are provided with the Inorder and Level Order traversals of a Binary Tree composed of integers. Your goal is to determine the height of this Binary Tree without actually construc...
Calculate the height of a Binary Tree given its Inorder and Level Order traversals without constructing it.
Use the properties of Inorder and Level Order traversals to determine the height of the Binary Tree.
The height of a Binary Tree is the number of edges on the longest path from the root to a leaf node.
Consider edge cases like a single node tree or empty tree when calculating the height.
Identify and output the common strings present in both given arrays of lowercase alphabets for each test case.
The first line contains an integer 'T' representin...
The task is to find and output the common strings present in both given arrays of lowercase alphabets for each test case.
Iterate through the elements of the second array and check if they are present in the first array.
Use a hash set or map to efficiently check for common elements.
Return the common strings in the order they appear in the second array.
Round duration - 40 minutes
Round difficulty - Medium
This round was at 12 pm. Interviewer and I greeted each other and then he asked me to explain all the questions I had done during test. He shared screen with my report of test which was having the solutions I typed during coding rounds. It took around 20 minutes to explain all three questions. Interviewer was happy with my explanation. Then he had asked me one coding question and various questions based on my project. I answered him all with a smile.
Given an array arr
of length N
consisting of integers, find the sum of the subarray (including empty subarray) with the maximum sum among all subarrays.
Find the sum of the subarray with the maximum sum among all subarrays in an array of integers.
Use Kadane's algorithm to find the maximum subarray sum efficiently.
Initialize two variables, one for current sum and one for maximum sum.
Iterate through the array and update the current sum and maximum sum accordingly.
Return the maximum sum as the result.
Round duration - 30 minutes
Round difficulty - Medium
It was in afternoon. HR called to me to fix a meeting on Microsoft teams. He was very polite with experience of corporate environment.
Tip 1 : Properly grasp Data Structures and Algorithms from basics. Cramming problems would not help.
Tip 2 : Try platforms like code-zen for practice. Its a good platform with selected questions.
Tip 3 : Do at least 2 projects in which you are confident enough to answer anything the interviewer ask.
Tip 4 : Be confident with a smile on face during interviews.
Tip 1 : Just one page resume, not more than that for freshers.
Tip 2 : Make it as attractive/catchy as you can. Interviewers don't spend much time while reading your resume.
posted on 6 Oct 2023
I applied via Campus Placement and was interviewed before Oct 2022. There were 4 interview rounds.
It was a 2hr test. It had two sections. 1)Quantitative aptitude and verbal ability and 2) Technical aptitude.
DSA questions of array and strings
posted on 16 Jan 2025
I applied via Campus Placement and was interviewed in Jul 2024. There were 2 interview rounds.
It had mcq and 1 hard coding question
based on 5 reviews
Rating in categories
SDE (Software Development Engineer)
13
salaries
| ₹24 L/yr - ₹42 L/yr |
Software Engineer
9
salaries
| ₹30 L/yr - ₹36.5 L/yr |
Software Developer
8
salaries
| ₹30 L/yr - ₹35 L/yr |
Software Development Engineer
8
salaries
| ₹24 L/yr - ₹37 L/yr |
Software Development Engineer II
4
salaries
| ₹10 L/yr - ₹45.5 L/yr |
Teleperformance
Optum Global Solutions
FIS
Nagarro