Filter interviews by
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
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...
In the level order traversal, we will be using queue data structure which has the property FIRST IN FIRST OUT that’s why which nodes come first in current level the children of that node will also come first for the next level. So, we visit all the nodes one by one of the current level and push into the queue so that when we will be complete with the current level, then we can start exploring nodes ...
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...
The idea is to use the properties of binary numbers to implement the solution in a brute force manner.
We know that the maximum number of 1s in a binary number will help in increasing the overall sum if they are as left as possible. One important observation that arises from this fact is that the first bit(extreme left) should be made 1 to maximize the number as 4(100) > 3(011). So, if the first column in ...
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....
The idea is pretty straightforward: scan ‘str’ and ‘pat’ while there is a match between the current character of ‘str’ and the current character of ‘pat’. If we reach the end of both strings while there is still a match, return True, otherwise, return False. The scan is done by having a pointer ‘i’ in ‘str’ and a pointer ‘j’ in ‘pat'
Example: = "code"
The character 'c' of 'str matches ...
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...
For each query, we can simply loop between ‘L’ and ‘R’ and store the minimum time taken by a horse to complete the race in a variable, and return the value stored in that variable.
Algorithm for Each Query:
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.
The idea behind this approach is that two or more than two strings are anagrams if and only if their sorted strings are equal. So we will use a HashMap, let’s say “anagramGroup”, where each key is a sorted string, and the key will be mapping to the list of indices from the given list of strings that form a group of anagrams. This means that if we sort the strings at those indices, we will get the ...
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...
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...
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...
Approach: The idea here is to try every possible option and consider the minimum ans.
We have two possible options: either we use the i-th umbrella to cover people or not.
So, the recurrence for the above problem is:
minNumberOfUmbrellas(i, M) = min(minNumberOfUmbrellas(i - 1, M), 1+ minNumberOfUmbrellas(i, M - UMBRELLA[i])).
minNumberOfUmbrellas(i, M) represents 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...
While iterating over the array, check the current element, and if not in the correct place, replace that element with the index of the element which should have come in this place.
Below is the algorithm:
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...
Approach: The idea here is to try every possible option and consider the minimum ans.
We have two possible options: either we use the i-th umbrella to cover people or not.
So, the recurrence for the above problem is:
minNumberOfUmbrellas(i, M) = min(minNumberOfUmbrellas(i - 1, M), 1+ minNumberOfUmbrellas(i, M - UMBRELLA[i])).
minNumberOfUmbrellas(i, M) represents the minimum number of umbrellas...
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...
There can be four cases :
CASE 1: STUDENTS[i - 1] > STUDENTS[i] < STUDENTS[i + 1]
CASE 2: STUDENTS[i - 1] < STUDENTS[i] < STUDENTS[i + 1]
CASE 3: STUDENTS[i - 1] > STUDENTS[i] > STUDENTS[i + 1]
CASE 4: STUDENTS[i - 1] < STUDENTS[i] > STUDENTS[i + 1]
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...
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...
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...
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.
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...
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...
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.
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
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...
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...
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 ...
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
Top trending discussions
based on 2 interviews
3 Interview rounds
Associate
2.5k
salaries
| ₹10.6 L/yr - ₹40 L/yr |
Analyst
1.8k
salaries
| ₹9.6 L/yr - ₹14 L/yr |
Vice President
1.6k
salaries
| ₹18.5 L/yr - ₹72 L/yr |
Senior Analyst
1.1k
salaries
| ₹5 L/yr - ₹20 L/yr |
Financial Analyst
320
salaries
| ₹2 L/yr - ₹8 L/yr |
JPMorgan Chase & Co.
Morgan Stanley
TCS
Amazon