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

SDE - 1

Twilio
upvote
share-icon
2 rounds | 5 Coding problems

Interview preparation journey

expand-icon
Journey
I was advised by my seniors to practice DSA from the very beginning of my B.Tech, but I did not take it seriously. Honestly speaking, I regretted not taking their advice. In my third year, I started coding and had to increase my practice hours because I started late. By the end of the third year, I was confident in both DSA and development, but even then, I kept revising the concepts.
Application story
This company visited my campus for placements. We just had to upload our resumes and fill out all the details in the form. First, they conducted the online assessment. Later, they called us for the interview rounds.
Why selected/rejected for the role?
The main reason for my rejection was my lack of strong knowledge of core DSA fundamentals, and my problem-solving ability was also not up to par.
Preparation
Duration: 8 months
Topics: Data Structures, Algorithms, OOPS, Dynamic Programming
Tip
Tip

Tip 1: Practice popular questions from arrays, binary trees, and linked lists from CodeStudio's Interview Problems.

Tip 2: Make sure you are aware of how to calculate the time and space complexity for every problem you're coding.

Tip 3: Prepare through mock interviews to practice explaining your approach while solving problems in an actual interview.

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

Tip 1: Describe the best of your projects concisely. Don't forget to include buzzwords like REST APIs, DB Indexing, Benchmarking, etc., if you worked on the backend.

Tip 2: Avoid adding school achievements like Olympiads or Class Topper in your resume.

Tip 3: If you have work experience, market yourself effectively. Use terms like 'Created/Owned the project through the entire SDLC.'

Interview rounds

01
Round
Easy
Video Call
Duration60 minutes
Interview date23 Apr 2023
Coding problem2

1. Leaf Nodes from Preorder of BST

Moderate
25m average time
70% success
0/80
Asked in companies
TwilioNagarro Software

You are given a ‘root’ of a Binary Search Tree in preorder fashion, and your task is to print all the leaf nodes in the tree. A leaf node is a node whose left and right pointer point to NULL.

More formally, you have to print all the leaf nodes from left to right, i.e., they should be sorted.

Note:

A binary search tree, also called an ordered or sorted binary tree, is a rooted binary tree whose internal nodes each store a key greater than all the keys in the node's left subtree and less than those in its right subtree.
Example
For Example, the root node is given as follows :
‘ROOT’ = 6 4 3 -1 -1 5 -1 -1 8 7 -1 -1 9 -1 -1

Level 1 :
The root node of the tree is 6

Level 2 :
Left child of 6 = 4
Right child of 6 = 8

Level 3 :
Left child of 4 = 3
Right child of 4 = 5
Left child of 8 = 7
Right child of 8 = 9

Therefore all the leaf nodes are 3, 5, 7 and 9.
Try solving now

2. Minimum Operations

Easy
20m average time
82% success
0/40
Asked in companies
MicrosoftBNY MellonLinkedIn

You are given an array 'ARR' of 'N' positive integers. You need to find the minimum number of operations needed to make all elements of the array equal. You can perform addition, multiplication, subtraction or division with any element on an array element.

Addition, Subtraction, Multiplication or Division on any element of the array will be considered as a single operation.

Example:

If the given array is [1,2,3] then the answer would be 2. One of the ways to make all the elements of the given array equal is by adding 1 to the array element with value 1 and subtracting 1 from the array element with value 3. So that final array would become [2,2,2]. 
Try solving now
02
Round
Easy
Video Call
Duration60 minutes
Interview date23 Apr 2023
Coding problem3

1. Spiral Order Traversal of a Binary Tree

Easy
20m average time
75% success
0/40
Asked in companies
SliceOYOMicrosoft

You have been given a binary tree of 'N' nodes. Print the Spiral Order traversal of this binary tree.

For example
For the given binary tree [1, 2, 3, -1, -1, 4, 5, -1, -1, -1, -1]
    1
   / \
  2   3
     / \
    4   5

Output: 1 3 2 4 5
Problem approach

I used an approach based on using two stacks. One stack is used for printing from left to right, and the other stack is used for printing from right to left. In each iteration, nodes of one level are stored in one of the stacks. We print these nodes and push nodes of the next level into the other stack.

Try solving now

2. Merge Sort Linked List

Moderate
10m average time
90% success
0/80
Asked in companies
MeeshoIBMThought Works

You are given a Singly Linked List of integers. Sort the Linked List using merge sort.

Merge Sort is a Divide and Conquer algorithm. It divides the input into two halves, calls itself for the two halves, and then merges the two sorted halves. The merge() function is used for merging two halves. The merge(arr, L, M, R) is a key process that assumes that arr[L..M] and arr[M + 1...R] are sorted and merges the two sorted subarrays into one.

Problem approach

For sorting, I explained to the interviewer the merge sort algorithm for linked lists, which divides the linked list into two halves and then merges them. I wrote a fully commented code for him in clear handwriting. I also calculated the midpoint using the slow and fast pointer approach.

Try solving now

3. Maximize xor

Easy
15m average time
62% success
0/40
Asked in companies
MicrosoftWalmartMicrosoft

You have an integer array ‘A’ of the form of [x, x+1, x+2, x+3, …….]. As the array is vast in size, you are given both endpoints of the array, i.e., If you are given two integers, ‘L’ and ‘R’, the array ‘A’ will be [L, L+1, L+2, ……., R-1, R]. Your task is to find the maximum possible value of ‘X’ such that the following two conditions hold.

a ⊕ b = X, where ⊕ denotes bitwise xor operation.
Both numbers ‘a’ and ‘b’ belong to the array ‘A’.
Problem approach

I explained to him a simple brute force approach through the loop but the interviewer was expecting a more efficient solution that I couldn‘t crack up.

Try solving now

Here's your problem of the day

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

Skill covered: Programming

What is recursion?

Choose another skill to practice
Similar interview experiences
company logo
SDE - 1
2 rounds | 5 problems
Interviewed by Twilio
795 views
0 comments
0 upvotes
company logo
SDE - 1
3 rounds | 5 problems
Interviewed by Twilio
1185 views
0 comments
0 upvotes
company logo
SDE - 1
2 rounds | 5 problems
Interviewed by Twilio
647 views
0 comments
0 upvotes
company logo
SDE - 1
3 rounds | 6 problems
Interviewed by Twilio
484 views
0 comments
0 upvotes
Companies with similar interview experiences
company logo
SDE - 1
5 rounds | 12 problems
Interviewed by Amazon
114579 views
24 comments
0 upvotes
company logo
SDE - 1
4 rounds | 5 problems
Interviewed by Microsoft
57825 views
5 comments
0 upvotes
company logo
SDE - 1
3 rounds | 7 problems
Interviewed by Amazon
34961 views
7 comments
0 upvotes