# Sprinklr Internship Interview Experience

Round 1 (Coding) : It was conducted on HackerRank .

Question – 1 : Given a tree with n nodes rooted at given root node r and having values associated with all the nodes. You have to answer two types of queries :-

- sum i – In this query you have to print the sum of the sub-tree of the node i including the node i .
- 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 –

1 2

2 4

1 5

Output :-

2

3

7

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 :-

- 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..
- 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.
- 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.
- What is a red-black tree.. Code
- What is an AVL tree..Code
- How you will detect a cycle in an directed or undirected graph.
- 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..
- 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.

Then, Atlast he asked me if i have any questions to ask him ..

Round 3 :- This was an HR round .. She asked me the standard questions like tell me about yourself, What do you know about our company, who are our clients, are you comfortable with the location and the stipend ..

Some Important Tips :-

- 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.
- 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.
- 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.
- 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.
- Do some homework about the company like what the company does every HR will ask that question.

ALL THE BEST..