Filter interviews by
Clear (1)
Good problems related to array or string
I applied via LinkedIn and was interviewed before Dec 2023. There were 3 interview rounds.
Aptitude along with English and comprehensive questions
Three coding questions one easy one medium one hard
I was interviewed in Apr 2021.
Round duration - 135 minutes
Round difficulty - Hard
The Technical Round was of 2 hours 15 minutes and was conducted on HackerRank. It comprised of 5 sections:
Programming – 30 minutes: 2 easy to medium level questions (1 of 20 marks other of 30).
Quantitative Aptitude – 25 minutes: 7 Math-related MCQs.
Computer Science – 20 minutes: 8 MCQs based on Computer Science subject topics like OOPs, OS, DBMS, DSA
Advanced Programming – 45 minutes: 1 question on advanced Data Structures (100 marks)
Tell me about Yourself – 15 minutes: 2 essay type questions
Given a positive integer N
, determine the count of all possible positive integral pairs (X, Y)
that satisfy the equation 1/X + 1/Y = 1/N
.
T = 1
N = 2
Count the number of positive integral pairs (X, Y) that satisfy the given equation.
Iterate through all possible values of X and calculate corresponding Y to check if the equation is satisfied.
Optimize the solution by considering the constraints and properties of the equation.
Handle special cases like when N is 1 or when X and Y are equal.
Use mathematical properties to reduce the number of calculations needed.
Consider e
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...
Level order traversal of a binary tree is returned for each test case.
Implement a function to perform level order traversal of a binary tree
Use a queue data structure to keep track of nodes at each level
Print the node values in level order traversal
You are provided with a 2-D matrix called MAT
consisting solely of 0s and 1s. Each row of the matrix can be viewed as a binary number, and the aggregate sum of these binary nu...
Given a binary matrix, maximize the score by toggling rows or columns to convert them to binary numbers and summing them up.
Iterate through each row and column to calculate the score of toggling that row or column
Keep track of the maximum score obtained by toggling rows or columns
Return the maximum score obtained
Round duration - 11 hours
Round difficulty - Easy
Finally, I was selected for the interview round which was conducted virtually over zoom.I had 4 rounds spanning over a period of almost 11 hours (10 AM- 9 PM) with breaks in between rounds, of course. As each of these rounds was an elimination round candidate had 1 to 4 rounds. In the end, we were 13 students left out of 65 students.
Given a string str
and a string pat
, where str
may contain wildcard characters '?' and '*'.
If a character is '?', it can be replaced with any single character....
Given a string with wildcard characters, determine if it can be transformed to match another string under given rules.
Iterate through both strings simultaneously, handling wildcard characters '?' and '*' accordingly.
Use dynamic programming to keep track of matching characters.
Handle '*' by considering all possibilities of matching sequences.
Return true if at the end both strings match, false otherwise.
Given ‘N’ horses running in separate lanes, each horse's finish time is provided in an array. You are tasked to process 'Q' queries. For each query, determine the time take...
Given finish times of horses, find fastest horse in specified lane ranges for multiple queries.
Iterate through each query and find the minimum finish time within the specified range.
Use a loop to process each test case and query efficiently.
Ensure to handle edge cases like empty ranges or invalid inputs.
Optimize the solution to handle large input sizes efficiently.
Given an array/list of strings STR_LIST
, group the anagrams together and return each group as a list of strings. Each group must contain strings that are anagrams of each other.
Group anagrams together in a list of strings.
Iterate through the list of strings and sort each string to group anagrams together.
Use a hashmap to store the sorted string as key and the original string as value.
Return the values of the hashmap as the grouped anagrams.
Tip 1 : Be thorough with data structures and algorithms. Avoid just switching between different coding platforms according to people's suggestion instead pick one and stick to it(Leetcode worked for me!).
Tip 2 : Do not miss out on core subjects (for GS ,OOPs and Operating systems especially).
Tip 3 : Keep giving mock interviews (take at least 2 -3 prior to real one) ,it helps a lot to prevent last-minute interview anxieties and makes you feel prepared and confident.
Tip 1 : Choose the right format, it should reflect professionalism.Goldman Sachs blog suggests to arrange your resume with your educational information at the top,followed by your grade-point average,professional experience, projects and any special interests and activities or achievements.
Tip 2 : If you do not have any prior experience, solidify your projects section(3-4 is a good number).Articulate your project description in a precise and crisp format.
Tip 3 : Come up with three reasons why you should be picked for the job in accordance with job's description —these will be some of the top traits you’ll want to emphasize in your resume.
Tip 4 : Go through company's career blogs ,might give you relevant insights on what it expects then align your presentation in accordance with in.(Link to GS blog on resume tips:https://www.goldmansachs.com/careers/blog/posts/resume-tips-from-goldman-sachs.html )
I was interviewed in Mar 2021.
Round duration - 90 minutes
Round difficulty - Medium
This test was conducted on the Hackerrank platform, it was divided into 6 sections which contained a total of 66 questions with an overall time limit of 90 minutes, There was video proctoring, and changing sections were allowed.
The sections were-
Numerical Computations — 8 questions
Numerical Reasoning -12 questions
Comprehension — 10 questions
Abstract Reasoning — 12 questions
Diagrammatic Reasoning — 12 questions
Logical Reasoning — 12 questions
Given an integer number num
, your task is to convert 'num' into its corresponding word representation.
The first line of input contains an integer ‘T’ denoting the number o...
Convert a given integer number into its corresponding word representation.
Implement a function that takes an integer as input and returns the word representation of the number in English lowercase letters.
Break down the number into its individual digits and convert each digit into its corresponding word form.
Handle special cases like numbers between 10 and 19, multiples of 10, and numbers with zeros in between.
Concaten...
Round duration - 45 Minutes
Round difficulty - Easy
The interview started at 12 in the noon.
The interviewer seemed very cheerful. He began by greeting and asked me for a quick introduction.
Then he talked about the various projects I have mentioned in my resume and what further improvements I was going to make in my projects. Further he started asking questions on fundamentals of Data Structures and Algorithms, few questions on operating syatem and gave a problem statement on DSA.
You are provided with an array ARR
consisting of N
distinct integers in ascending order and an integer TARGET
. Your objective is to count all the distinct pairs in ARR
whose sum...
Count distinct pairs in an array whose sum equals a given target.
Use two pointers approach to iterate through the array and find pairs with sum equal to target.
Keep track of visited elements to avoid counting duplicate pairs.
Return -1 if no such pair exists with the given target.
Tip 1 : Be honest about your skills and work experiences,especially prepare a good answer for the question "Tell me about yourself"
Tip 2 : Take whatever guidance you can get from seniors, faculty and your mentors.
Tip 3 : work on dynamic projects
Tip:4 : Try to write good and effective answers for the paragraph-based questions in the technical round.
Tip:5 : At the end always ask questions to the interviewer which shows your passion and interest to work in the company
Tip:6 : Always do some background search on the company you are applying for.
Tip 1 : Being honest about your achievements and projects
Tip 2 : Do not mention unnecessary details, only relevant details and information about the post you are applying for must be mentioned in your resume.
Tip 3 : Mention your unique qulities.
Tip 4 : Include 5-10 skills in the resume, and do highlight your most important skills and achievements.
Goldman Sachs interview questions for designations
I was interviewed in Feb 2021.
Round duration - 90 minutes
Round difficulty - Hard
Timing was 10 AM. Environment was very well. Questions were well explained.
You are provided with ‘N’ types of umbrellas, where each umbrella type can shelter a certain number of people. Given an array UMBRELLA
that indicates the number of people each um...
Given 'N' types of umbrellas with different capacities, find the minimum number of umbrellas required to shelter exactly 'M' people.
Iterate through the umbrella capacities and try to cover 'M' people using the minimum number of umbrellas.
Sort the umbrella capacities in descending order to optimize the solution.
If it is not possible to cover 'M' people exactly, return -1.
Prateek is a kindergarten teacher with a mission to distribute candies to students based on their performance. Each student must get at least one candy, and if two s...
The task is to distribute candies to students based on their performance while minimizing the total candies distributed.
Create an array to store the minimum candies required for each student.
Iterate through the students' ratings array to determine the minimum candies needed based on the adjacent ratings.
Consider both left-to-right and right-to-left passes to ensure fair distribution.
Keep track of the total candies dist
Tip 1 : Aptitude is must.
Tip 2 : Practice puzzle problems.
Tip 3 : Do atleast 2 projects.
Tip 1 : Keep it short.
Tip 2 : Have some projects on resume.
Get interview-ready with Top Goldman Sachs Interview Questions
I was interviewed in Feb 2021.
Round duration - 90 minutes
Round difficulty - Hard
Timing was 10 AM. Environment was very well. Questions were well explained.
You are provided with ‘N’ types of umbrellas, where each umbrella type can shelter a certain number of people. Given an array UMBRELLA
that indicates the number of people each um...
The problem involves finding the minimum number of umbrellas required to shelter a specific number of people based on the capacity of each umbrella.
Iterate through the array of umbrella capacities and try to cover the required number of people.
Keep track of the minimum number of umbrellas used to cover the people.
If it is not possible to cover the exact number of people, return -1.
Return the minimum number of umbrellas
Find the minimum number of swaps required to sort a given array of distinct elements in ascending order.
T (number of test cases)
For each test case:
N (siz...
The minimum number of swaps required to sort a given array of distinct elements in ascending order.
Use a graph-based approach to find cycles in the array
Count the number of swaps needed to fix each cycle
Sum up the swaps needed for all cycles to get the total minimum swaps
Tip 1 : Aptitude is must.
Tip 2 : Practice puzzle problems.
Tip 3 : Do atleast 2 projects.
Tip 1 : Keep it short.
Tip 2 : Have some projects on resume.
I was interviewed in Jan 2021.
Round duration - 120 minutes
Round difficulty - Easy
This round was held in the evening at 6 o'clock on Hackerrank. It had coding questions: easy, medium, and hard level and MCQ's ( 1 minute for each MCQ). Negative marking was also there
Given a column title as it appears in an Excel sheet, return its corresponding column number.
"AB"
28
Column title "AB" co...
Convert Excel column title to corresponding column number
Iterate through the characters in the column title from right to left
Calculate the corresponding value of each character using its position in the alphabet
Multiply the value by 26 raised to the power of its position from right
Sum up all the values to get the final column number
In a game leaderboard, scores determine rankings where the highest score gets rank 1. Players with identical scores share the same rank, followed by the next ran...
Implement a function to determine a player's leaderboard rank for each game score.
Iterate through the game scores and compare them with the leaderboard scores to determine the rank.
Handle cases where players have identical scores by assigning them the same rank.
Ensure the leaderboard scores are in descending order and game scores are in ascending order.
Return the ranks for each game score in an array.
Round duration - 30 minutes
Round difficulty - Easy
This was an interview round ( technical round) that was held on video-call and a coding platform was also shared. The interviewer was very friendly with me . She was praising me on every solution that I provided.
You are given a multi-level linked list of N nodes, where each node can have two pointers: next and child. Flatten this multi-level linked list into a singly linked lis...
Flatten a multi-level linked list into a singly linked list and return the head of the flattened list.
Traverse the linked list in level order
Use a stack to keep track of nodes with child pointers
Merge the child nodes into the main list
Imagine there are 'N' people at a party, each assigned a unique ID from 0 to N-1. A celebrity at the party is a person who is known by everyone but knows no one else.
Identify the celebrity at a party where one person knows everyone but is not known by anyone.
Use a two-pointer approach to eliminate non-celebrities.
Start with two pointers at the beginning and end, move them based on 'knows' results.
If A knows B, A cannot be the celebrity; move A pointer. If A does not know B, B cannot be the celebrity; move B pointer.
Repeat until only one person remains, check if this person is known...
Round duration - 35 minutes
Round difficulty - Easy
This was an interview round ( technical round) that was held on video-call and a coding platform was also shared. The interviewer was very friendly with me . She was praising me on every solution that I provided.
Create a HashSet data structure without using any built-in hash table libraries.
1) Constructor: Initializes the data members as required.
2) add(value): Inserts...
Design a HashSet data structure with add, contains, and remove functions.
Implement a HashSet using an array of linked lists to handle collisions.
Use a hash function to determine the index in the array for each element.
For add function, check if the element already exists before inserting.
For contains function, search for the element in the corresponding linked list.
For remove function, find and remove the element from ...
Round duration - 20 minutes
Round difficulty - Easy
Online HR+Technical Round .
Tip 1 : Practice DP based questions as much as you can. Also, be confident during the interview about your solution. For practice, you can prefer Coding Ninjas and Geeks For Geeks.
Tip 2 : They do not judge you upon the number of internships you have done or the number of projects you have made. A single ,good-quality project is sufficient, provided you have in-depth knowledge about it. What matters to them is how efficient learner you are, how good is your problem-solving skill and also how confident you are with your answers.
Tip 3 : Practice topic -wise questions, participate in lots of coding contests, watch lots of Youtube solutions even after you could solve a question, because you may find a different approach that is efficient than yours and watching video solutions is always a better option than just reading the solution , as it gives a clear and deeper understanding of the logic's . Also pray hard along with your preparation.
Tip 1 : Keep it short. Mention the academic and professional projects you've done. Add your educational details properly with percentage or CGPA obtained.
Tip 2 : Keep your resume short and clear. Mention your projects and internships with a brief description and year of completion. Mention coding languages are known to you, or other technical skills that you are good at. Do not mention anything that you are not good at. Highlight the topics that you are really good at.
Tip 3 : Be very honest and figure out only those things in your resume that you really know. Anything extra or unknown may have a negative impact upon your interview if asked by the interviewer.
I was interviewed in Feb 2021.
Round duration - 90 minutes
Round difficulty - Medium
It was on done in hackerrank
Given a matrix ARR
of dimensions N * M
, your task is to determine the rank of the matrix ARR
.
The rank of a matrix is defined as:
(a) The maximum number of linearly...
Calculate the rank of a matrix based on the number of linearly independent column or row vectors.
Determine the rank of the matrix by finding the maximum number of linearly independent column vectors or row vectors.
Check for linear independence by verifying if there is a nontrivial linear combination that equates to the zero vector.
Implement a function that takes the matrix dimensions and elements as input and returns t
Determine how many triangles exist in an undirected graph. A triangle is defined as a cyclic path of length three that begins and ends at the same vertex.
Count the number of triangles in an undirected graph using adjacency matrix.
Iterate through all possible triplets of vertices to check for triangles.
For each triplet, check if there are edges between all three vertices.
Increment the count if a triangle is found.
Return the total count of triangles for each test case.
Round duration - 20 minutes
Round difficulty - Medium
Interviewer was quite friendly
Tip 1 : start from scratch
Tip 2 : practice as much as u can
Tip 1 : some students add fake internships to their resume dont do it.
Tip 2 : Don't Put Everything on There. Your resume should not have every work experience you've ever had listed on it.
I was interviewed in Nov 2020.
Round duration - 120 minutes
Round difficulty - Medium
A 120-minute online test was conducted on HackerRank which had the following format:
1st Section :
2 Coding questions(30 minutes)
2nd Section :
10 MCQ questions(30 minutes)
3rd Section :
1 Advanced Programming Question(45 minutes)
4th Section :
2 Subjective Questions(15 minutes)
The coding questions and MCQ questions were a bit tricky so you need to manage your time properly and try to solve all the questions correctly..
Technical – included c and c++ output question, os(scheduling, semaphore), dbms(normal form, etc).
Find the number of ways the given number 'N' can be expressed as the sum of two or more consecutive natural numbers.
N = 9
2
Find the number of ways a given number can be expressed as the sum of two or more consecutive natural numbers.
Use a sliding window approach to iterate through all possible consecutive sums.
Keep track of the sum of the current window and adjust the window size accordingly.
Count the number of valid consecutive sum representations of the given number.
Example: For N = 9, valid representations are 2 + 3 + 4 and 4 + 5, so th
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 - element) exists in the hashmap.
Increment the count of pairs if the complement exists in the hashmap.
Round duration - 45 minutes
Round difficulty - Medium
interview started with a typical tell me about yourself question. The interviewer was nice and friendly.
He asked me to explain a little about my projects (only basics).
Which all data structures you know and my favourite data structure. I replied with a linked list.
He asked the difference between array and linked list, time complexities of insertion, deletion, etc. in both of them. Then he asked about sorting an array, different algorithms, and their time complexities.
How would you sort a linked list? How would you find the middle of the linked list in one pass? How would you merge two linked lists (I had to write code for the same)?
Then he asked how would you be able to manage the business and finance decisions at GS.
Tell me an incident when you had the chance to display your leadership skills.
Lastly, I was allowed to ask questions from the interviewer.
Determine if two nodes in a binary tree are cousins. Nodes are considered cousins if they are at the same level and have different parents.
In a binary tree, e...
Determine if two nodes in a binary tree are cousins based on level and parent criteria.
Traverse the tree to find the levels and parents of the given nodes.
Check if the nodes are at the same level and have different parents.
Return 'YES' if the nodes are cousins, 'NO' otherwise.
Round duration - 45 minutes
Round difficulty - Medium
This round was relatively short and mostly consisted of coding (on hackerrank’s codepair platform)
The interviewer asked me about my previous interview and what all questions were asked in it.
Then there was a discussion about my projects and the technologies used in them. How would you deploy an application and what happens in the process of entering a keyword in the browser and loading your requested page?
He asked me to write the code for finding the middle of a linked list in one pass.
After that, I had to write the code for the implementation of a queue. I first discussed the approaches with him using array and linked lists for some time. They wrote the code using a linked list by taking head and tail pointer.
He was satisfied with it and the round ended with me asking him the questions I had.
You are given the head node of a singly linked list. Your task is to return a pointer pointing to the middle of the linked list.
If there is an odd number of elements, return the ...
Return the middle element of a singly linked list, or the one farther from the head if there are even elements.
Traverse the linked list with two pointers, one moving twice as fast as the other
When the fast pointer reaches the end, the slow pointer will be at the middle
If there are even elements, return the one that is farther from the head node
Handle edge cases like linked list of size 1 or empty list
Tip 1 : Revise all the coding interview questions that you have solved so far in the last few days
Tip 2 : Practice writing the codes on paper with clarity
Tip 3 : Mention only those thing that you know in your CV and revise your projects nd everything you have mentioned on your resume thoroughly.
Tip 1 : Do not even mention topics you have no idea about
Tip 2 : you should have some projects on resume and you should be able to explain clearly why you have chosen the particular project, what does it do, its functionality, outcomes and everything about each of the projects.
Tip 3 : Tailor your resume according to the needs/the role you are applying for
I was interviewed in Oct 2020.
Round duration - 90 minutes
Round difficulty - Medium
This round was scheduled in the evening hours at the Hackerrank platform which is a very famous platform known for conducting coding tests. All the participants were required to fill a form which was shared 2 days prior to the test date. This form was filled out probably for the security reasons and to ensure that no one disinterested participant gives the test.
Given a binary tree with integer values assigned to each node, select nodes such that their sum is maximum, ensuring no two adjacent nodes are picked.
Find the maximum sum of non-adjacent nodes in a binary tree.
Use dynamic programming to keep track of the maximum sum at each node considering whether to include or exclude the current node.
Recursively traverse the binary tree while keeping track of the maximum sum of non-adjacent nodes.
Consider the cases where the current node is included in the sum or excluded from the sum to calculate the maximum possible sum.
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 the left and right subtrees are also binary search trees.
Example: For a node with data 4, left subtree nodes should be less than 4 and righ
Round duration - 45 minutes
Round difficulty - Medium
There were two interviewers for this round, one male and one female. Both of them were very helpful and energetic. They continuously thrown tricky questions/situations towards me and then were giving feedback as well on my answers and were talking about the pros and cons of each and every event. To be honest I felt very happy after talking to them. And yes it seemed to be quiet difficult during the initial minutes but then later on, everything was easy.
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 up to the specified value.
Iterate through each denomination and update the array accordingly.
The final answer will be in the last cell of the array.
Example: For N=3, D=[1, 2, 3], V...
Tip 1 : Practice all DSA questions from interview bit
Tip 2 : Do Atleast 3 project one should be major, if it's in web dev it would be beneficial.
Tip 3 : Should be good in communication skills
Tip 1 : Not more than 1 page
Tip 2 : Have atleast 3 projects with some achievement in coding contest and your coding handle should be mentioned like codechef, codeforces etc
Tip 3 : Try to keep only those things in resume in which you find yourself comfortable with
Top trending discussions
based on 2 interviews
3 Interview rounds
Associate
2.3k
salaries
| ₹0 L/yr - ₹0 L/yr |
Analyst
1.7k
salaries
| ₹0 L/yr - ₹0 L/yr |
Vice President
1.6k
salaries
| ₹0 L/yr - ₹0 L/yr |
Senior Analyst
1.1k
salaries
| ₹0 L/yr - ₹0 L/yr |
Financial Analyst
325
salaries
| ₹0 L/yr - ₹0 L/yr |
JPMorgan Chase & Co.
Morgan Stanley
TCS
Amazon