Sprinklr
Sprinklr
Sprinklr
2 Set 2 (On-Campus) 3
Source . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
1
Chapter 1
Source
https://www.geeksforgeeks.org/sprinklr-recruitment-test/
2
Chapter 2
Set 2 (On-Campus)
Source
https://www.geeksforgeeks.org/sprinklr-interview-experience-set-2-on-campus/
3
Chapter 3
4
Chapter 3. Set 3 (On Campus for FTE)
Source
https://www.geeksforgeeks.org/sprinklr-interview-experience-set-3-campus-fte/
5
Chapter 4
1. https://www.geeksforgeeks.org/given-an-array-of-numbers-arrange-the-numbers-to-form-the-biggest-number/
2. I don’t remember.
Round 3:
More Array related questions from geeksforgeeks.
Round 4:
So far experience of previous rounds was asked. It was a puzzle round.
6
Chapter 4. Set 4 (For SDET)
Please Improve this article if you find anything incorrect by clicking on the ”Improve Article”
button below.
Source
https://www.geeksforgeeks.org/sprinklr-interview-experience-set-4-sdet/
7
Chapter 5
Sprinklr Interview Experience | Set 5 (On campus - FTE for Product Engineer) - Geeks-
forGeeks
Online Coding Test (2 hours):
There were 15 MCQs based on Data Structures and Algorithms, JavaScript, c++, Java,
Time Complexity Analysis. 3 coding questions were given.
1) You are given a string consisting lowercase letters. You have to find number of substrings
in which all characters are different.
Constraint: 1 <= length of string N <= 100000
Expected Complexity: O(N)
2) You are given an array. You have to find a subset from this array such that average of
elements of this subset is less than or equal to k.
Constrains: 1 <= length of array N <= 100000, 1 <= k <= 10^9.
Expected Complexity: O(N logN)
3) You are given a graph of n nodes with m bidirectional edges. Each edge has some value
associated with it. Vertex 1 is source vertex. You have K wildcards. In the path from
vertex 1 to vertex i (2 <= i <= n), you can use atmost K wildcards while traversing. When
you use a wildcard on an edge, you can pass that edge in summing the cost of path (i.e.
value of that edge will be 0 if you use a wildcard on an edge). Note: You can use atmost K
wildcard from vertex 1 to vertex 2. Now you can again use atmost K wildcards from vertex
1 to vertex 3 and so on to vertex n. i.e. You can use atmost K wildcards in each path from
source to destination. You have to find minimum distances from node 1 to all other nodes
in graph.
Constraints: 1 <= n,m <= 500000, 1 <= K <= 15
Expected Approach: DP with shortest path algorithms on graph.
Round 1 (Technical):
1) Draw relational schema of your DBMS course project.
2) Write some queries related to your project.
3) What is hashing? What are different schemes for hashing?
8
Chapter 5. Set 5 (On campus – FTE for Product Engineer)
Please Improve this article if you find anything incorrect by clicking on the ”Improve Article”
button below.
Improved By : TapanModi
9
Chapter 5. Set 5 (On campus – FTE for Product Engineer)
Source
https://www.geeksforgeeks.org/sprinklr-interview-experience-set-5-on-campus-fte-for-product-engineer/
10
Chapter 6
1. sum i – In this query you have to print the sum of the sub-tree of the node i including
the node i .
2. update i, k :- In this query you have to increase the value of the i-th node by value k
Question – 2 : Given a string (1-based indexed) having only lowercase english alphabets of
length n . You are given q queries and a range [l, r] with each query . You have to print
count of all the sub-strings which are ending and starting with the same character for each
query.
Example – abacc
3 queries –
12
24
15
Output :-
2
3
7
11
Chapter 6. Sprinklr Internship Interview Experience
Question – 3 : You are given an array a with positive integers . You have to print the size
of the smallest subset such that the bitwise or of the array is maximum.
Example : 5 1 3 4 2
output :- 2
Explanation :- maximum or of array is 7 . subset chosen – [2, 5] or [3, 4].
Round – 2 :- This was an offline technical round which lasted for about half an hour .
Interviewer started with my introduction like tell me about yourself and all that stuff. In
that time he was going through my resume and pointed out my interests in competitive
programming and started with his questions.
Questions in Round 2 :-
1. First question was you are given n balls on the table and all the balls are rolling
towards the one end of the table with velocities V1, V2, V3, V4……Vn and there is a
bucket placed at that end. Distance of the ball with velocity V1 from the end of the
table where bucket is placed is D1 similarly distance of ball with velocity V2 is D2
and so on.. Now it is given that when two balls collide both the balls merge into each
other and move with velocity of the ball nearer to the bucket . So at last you have to
tell the number of the balls which will fall into the bucket..
2. Puzzle :- You have 10 bags full of balls. In each bag are infinite balls. But one bag is
full of forgeries, and you can’t remember which one. But you do know that a genuine
ball weigh 10 gram, but forgeries weigh 5 grams. You have to identify that bag in
minimum readings. You are provided with a digital weighing machine.
3. Then he slightly changed the above puzzle and asked me like if instead of one bag if
two bags have forgeries then in how many minimum number of readings you will find
out the both bags.
4. What is a red-black tree.. Code
5. What is an AVL tree..Code
6. How you will detect a cycle in an directed or undirected graph.
7. You are given a graph with some of its edges are directed and some are un-directed.
You have to return true/false depending upon if you can convert all the undirected
edges in directed ones such that there is no cycle in graph return true else return false..
8. Then he asked me some basic OOPs concepts like :
• what is Encapsulation ?
• What is run-time and compile-time polymorphism ?
• what is data-hiding and how it is helpful. ?
• difference between c++ and java.
12
Chapter 6. Sprinklr Internship Interview Experience
1. Be very strong in competitive programming and data structures and algorithms. Data
structures is the heart of all the companies every company will definitely ask that.
2. Be active on codechef, codeforces or any other competitive coding website and get
familiar with the online ide such that hackerrank, hackerearth most of the company’s
online round will be on hackerrank only.
3. Try to score very good in online coding round because they see your ranks and it
might be very helpful if you scored good in your online round it’ll be definitely a plus
point for you.
4. Try to be confident in front of interviewer . Try to make a friendly environment with
him/her and don’t hesitate to ask hints if you got stuck in any question it will show
your compatible nature.
5. Do some homework about the company like what the company does every HR will ask
that question.
Please Improve this article if you find anything incorrect by clicking on the ”Improve Article”
button below.
Source
https://www.geeksforgeeks.org/sprinklr-internship-interview-experience/
13
Chapter 7
1. First question was you are given n balls on the table and all the balls are rolling
towards the one end of the table with velocities V1, V2, V3, V4……Vn and there is a
bucket placed at that end. Distance of the ball with velocity V1 from the end of the
table where bucket is placed is D1 similarly distance of ball with velocity V2 is D2
and so on.. Now it is given that when two balls collide both the balls merge into each
other and move with velocity of the ball nearer to the bucket . So at last you have
two tell the number of the balls which will fall into the bucket..
2. Then he asked me are you familiar with red-black tree and to implement it
3. Third question was to implement AVL tree.
4. The last question was a graph question . You are given a graph with some edges
directed and some undirected edges. you have to return true if you can make the
undirected edges as directed such that there is no formation of cycle in whole graph
otherwise return false.
Round 2: This was an HR round . She asked me about myself and about my interests
and my hobbies.. Then she asked me about the company like in which field they are active
who are their clients all that stuff ..
Please Improve this article if you find anything incorrect by clicking on the ”Improve Article”
button below.
Source
https://www.geeksforgeeks.org/sprinklr-interview-experience/
14
Chapter 8
The first round comprised of 20 Technical Aptitude and 3 Coding Questions and was held on
HackerEarth platform.It was of 2 hrs duration and each of the aptitude question weighted
5 marks without any negative marking.Coding questions were as follows:
Question 1: You are given a general tree with n nodes, each node is associated with a
certain value, rooted at node r. You have to answer q queries which can be either of the
following two types.
1. sum i :- given the value of node i, print the sum of the subtree rooted at i including its
value.
2. update i, k :- update the value of node i to k.
(200 Marks)
Question 2: You are given an array consisting of non-negative integers.You have to find
the size of the smallest subset such that the Bitwise OR of that set is maximum possible.
Sample Testcase : 5 1 3 4 2
Sample Output : 2
Clarification : Max possible OR is 7, which can be achieved by [5, 2] or [3, 4]
(50 Marks)
Question 3: You are given a string of length n (1-based indexing) having only the lowercase
english alphabets.You have to answer q queries each consisting of two integers l, r. For each
query you have to return the count of all sub-strings in range [l, r] (both l and r inclusive)
such that its starting and ending characters are same.
15
Chapter 8. Sprinklr On Campus Internship
This round was a formal interview conducted by the company officials.It started with a
brief introduction of mine including a mention of all my favorite subjects.Meanwhile the
interviewer went through my Resume and now he started with the questions.
Firstly he asked me about the project mentioned in my Resume to tell about the Frameworks
used in it and the reason for choosing it as a project.
Then he moved on to Tech Questions which are listed below.
1. You are given an array and you have to answer q queries, each query is given with two
integers l and r. In each query you have to tell the sum of all array elements between
indices l and r.Tell the best space and time efficient method.
2. Now suppose there’s an update query which changes certain elements of the array
alongwith the Range Sum Query.Tell the Data Structure which supports this with
best space and time complexity.
3. Logical Implementation (not actual code) of Segment Tree for Range Queries (basically
related to above two questions only).
4. Which properties of DBMS makes it worthy enough to hold and operate Relational
Data.
5. Description of ACID properties.
6. You have to implement a Task Scheduler where tasks are coming in continuous
stream.Each task is associated with two kind of information, its name and its priority
value.Now the task scheduler works in such a way that every time the task which is
going to execute next must be highest in priority among all the tasks arrived till its
execution starts.
Tell the Data Structure to implement it and explain the logic.(Hint: Max Heap,
Topological Sorting).
7. You are given a string in JAVA which actually represents a floating point number.You
have to convert this number to a long integer without any data loss.Use of library
functions are allowed.
16
Chapter 8. Sprinklr On Campus Internship
Finally total 5 students were listed in the final selections and I was one among them.
It was a quite a good experience and Competitive Programming , Data Structure
Concepts and my Confidence helped me a lot to grab this opportunity.
Good Luck to ALL.
Please Improve this article if you find anything incorrect by clicking on the ”Improve Article”
button below.
Source
https://www.geeksforgeeks.org/sprinklr-on-campus-internship/
17
Chapter 9
Given a number N, find out the number of possible numbers of given length.
Examples:
For N=1, number of possible numbers would be 10 (0, 1, 2, 3, …., 9)
For N=2, number of possible numbers would be 36
Possible numbers: 00,08 11,12,14 22,21,23,25 and so on.
If we start with 0, valid numbers will be 00, 08 (count: 2)
If we start with 1, valid numbers will be 11, 12, 14 (count: 3)
If we start with 2, valid numbers will be 22, 21, 23,25 (count: 4)
If we start with 3, valid numbers will be 33, 32, 36 (count: 3)
If we start with 4, valid numbers will be 44,41,45,47 (count: 4)
If we start with 5, valid numbers will be 55,54,52,56,58 (count: 5)
………………………………
18
Chapter 9. Mobile Numeric Keypad Problem
………………………………
We need to print the count of possible numbers.
N = 1 is trivial case, number of possible numbers would be 10 (0, 1, 2, 3, …., 9)
For N > 1, we need to start from some button, then move to any of the four direction (up,
left, right or down) which takes to a valid button (should not go to *, #). Keep doing this
until N length number is obtained (depth first traversal).
Recursive Solution:
Mobile Keypad is a rectangular grid of 4X3 (4 rows and 3 columns)
Lets say Count(i, j, N) represents the count of N length numbers starting from position (i,
j)
If N = 1
Count(i, j, N) = 10
Else
Count(i, j, N) = Sum of all Count(r, c, N-1) where (r, c) is new
position after valid move of length 1 from current
position (i, j)
19
Chapter 9. Mobile Numeric Keypad Problem
{
ro = i + row[move];
co = j + col[move];
if (ro >= 0 && ro <= 3 && co >=0 && co <= 2 &&
keypad[ro][co] != '*' && keypad[ro][co] != '#')
{
totalCount += getCountUtil(keypad, ro, co, n-1);
}
}
return totalCount;
}
// Return count of all possible numbers of length n
// in a given numeric keyboard
int getCount(char keypad[][3], int n)
{
// Base cases
if (keypad == NULL || n <= 0)
return 0;
if (n == 1)
return 10;
int i=0, j=0, totalCount = 0;
for (i=0; i<4; i++) // Loop on keypad row
{
for (j=0; j<3; j++) // Loop on keypad column
{
// Process for 0 to 9 digits
if (keypad[i][j] != '*' && keypad[i][j] != '#')
{
// Get count when number is starting from key
// position (i, j) and add in count obtained so far
totalCount += getCountUtil(keypad, i, j, n);
}
}
}
return totalCount;
}
// Driver program to test above function
int main(int argc, char *argv[])
{
char keypad[4][3] = {{'1','2','3'},
{'4','5','6'},
{'7','8','9'},
{'*','0','#'}};
printf("Count for numbers of length %d: %dn", 1, getCount(keypad, 1));
20
Chapter 9. Mobile Numeric Keypad Problem
Output:
Dynamic Programming
There are many repeated traversal on smaller paths (traversal for smaller N) to find all
possible longer paths (traversal for bigger N). See following two diagrams for example. In
this traversal, for N = 4 from two starting positions (buttons ‘4’ and ‘8’), we can see there
are few repeated traversals for N = 2 (e.g. 4 -> 1, 6 -> 3, 8 -> 9, 8 -> 7 etc).
21
Chapter 9. Mobile Numeric Keypad Problem
Since the problem has both properties: Optimal Substructure and Overlapping Subproblems,
it can be efficiently solved using dynamic programming.
Following is C program for dynamic programming implementation.
22
Chapter 9. Mobile Numeric Keypad Problem
count[i][0] = 0;
count[i][1] = 1;
}
// Bottom up - Get number count of length 2, 3, 4, ... , n
for (k=2; k<=n; k++)
{
for (i=0; i<4; i++) // Loop on keypad row
{
for (j=0; j<3; j++) // Loop on keypad column
{
// Process for 0 to 9 digits
if (keypad[i][j] != '*' && keypad[i][j] != '#')
{
// Here we are counting the numbers starting with
// digit keypad[i][j] and of length k keypad[i][j]
// will become 1st digit, and we need to look for
// (k-1) more digits
num = keypad[i][j] - '0';
count[num][k] = 0;
// move left, up, right, down from current location
// and if new location is valid, then get number
// count of length (k-1) from that new digit and
// add in count we found so far
for (move=0; move<5; move++)
{
ro = i + row[move];
co = j + col[move];
if (ro >= 0 && ro <= 3 && co >=0 && co <= 2 &&
keypad[ro][co] != '*' && keypad[ro][co] != '#')
{
nextNum = keypad[ro][co] - '0';
count[num][k] += count[nextNum][k-1];
}
}
}
}
}
}
// Get count of all possible numbers of length "n" starting
// with digit 0, 1, 2, ..., 9
totalCount = 0;
for (i=0; i<=9; i++)
totalCount += count[i][n];
return totalCount;
}
23
Chapter 9. Mobile Numeric Keypad Problem
// Driver program to test above function
int main(int argc, char *argv[])
{
char keypad[4][3] = {{'1','2','3'},
{'4','5','6'},
{'7','8','9'},
{'*','0','#'}};
printf("Count for numbers of length %d: %dn", 1, getCount(keypad, 1));
printf("Count for numbers of length %d: %dn", 2, getCount(keypad, 2));
printf("Count for numbers of length %d: %dn", 3, getCount(keypad, 3));
printf("Count for numbers of length %d: %dn", 4, getCount(keypad, 4));
printf("Count for numbers of length %d: %dn", 5, getCount(keypad, 5));
return 0;
}
Output:
24
Chapter 9. Mobile Numeric Keypad Problem
25
Chapter 9. Mobile Numeric Keypad Problem
}
else
{
for (i=0; i<=9; i++)
totalCount += odd[i];
}
return totalCount;
}
// Driver program to test above function
int main()
{
char keypad[4][3] = {{'1','2','3'},
{'4','5','6'},
{'7','8','9'},
{'*','0','#'}
};
printf("Count for numbers of length %d: %dn", 1, getCount(keypad, 1));
printf("Count for numbers of length %d: %dn", 2, getCount(keypad, 2));
printf("Count for numbers of length %d: %dn", 3, getCount(keypad, 3));
printf("Count for numbers of length %d: %dn", 4, getCount(keypad, 4));
printf("Count for numbers of length %d: %dn", 5, getCount(keypad, 5));
return 0;
}
Output:
This article is contributed by Anurag Singh. Please write comments if you find anything
incorrect, or you want to share more information about the topic discussed above.
Source
https://www.geeksforgeeks.org/mobile-numeric-keypad-problem/
26