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

SDE - 1

Kempston
upvote
share-icon
3 rounds | 5 Coding problems

Interview preparation journey

expand-icon
Journey
When I joined college, I was unaware of data structures and algorithms, which made my journey to getting an internship more complicated. From that point, I started doing questions on coding platforms.
Application story
This was an online contest in which all students around India can participate in it.
Why selected/rejected for the role?
I was rejected because I have a good history of content preparation and I do not have a decent rank in coding platforms.
Preparation
Duration: 6 months
Topics: Data Structures, Pointers, OOPS, System Design, Algorithms, Dynamic Programming
Tip
Tip

Tip 1: Practice on coding platforms and solve medium-level problems.

Tip 2: Brush up on computer fundamentals from subjects like OS, DBMS, and CN.

Tip 3: Have a good project or internship experience and possess in-depth knowledge about your work.

 

 

Application process
Where: Campus
Eligibility: No criteria
Resume Tip
Resume tip

Tip 1: Have some projects on your resume.

Tip 2: Do not put false information on your resume.

Interview rounds

01
Round
Medium
Video Call
Duration75 minutes
Interview date23 Jun 2023
Coding problem2

1. Reverse List In K Groups

Hard
15m average time
85% success
0/120
Asked in companies
SAP LabsSamsungIBM

You are given a linked list of 'n' nodes and an integer 'k', where 'k' is less than or equal to 'n'.


Your task is to reverse the order of each group of 'k' consecutive nodes, if 'n' is not divisible by 'k', then the last group of nodes should remain unchanged.


For example, if the linked list is 1->2->3->4->5, and 'k' is 3, we have to reverse the first three elements, and leave the last two elements unchanged. Thus, the final linked list being 3->2->1->4->5.


Implement a function that performs this reversal, and returns the head of the modified linked list.


Example:
Input: 'list' = [1, 2, 3, 4], 'k' = 2

Output: 2 1 4 3

Explanation:
We have to reverse the given list 'k' at a time, which is 2 in this case. So we reverse the first 2 elements then the next 2 elements, giving us 2->1->4->3.


Note:
All the node values will be distinct.


Problem approach

We can use recursion to solve this problem.
The main idea is to reverse the first ‘K’ nodes ourselves and let the recursive function reverse the rest of the linked list.
Let reverseList() be the recursive function that takes the head of the linked list and ‘K’ as the parameters.
Now we can iteratively reverse the linked list's first ‘K’ nodes.
And then if we still have some nodes left in the linked list, we can call reverseList(), until the nodes are exhausted.

Try solving now

2. Height of Binary Tree

Easy
15m average time
80% success
0/40
Asked in companies
GrabBarclaysAmazon

The height of a tree is equal to the number of nodes on the longest path from the root to a leaf.


You are given an arbitrary binary tree consisting of 'n' nodes where each node is associated with a certain value.


Find out the height of the tree.


Example :
Input: Let the binary tree be:

Output: 2

Explanation: The root node is 3, and the leaf nodes are 1 and 2.

There are two nodes visited when traversing from 3 to 1.
There are two nodes visited when traversing from 3 to 2.

Therefore the height of the binary tree is 2.
Problem approach

To find the depth of the tree, We will do the DFS on the tree starting from the root node. 

In DFS, we visit all the nodes (child and grandchild nodes) of one child node before going to the second child node, which will help us determine the tree's height. We will take the maximum of both the child’s height.

We will go to the left node and increase one if it is not NULL and do DFS on the left node, the similar thing we will do on the correct node and return the max of the left and right nodes.

Try solving now
02
Round
Easy
Video Call
Duration90 minutes
Interview date23 Jun 2023
Coding problem2

1. Sort An Array of 0s, 1s and 2s

Easy
10m average time
90% success
0/40
Asked in companies
DelhiveryInfo Edge India (Naukri.com)IBM

You have been given an array/list 'arr' consisting of 'n' elements.


Each element in the array is either 0, 1 or 2.


Sort this array/list in increasing order.


Do not make a new array/list. Make changes in the given array/list.


Example :
Input: 'arr' = [2, 2, 2, 2, 0, 0, 1, 0]

Output: Final 'arr' = [0, 0, 0, 1, 2, 2, 2, 2]

Explanation: The array is sorted in increasing order.
Problem approach

We can sort the array in one-pass by maintaining three positional pointers ‘zeroPos’, ‘onePos’ and ‘twoPos’ initialised to 0, 0 and N-1, respectively.

Try solving now

2. Maximum Subarray Sum

Moderate
35m average time
81% success
0/80
Asked in companies
HCL TechnologiesInformaticaSamsung

You are given an array 'arr' of length 'n', consisting of integers.


A subarray is a contiguous segment of an array. In other words, a subarray can be formed by removing 0 or more integers from the beginning and 0 or more integers from the end of an array.


Find the sum of the subarray (including empty subarray) having maximum sum among all subarrays.


The sum of an empty subarray is 0.


Example :
Input: 'arr' = [1, 2, 7, -4, 3, 2, -10, 9, 1]

Output: 11

Explanation: The subarray yielding the maximum sum is [1, 2, 7, -4, 3, 2].
Problem approach

The simple idea of Kadane’s algorithm is to look for all positive contiguous segments of the array. By using Kadane's Algo I Solved this problem.

Try solving now
03
Round
Easy
HR Round
Duration25 minutes
Interview date23 Jun 2023
Coding problem1

1. Basic HR Questions

Tell me about yourself.
Why should I hire you?
What are your strengths and weaknesses?
Why do you want to work at our company?

Here's your problem of the day

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

Skill covered: Programming

What is recursion?

Choose another skill to practice
Similar interview experiences
SDE - 1
3 rounds | 5 problems
Interviewed by Kempston
905 views
0 comments
0 upvotes
SDE - 1
3 rounds | 6 problems
Interviewed by Kempston
679 views
0 comments
0 upvotes
SDE - 1
3 rounds | 5 problems
Interviewed by Kempston
409 views
0 comments
0 upvotes
company logo
SDE - 1
3 rounds | 9 problems
Interviewed by Salesforce
3452 views
0 comments
0 upvotes
Companies with similar interview experiences
company logo
SDE - 1
5 rounds | 12 problems
Interviewed by Amazon
114579 views
24 comments
0 upvotes
company logo
SDE - 1
4 rounds | 5 problems
Interviewed by Microsoft
57825 views
5 comments
0 upvotes
company logo
SDE - 1
3 rounds | 7 problems
Interviewed by Amazon
34961 views
7 comments
0 upvotes