- Internship, Interview Experiences, Marketing, On-Campus, Sprinklr

Sprinklr Interview Experience | On-Campus

Round One Coding test of 1.5 Hours: It was an online coding test conducted on HackerRank. A test consisting of 3 coding questions. A medical team wants to send a minimum number of workers for vaccinating people in the city, each worker can vaccinate people in an area whose radius is D, and can start from anywhere, an array is given which tells the location of people on X-axis, there is no one on Y-axis, help the medical team to know the minimum number of people needed to vaccinate the whole town.Example : D – 2 ,
arr = {1,2,4,7,8,9,10,12,14,16,18,20}
Output : 4
Explaination :- (1,2,4) , (7,8,9,10) ,
(12,14,16) , (18,20) ,
workers will be divided like this(50 Marks) – O(N) solution accepted(HINT: sort the array and take the group of people in a 2D distance at once)Sprinklr users are seeing some duplicate documents on the platform and we need you to help to detect those documents and remove them. We already have a framework to detect if 2 documents are duplicates or not, what we need from you is how many unique documents are present given pairs of duplicate documents. We also want to query if 2 documents are similar or not(75 Marks)Input Format :-
N : total documents
OPS – total operations

next ops line will contain 3 space
separate integers say(op , doc1 , doc2)
where the first integer (op) denotes
operation type and remaining
two are documents numbers

op = 0 , means next 2 documents are similar

OUTPUT :-
Single integer in new line for every query ,
0 if documents are not duplicate ,
1 if documents are duplicateSingle
integer in new line for every query ,
0 if documents are not duplicate ,
1 if documents are duplicateEXAMPLE :-
10
5
0 1 2
0 5 7
1 1 3
0 2 3
1 1 3OUTPUT :-
0
1
7EXPLAINATION :-
There are total of 10 documents
Given 5 operations are :-
1) Mark the document 1 & 2 duplicate
2) Mark the document 5 & 7 duplicate
3) Query if document 1 & 3 are duplicate ,
hence the first line in output 0
4) Mark the document 2 & 3 duplicate
5) Query if document 1 & 3 are duplicate ,
hence the second line in output 1
Print total unique documents now
(1,2,3) , (5,7) , (4) , (6) , (8) ,
(9) , (10) = total 7 unique documentsHint :-
two ways through which this
problem can be solved
1) using dfs traversal in each query ,
similar to count total number
of connected components
2) using disjoint set union methodMaximise the sumyou will be given N intervals, where i’th interval will start at time Li and will be finished at Ri and contains the special value Ki, You have to select P intervals such that no intervals overlap each other and maximize the sum of special values of the selected P intervals. (100 Marks)Constraints
1