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

SDE - Intern

Sprinklr
upvote
share-icon
4 rounds | 7 Coding problems

Interview preparation journey

expand-icon
Application story
I applied on-campus during my intern cycle. I mainly prepared for DSA. I gave the Sprinklr OA, followed by two rounds of technical interviews and one round of HR interview. All rounds were conducted online.
Why selected/rejected for the role?
I was selected for this internship. I also received a pre-placement offer after my internship was over for the good work I did during the internship period.
Preparation
Duration: 2 months
Topics: Data Structures, OOPS, Algorithms, Dynamic Programming, Graph
Tip
Tip

Tip 1: Practice DSA coding questions.
Tip 2: Familiarize yourself with linked lists, hashmaps, DP, graphs, and trees. 

Application process
Where: Campus
Eligibility: NA, (Stipend: 1.5L per month)
Resume Tip
Resume tip

Tip 1: Have some projects on your resume.
Tip 2: Do not include false information on your resume.

Interview rounds

01
Round
Medium
Online Coding Test
Duration90 minutes
Interview date18 Jul 2024
Coding problem3

OA was conducted in the morning on Hackerrank.

1. Largest Prime Factor

Easy
15m average time
85% success
0/40
Asked in companies
IntuitSprinklrBarclays

You are given a positive integer ‘n’. Your task is to find the largest prime factor of this given positive integer.

Note :
If there is no prime factor of a given integer, then print -1.
Problem approach

Generate All Subsequences: Since n≤20, there are 2n possible subsequences (220≈106). This is small enough to brute force.
Filter and Convert: Iterate through all 2n−1 bitmasks. For each mask, construct the binary string, convert it to a decimal integer, and store it in a set to handle duplicates.
Primality Test: Sort the unique integers in descending order. Use a primality test (like a pre-computed Sieve of Eratosthenes up to 220 or a simple N​ check) on each number.
Result: The first (largest) number that passes the primality test is your answer.

Try solving now

2. Day 24 : Lexicographically Smallest Subsequence of Distinct Characters.

Easy
20m average time
80% success
0/40
Asked in companies
OlaSprinklrAmazon

You have been given a string ‘S’. You need to return the lexicographically smallest subsequence of ‘S’ that contains all the distinct characters of ‘S’ exactly once. Return the string as mentioned above.

A string is a subsequence of a given string, that is generated by deleting some character of a given string without changing its order.

Example:
Let S = “ababc”. The lexicographically smallest subsequence containing all the distinct characters of strings is “abc”. 
Note:
Strings consist of only lowercase characters.

You do not need to print anything; it has already been taken care of. Just implement the function.
Problem approach

Feasibility Check: Count total 'b's in s. If total 'b's 
Greedy Construction: Build the result string character by character while maintaining the two constraints:
We need k characters total.
We need at least x 'b's.
The Strategy: Use a monotonic-like approach. We prefer 'a' over 'b' at any position unless taking an 'a' prevents us from meeting the x 'b's requirement or the k length requirement later.
Suffix Counting: Pre-calculate suffix_b[i], the number of 'b's from index i to n−1.
Iteration: As you iterate through s, pick 'a' if:
(Current 'b' count) + (remaining 'b's in s after this index) ≥x.
You still have enough characters left in s to reach length k.
Otherwise, you may be forced to pick 'b' or skip the character.

Try solving now

3. Shortest Path in a Binary Matrix

Moderate
37m average time
65% success
0/80
Asked in companies
SamsungOracleAmazon

You have been given a binary matrix of size 'N' * 'M' where each element is either 0 or 1. You are also given a source and a destination cell, both of them lie within the matrix.

Your task is to find the length of the shortest path from the source cell to the destination cell only consisting of 1s. If there is no path from source to destination cell, return -1.

Note:
1. Coordinates of the cells are given in 0-based indexing.
2. You can move in 4 directions (Up, Down, Left, Right) from a cell.
3. The length of the path is the number of 1s lying in the path.
4. The source cell is always filled with 1.
For example -
1 0 1
1 1 1
1 1 1
For the given binary matrix and source cell(0,0) and destination cell(0,2). Few valid paths consisting of only 1s are

X 0 X     X 0 X 
X X X     X 1 X 
1 1 1     X X X 
The length of the shortest path is 5.
Problem approach

Graph Representation: Treat each free cell . as a node and adjacent free cells as edges with weight 1.
Algorithm (BFS): Since all edge weights are equal (1 minute), Breadth-First Search (BFS) is the optimal and simplest algorithm.
Initialize a 2D dist array with ∞. Set dist[x1][y1] = 0.
Push (x1,y1) into a queue.
Traversal: While the queue is not empty:
Pop the current cell (currX,currY).
Check all 4 neighbors (Up, Down, Left, Right).
If a neighbor is within bounds, is a ., and dist[neighbor] is still ∞:
Update dist[neighbor] = dist[currX][currY] + 1.
Push neighbor to the queue.
Termination: If you reach (x2,y2), return dist[x2][y2]. If the queue empties and you haven't reached the target, the destination is unreachable.

Try solving now
02
Round
Medium
Online Coding Test
Duration60 minutes
Interview date26 Jul 2024
Coding problem2

It was conducted on video call. Interviewer were quite helpful and helped whenever I got stuck.

1. Maximum Sum Path Of A Binary Tree.

Hard
25m average time
75% success
0/120
Asked in companies
HikeSprinklrSamsung

You are given a binary tree having 'n' nodes. Each node of the tree has an integer value.


