McKinsey & Company interview experience Real time questions & tips from candidates to crack your interview

Software Engineer

McKinsey & Company
upvote
share-icon
2 rounds | 6 Coding problems

Interview preparation journey

expand-icon
Journey
Basically, I completed my M.Tech at IIIT-Delhi. The programming culture there is so great that I started practicing programming in my first year. I have started with basic data structures and gradually increase the difficulty of various problems. In addition, I practiced a lot on different programming platforms and participated in programming competitions on different platforms. So this way I built up the confidence and prepared well for the placement.
Application story
I've applied through On Campus Placement at my college IIIT Delhi. Basically the first round was Online Assessment and got the shortlisting list next day. After that they have conducted Interview process and It was 3 round in one day only. So keep yourself ready for whole day if you have same case as me.
Why selected/rejected for the role?
Actually, I did my best during the interview. However, at some point I feel that my answers did not satisfy the interviewer.I believe that was the reason for my rejection. I was a little nervous because all the round is going to be in one day. Therefore, before going to the interview, it is recommended to get a good rest, not to think about the result and perform well.
Preparation
Duration: 4 Months
Topics: OOPS, Data Structures, Algorithms, Dynamic Programming, Technical Subjects - Operating System, Computer Network, Database Management System, Programming & Data Structure, Aptitude, Puzzles
Tip
Tip

Tip 1 : Prepared well for how to approach the solution of problem.
Tip 2 : Start with bruit-force approach and gradually optimize further.

Application process
Where: Campus
Eligibility: 7 CGPA
Resume Tip
Resume tip

Tip 1 : Whatever you write in resume, make sure you are enough confident and ready to explain it in a detail.
Tip 2 : Keep your resume as simple as possible. Don't go with highly designed format.

Interview rounds

01
Round
Medium
Online Coding Interview
Duration90 minutes
Interview date28 Jul 2022
Coding problem4

It was in the evening 08:00 PM. Environment was quite good and no any additional disturbance was there. Internet connectivity was also decent and I was very confident about this round.

1. 0 1 Knapsack

Moderate
0/80
Asked in companies
Disney + HotstarOptumAmazon

A thief is robbing a store and can carry a maximum weight of ‘W’ into his knapsack. There are 'N' items available in the store and the weight and value of each item is known to the thief. Considering the constraints of the maximum weight that a knapsack can carry, you have to find the maximum profit that a thief can generate by stealing items.

Note: The thief is not allowed to break the items.

For example, N = 4, W = 10 and the weights and values of items are weights = [6, 1, 5, 3] and values = [3, 6, 1, 4]. Then the best way to fill the knapsack is to choose items with weight 6, 1 and 3. The total value of knapsack = 3 + 6 + 4 = 13.

Try solving now

2. Binary Linked List To Integer

Easy
0/40
Asked in companies
MicrosoftFacebookQualcomm

You are given a singly linked list containing ‘n’ nodes, where every node in the linked list contains a pointer “next” which points to the next node in the list and having values either 0 or 1. Your task is to return the decimal representation of the given number in the linked list.

For Example:
n = 4, list: 1 -> 0 -> 1 -> 0.

Now in this example, the value in the linked list is 1010, which is 10 in Decimal.
Hence the answer is 10.
Try solving now

3. SQL Question

SQL -
Query the Name of any student in STUDENTS who scored higher than Marks. Order your output by the last three charactersof each name. If two or more students both have names ending in the same last three characters (i.e.: Bobby, Robby, etc.), secondary sort them by ascending ID.

Problem approach

Only Ashley, Julia, and Belvet have Marks > . If you look at the last three characters of each of their names, there are no duplicates and ‘ley’ < ‘lia’ < ‘vet’.

SELECT NAME FROM STUDENTS WHERE MARKS > 75 ORDER BY RIGHT(NAME, 3), ID ASC;

4. SQL Question

SQL -
Given the CITY and COUNTRY tables, query the names of all the continents (COUNTRY.Continent) and their respective average city populations (CITY.Population) rounded down to the nearest integer.

Note: CITY.CountryCode and COUNTRY.Code are matching key columns.

Problem approach

SELECT Country.Continent, FLOOR(AVG(City.Population))
FROM Country, City 
WHERE Country.Code = City.CountryCode 
GROUP BY Country.Continent ;

02
Round
Medium
Face to Face
Duration60 minutes
Interview date29 Jul 2022
Coding problem2

There were two interviewer taking my interview.

- They have started with Introduction about me and my family.
- The interviewer reviewed my resume and asked me about my projects and OOPs questions.
- Interviewer simply give SQL query to write. It was easy.
- After they have asked question based on my resume and asked me all the project in very detail.
- One puzzle they given to me to resolve. 
- Which tool do you use for version control.
- Some consecutive question on GitHub like what if two person is writing and commit the same file at the same time.

1. Length of the longest substring with the equal number of 1s and 0s.

Moderate
30m average time
70% success
0/80
Asked in companies
Media.netMcKinsey & CompanyFlipkart limited

You are given a binary string 'S' of length 'N'. Your task is to find the length of the longest substring with an equal number of 1s and 0s.

Note:

1. The given string will only contain 0 and 1.
Try solving now

2. Bus Routes

Moderate
30m average time
70% success
0/80
Asked in companies
UberAmerican ExpressMcKinsey & Company

This time Ninja is helping a lost passenger on a bus stop to reach his destiny with the minimum number of buses he needs to change, on the bus stop a chart is present which contains 'N' arrays. An array 'A' denotes the route that a bus will take, such that A[i] denotes the bus stop 'i'th bus will travel to.

For Example
If the bus route is [3, 6, 7], then it will travel  in sequence 
3 > 6 > 7 > 3 > 6 > 7….

You can travel between the bus stations through buses only. You are given the source bus station and destination bus station. You need to determine the minimum number of buses you need to reach the destination. If it is not possible to reach destination return -1.

Note:
Values of A[i] are distinct.
Problem approach

The first part loop on routes and record stop to routes mapping route.
The second part is general bfs. Take a stop from queue and find all connected route.
The hashset seen record all visited stops and we won't check a stop for twice.
We can also use a hashset to record all visited routes, or just clear a route after visit.

Try solving now

Here's your problem of the day

Solving this problem will increase your chance to get selected in this company

Skill covered: Programming

How do you remove whitespace from the start of a string?

Choose another skill to practice
Similar interview experiences
Data Science Intern
3 rounds | 3 problems
Interviewed by McKinsey & Company
1489 views
1 comments
0 upvotes
company logo
SDE - 1
3 rounds | 7 problems
Interviewed by OYO
4898 views
0 comments
0 upvotes
company logo
SDE - 1
2 rounds | 5 problems
Interviewed by Meesho
6638 views
0 comments
0 upvotes
company logo
SDE - 1
3 rounds | 9 problems
Interviewed by Salesforce
3639 views
0 comments
0 upvotes
Companies with similar interview experiences
company logo
Software Engineer
4 rounds | 1 problems
Interviewed by Newgen Software
3266 views
2 comments
0 upvotes
company logo
Software Engineer
3 rounds | 6 problems
Interviewed by HashedIn
2643 views
0 comments
0 upvotes
company logo
Software Engineer
2 rounds | 2 problems
Interviewed by Ernst & Young (EY)
0 views
0 comments
0 upvotes