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

SDE - 1

Twilio
upvote
share-icon
3 rounds | 5 Coding problems

Interview preparation journey

expand-icon
Journey
I was admitted to DTU college in the computer science stream. I was advised by my seniors to practice DSA from the very start of B.Tech, and I did not take that seriously. Honestly speaking, I regretted not taking their advice and in the third year I started coding, and I had to increase practice hours because I started late.
Application story
I applied for the post through the campus drive. After applying I practiced hard for it and the hardwork paid off at the last.
Why selected/rejected for the role?
I think I was on point with my coding solutions to the questions asked in the interviews. I did not able to provide the optimal solutions and I was giving correct explanations to some theory questions asked.
Preparation
Duration: 3 months
Topics: Data Structures, Pointers, OOPS, System Design, Algorithms, Dynamic Programming
Tip
Tip

Tip 1 : Even if you are stuck in the problem, just give a try. The interviewer will help you definitely for sure.
Tip 2 : Prepare Data Structures and Algorithms well. They mostly check our Problem Solving ability to find the solutions for the real world problems.
Tip 3 : Be enough confident, don't be nervous. Maintain atleast 2 projects in your resume

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

Tip 1 : Mention atleast 2 projects.
Tip 2 : Mention your skills in which you are perfect.
Tip 3 : It should not be too long or too short

Interview rounds

01
Round
Easy
Video Call
Duration60 minutes
Interview date8 Dec 2022
Coding problem2

1. 3Sum

Moderate
15m average time
85% success
0/80
Asked in companies
Goldman SachsAdobeAmazon

You are given an array/list ARR consisting of N integers. Your task is to find all the distinct triplets present in the array which adds up to a given number K.

An array is said to have a triplet {ARR[i], ARR[j], ARR[k]} with sum = 'K' if there exists three indices i, j and k such that i!=j, j!=k and i!=j and ARR[i] + ARR[j] + ARR[k] = 'K'.

Note:
1. You can return the list of values in any order. For example, if a valid triplet is {1, 2, -3}, then {2, -3, 1}, {-3, 2, 1} etc is also valid triplet. Also, the ordering of different triplets can be random i.e if there are more than one valid triplets, you can return them in any order.
2. The elements in the array need not be distinct.
3. If no such triplet is present in the array, then return an empty list, and the output printed for such a test case will be "-1".
Problem approach

Approach : 

1) Sort the array in ascending order.

2) Now since we want triplets such that x + y + z = ‘K’, we have x+ y = ‘K’ - z and now we can fix z as arr[i]. So we want to find the sum of two numbers x and y as ‘K’ - arr[i] in the array.

3) We will use two pointers, one will start from i+1, and the other will start from the end of the array.

4) Let the two pointers be ‘FRONT’ and ‘BACK’, where ‘FRONT’ = i + 1 and ‘BACK’ = n - 1. Let ‘SUM’ = x + y, where x = ‘ARR[FRONT]’ and y = ‘ARR[BACK]’. We have to find the triplets such that ‘TARGET’ = ‘SUM’.

5) While ‘FRONT’ < ‘BACK’, there will be 3 cases:
5.1) if ('SUM' < ‘TARGET’), we will have to increase the sum and hence increment front pointer.
5.2) Else if ('SUM' > ‘TARGET’), we will have to decrease the sum and hence decrease the ‘BACK’ 
pointer. 
5.3) Else print the triplet and since we want distinct triplets, do the following.
a) Increment the front pointer until ‘ARR[FRONT]’ = x and ‘FRONT’ < ‘BACK’.
b) Decrement the back pointer until ‘ARR[BACK]’ = y and ‘FRONT’ < ‘BACK’.

6) While ‘ARR[i]’ = ‘ARR[i+1]’, keep on incrementing i, this will automatically ensure that we are only finding distinct triplets.

TC : O(N^2) , where N=size of the array
SC : O(1)

Try solving now

2. Minimum operation needed to convert to the given string

Moderate
26m average time
0/80
Asked in companies
SamsungAppleMicrosoft