Your task is to find the maximum possible sum of a simple path between any two nodes (possibly the same) of the given tree.


A simple path is a path between any two nodes of a tree, such that no edge in the path is repeated twice. The sum of a simple path is defined as the summation of all node values in a path.

Problem approach

Define the Recursive Function
Define a function solve(u, p) that returns the maximum path sum starting at node u and extending downwards into its subtree.
ans (global/static): Keeps track of the overall maximum path sum found so far.
Step 2: Calculate the Downward Path
For a node u, calculate the max path sum from its children v1​,v2​,...vk​:
gain(vi​)=max(0,solve(vi​,u))
We use max(0,…) because if a subtree's maximum path sum is negative, it's better not to include it in a path passing through u.
Step 3: Update the Global Maximum
The maximum path sum that has node u as its "highest" point (the curved peak of the path) is:
Current Path Sum=arr[u]+∑top two gain(vi​)
Update ans = max(ans, Current Path Sum).
Step 4: Return for Parent
The function should return the maximum sum of a path starting at u and going down one branch:
return arr[u]+max(gain(vi​))

Try solving now

2. Reverse Linked List

Easy
15m average time
85% success
0/40
Asked in companies
IBMBig BasketSAP Labs
Note :
You do not need to print anything, just return the head of the reversed linked list. 
Problem approach

To reverse the list in-place, you need to keep track of three nodes at any given time:
prev: The node that will become the new next.
curr: The node we are currently re-linking.
next_node: A temporary pointer to "save" the rest of the list before we break the connection.
Initialize: * Set prev = NULL.
Set curr = head.
Iterate: While curr is not NULL:
Save: Store the next node: next_node = curr->next.
Reverse: Point the current node back to the previous: curr->next = prev.
Move: Shift the pointers forward for the next iteration:
prev = curr
curr = next_node
Finalize: After the loop, prev will be pointing to the new head of the reversed list. Return prev.

Try solving now
03
Round
Easy
Online Coding Test
Duration60 minutes
Interview date26 Jul 2024
Coding problem1

This Round was taken immediately after Round 2 on same day.

1. Zuma Game

Moderate
20m average time
80% success
0/80
Asked in companies
SalesforceAmazonSprinklr

You have several balls on the table in the form of a string named 'BOARD'. The colors of the balls can be red(R), blue(B), green(G), white(W), and yellow(Y). You also have several balls in your hand in the form of a string named 'hand'. Each time, you can do the following operations:

1. Choose a ball from the string 'HAND', and insert it anywhere on the string 'BOARD'.

2. If there is a group of strictly more than 2 balls of the same color touching each other, remove them from the string 'BOARD'. Keep doing this until the string 'board' becomes empty or no more balls can satisfy this condition.

Your task is to find the minimum number of insertions required to make the 'BOARD' empty. If it is not possible to make the string 'BOARD' empty, then print -1.

Note:

1) Both strings will be non-empty and will only contain the characters ‘R’, ‘B’, ‘G’, ‘W’, and ‘Y’.

2) Initially, the string 'BOARD' won’t have more than 2 balls of the same colors touching each other.
Problem approach

How to Solve in Steps
Count Frequencies: Use a frequency map or an array to count the occurrences of each color. Let these counts be c1​,c2​,…,ck​.
Identify the Operation: You can pick all balls of color A and turn them into color B. This effectively merges the two counts: cnew​=cA​+cB​.
Maximize the Denominator: To minimize the total arrangements, you want to merge the two counts that, when combined, create the largest possible product of factorials in the denominator.
Mathematically, replacing ni​!⋅nj​! with (ni​+nj​)! always increases the denominator because (ni​+nj​)!>ni​!⋅nj​! for any ni​,nj​≥1.
Pick the Best Merge: To get the absolute minimum, you should merge the two largest existing counts.
Correction/Refinement: Actually, since (ni​+nj​)! grows super-linearly, merging any two colors will reduce the total count, but merging the two largest groups results in the largest possible denominator.
Calculate with Modular Inverse: Since we need the answer modulo 109+7, use Fermat's Little Theorem to calculate the modular multiplicative inverse for the division.

Try solving now
04
Round
Easy
HR Round
Duration15 minutes
Interview date27 Jul 2024
Coding problem1

1. HR Questions

  • What is your greatest weakness?
  • Tell me about a time you had a conflict with a teammate."

Here's your problem of the day

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

Skill covered: Programming

Which data structure is used to implement a DFS?

Choose another skill to practice
Similar interview experiences
company logo
SDE - Intern
4 rounds | 15 problems
Interviewed by Sprinklr
2571 views
0 comments
0 upvotes
company logo
SDE - Intern
3 rounds | 6 problems
Interviewed by Sprinklr
1183 views
0 comments
0 upvotes
company logo
SDE - Intern
3 rounds | 8 problems
Interviewed by Sprinklr
3357 views
1 comments
0 upvotes
company logo
SDE - Intern
3 rounds | 7 problems
Interviewed by Sprinklr
2556 views
0 comments
0 upvotes
Companies with similar interview experiences
company logo
SDE - Intern
3 rounds | 6 problems
Interviewed by Amazon
15659 views
4 comments
0 upvotes
company logo
SDE - Intern
4 rounds | 7 problems
Interviewed by Microsoft
15563 views
1 comments
0 upvotes
company logo
SDE - Intern
2 rounds | 4 problems
Interviewed by Amazon
10248 views
2 comments
0 upvotes