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

SDE - Intern

Naspers
upvote
share-icon
2 rounds | 4 Coding problems

Interview preparation journey

expand-icon
Journey
I started preparation in my first year of college. Then, I started practicing the DSA regularly from the coding Ninjas platform CodeStudio.
Application story
This was an on-campus opportunity company that visited my college for the placement and took an OA exam after they scheduled the interview.
Why selected/rejected for the role?
I was rejected because i was not able to solve all the coding questions on time.
Preparation
Duration: 6 months
Topics: Data Structures, Pointers, OOPS, System Design, Algorithms, Dynamic Programming,System Design
Tip
Tip

Tip 1 - Practice at least 250 Questions.
Tip 2 - Do at least 2 projects.

Application process
Where: Campus
Eligibility: Above 8 CGPA
Resume Tip
Resume tip

Tip 1: Have some projects on resume.
Tip 2: Do not put false things on resume.

Interview rounds

01
Round
Easy
Video Call
Duration60 mins
Interview date16 Jun 2022
Coding problem2

1. Minimum Spanning Tree

Moderate
34m average time
0/80
Asked in companies
AmazonWells FargoMicrosoft

You are given an undirected, connected and weighted graph G(V, E), consisting of V number of vertices (numbered from 0 to V-1) and E number of edges.

Find and print the total weight of the Minimum Spanning Tree (MST) using Kruskal's algorithm.

By definition, a minimum weight spanning tree is a subset of the edges of a connected, edge-weighted undirected graph that connects all the vertices together, without any cycles and with the minimum possible total edge weight.

Problem approach

You are given an undirected, weighted graph consisting of ‘N’ vertices and ‘M’ edges. Your task is to select 'N' - 1 edge such that a path exists between each pair of vertices and the weight of the spanning tree of the graph is minimum.

Try solving now

2. Connect MidPoints

Easy
15m average time
86% success
0/40
Asked in companies
OYOPhonePeShareChat

You have been given a curve whose edges are parallel to either x-axis or y-axis. You need to return another curve which will pass through the midpoints of all the edges of the curve. The curve will be given in the form of a linked list, where each node represents the coordinates of the curve.

The curve to be returned will also be in the form of a linked list, where each node may represent the coordinates of the midpoints of the edges.

Note
1. The coordinates of the curve will be given in non-descending order of x coordinate from start to end of the linked list and for every two adjacent coordinates either the x-coordinate or the y-coordinate will be the same.
2. All the coordinates will be pairwise distinct i.e there are no two coordinates (x1, y1) and (x2, y2) such that x1 = x2 and y1 = y2.
3. The first coordinate and the last coordinate in the input can be assumed as the starting point and the ending point of the curve respectively.
4. You may assume that the starting point and ending point of the curve will be the midpoint of the first edge, and the last edge of the input curve( in the order of input coordinates) respectively.
5. If the coordinates of the midpoint are not whole numbers, you may take the floor value of the coordinates. For example, the midpoint (3.5, 5) will be taken as (3, 5).
Problem approach

You have been given a curve whose edges are parallel to either x-axis or y-axis. You need to return another curve which will pass through the midpoints of all the edges of the curve. The curve will be given in the form of a linked list, where each node represents the coordinates of the curve.

Try solving now
02
Round
Easy
Video Call
Duration60 minutes
Interview date16 Jun 2022
Coding problem2

1. Maximum Subarray Sum Queries

Hard
45m average time
55% success
0/120
Asked in companies
GrofersFreshworksShareChat

Given an array of ‘N’ integers and ‘Q’ queries. The query is defined as below :-

Given 2 integers ‘l’ and ‘r’ (‘l’ >= 0 and ‘r’ < N) find the maximum subarray sum between ‘l’ to ‘r’ (Inclusive).

Query( ‘l’ ,’r’) = max(arr[i] + arr[i+1] +...arr[j].( i >= ‘l’ and j <= ‘r’)

Problem approach

Given an array of ‘N’ integers and ‘Q’ queries. The query is defined as below :-
Given 2 integers ‘l’ and ‘r’ (‘l’ >= 0 and ‘r’ < N) find the maximum subarray sum between ‘l’ to ‘r’ (Inclusive).
Query( ‘l’ ,’r’) = max(arr[i] + arr[i+1] +...arr[j].( i >= ‘l’ and j <= ‘r’)

Try solving now

2. Detect Cycle in a Directed Graph

Moderate
30m average time
75% success
0/80
Asked in companies
OLX GroupSamsung ElectronicsSamsung

You are given a directed graph having ‘N’ nodes. A matrix ‘EDGES’ of size M x 2 is given which represents the ‘M’ edges such that there is an edge directed from node EDGES[i][0] to node EDGES[i][1].

Find whether the graph contains a cycle or not, return true if a cycle is present in the given directed graph else return false.

For Example :
In the following directed graph has a cycle i.e. B->C->E->D->B.

alt text

Note :
1. The cycle must contain at least two nodes.
2. It is guaranteed that the given graph has no self-loops in the graph.
3. The graph may or may not be connected.
4. Nodes are numbered from 1 to N.
5. Your solution will run on multiple test cases. If you are using global variables make sure to clear them.
Problem approach

Given a directed graph, check whether the graph contains a cycle or not. Your function should return true if the given graph contains at least one cycle, else return false.

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

What is recursion?

Choose another skill to practice
Similar interview experiences
company logo
SDE - 1
3 rounds | 7 problems
Interviewed by OYO
4657 views
0 comments
0 upvotes
company logo
SDE - Intern
2 rounds | 3 problems
Interviewed by Amazon
961 views
0 comments
0 upvotes
company logo
SDE - 1
2 rounds | 5 problems
Interviewed by Meesho
6450 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 - Intern
3 rounds | 6 problems
Interviewed by Amazon
15481 views
4 comments
0 upvotes
company logo
SDE - Intern
4 rounds | 7 problems
Interviewed by Microsoft
15338 views
1 comments
0 upvotes
company logo
SDE - Intern
2 rounds | 4 problems
Interviewed by Amazon
10142 views
2 comments
0 upvotes