You are given two strings 'str1' and 'str2'. Find the minimum operations required to convert str1 into str2.

An Operation is defined as:
A character from an index of a string(str1) is put at the end of it, is defined as a single operation.
 Note :
You cannot perform any operation on the string, str2.
Problem approach

Approach : I solved this problem using 2-pointer technique. 

1) Initialize the first pointer to the start of str1 and the second pointer to the start of the str2.

2) Now increase the first pointer till the character pointed by the first pointer in str1 matches the character at the second pointer in str2. And the number of character which did not match should be placed at the end of str1. Therefore increase our answer by how many times we needed to increase the first pointer.

3) Now character pointed by both the pointer is the same so simply increase both pointers as they are same. And perform this while both the pointer do not exhaust the str1 and str2 respectively.

4) One thing to note is that all the characters which did not match would be placed at the end optimally so that the cost will be equal to the unmatched characters with the prefix of str2.

TC : O(N+M), where N is the size of the first string and M is the size of the second string.
SC : O(1)

Try solving now
02
Round
Medium
Video Call
Duration60 minutes
Interview date8 Dec 2022
Coding problem2

1. Power of Two

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

You have been given an integer 'N'.


Your task is to return true if it is a power of two. Otherwise, return false.


An integer 'N' is a power of two, if it can be expressed as 2 ^ 'K' where 'K' is an integer.


For example:
'N' = 4,
4 can be represented as 2^2. So, 4 is the power of two, and hence true is our answer.
Problem approach

Approach : If a number N is power of 2 then bitwise & of N and N-1 will be zero. We can say N is a power of 2 or not based on the value of N&(N-1). The expression N&(N-1) will not work when N is 0.
So,handle that case separately.

TC : O(1)
SC : O(1)

Try solving now

2. Merge K Sorted Arrays

Moderate
15m average time
85% success
0/80
Asked in companies
MathworksMicrosoftOracle

You have been given ‘K’ different arrays/lists, which are sorted individually (in ascending order). You need to merge all the given arrays/list such that the output array/list should be sorted in ascending order.

Problem approach

Approach 1 (Brute Force) : 

Create an output array and and one by one copy all arrays to it. Finally, sort the output array using. This approach takes O(N Logn N) time where N is count of all elements.

Approach 2 (Using Min-Heap) :

1. Create an output array. 
2. Create a min heap of size k and insert 1st element in all the arrays into the heap 
3. Repeat following steps while priority queue is not empty. 
3.1) Remove minimum element from heap (minimum is always at root) and store it in output array. 
3.2) Insert next element from the array from which the element is extracted. If the array doesn’t have 
any more elements, then do nothing.

TC : O(N*log(K))
SC : O(N)

Try solving now
03
Round
Easy
HR Round
Duration20 minutes
Interview date8 Dec 2022
Coding problem1

1. Basic HR Questions

What are your strengths and weaknesses?
Why do you want to work at our company?
What is the difference between confidence and over confidence?

Here's your problem of the day

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

Skill covered: Programming

How do you remove whitespace from the start of a string?

Choose another skill to practice
Similar interview experiences
company logo
SDE - 1
2 rounds | 5 problems
Interviewed by Twilio
815 views
0 comments
0 upvotes
company logo
SDE - 1
2 rounds | 5 problems
Interviewed by Twilio
837 views
0 comments
0 upvotes
company logo
SDE - 1
2 rounds | 5 problems
Interviewed by Twilio
665 views
0 comments
0 upvotes
company logo
SDE - 1
3 rounds | 6 problems
Interviewed by Twilio
504 views
0 comments
0 upvotes
Companies with similar interview experiences
company logo
SDE - 1
5 rounds | 12 problems
Interviewed by Amazon
115097 views
24 comments
0 upvotes
company logo
SDE - 1
4 rounds | 5 problems
Interviewed by Microsoft
58238 views
5 comments
0 upvotes
company logo
SDE - 1
3 rounds | 7 problems
Interviewed by Amazon
35147 views
7 comments
0 upvotes