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

SDE - 1

Traveloka
upvote
share-icon
4 rounds | 7 Coding problems

Interview preparation journey

expand-icon
Preparation
Duration: 3-4 months
Topics: Data Structures and Algorithms, Object Oriented Design, LLD & HLD, Operating System, Computer Networks, DBMS
Tip
Tip

Tip 1 : We should focus on other topics apart from DSA. Knowledge of LLD, HLD, OOPS and other subjects also plays a very important role. 
Tip 2 : Communication also plays a key role in interviews. We should be able to explain our solution precisely and also able to catch hints given by Interviewer.
Tip 3 : While practising DSA focus should be on logic building rather than cramming the solution because proper reasoning will hep you to solve other new questions.
Tip 4 : Always remember interview is two way communication.

Application process
Where: Linkedin
Eligibility: No criteria
Resume Tip
Resume tip

Tip 1 : Mention only those projects and skills in which you are confident.
Tip 2 : Resume should be of one page(preferrable).

Interview rounds

01
Round
Medium
Online Coding Interview
Duration90 minutes
Interview date7 Aug 2020
Coding problem2

Basically a hackerrank link was shared and I was suppose to take the test within a day. Online Test comprised of 3 algorithmic Questions. Duration of round was 90 minutes.
 

1. Ways to make coin change

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

You are given an infinite supply of coins of each of denominations D = {D0, D1, D2, D3, ...... Dn-1}. You need to figure out the total number of ways W, in which you can make a change for value V using coins of denominations from D. Print 0, if a change isn't possible.

Problem approach

I first tried to solve the problem using BackTracking and was able to pass only 8 test cases out of 13. Then I checked the constraints again and realised that for clearing all 13 test cases I have to submit a solution with worst time complexity O(n^2). I tried to solve the question again but due to limited time couldn't solved it completely.

Try solving now

2. Longest increasing subsequence

Moderate
30m average time
65% success
0/80
Asked in companies
FacebookDisney + HotstarAmazon

For a given array with N elements, you need to find the length of the longest subsequence from the array such that all the elements of the subsequence are sorted in strictly increasing order.

Strictly Increasing Sequence is when each term in the sequence is larger than the preceding term.

For example:
[1, 2, 3, 4] is a strictly increasing array, while [2, 1, 4, 3] is not.
Problem approach

I read the question first and the constraints. After reading the question I wrote the recurrence relation on paper and verified with the help of some examples. After verifying the recurrence relation, I coded the memoized solution and was able to pass all test cases.

Try solving now
02
Round
Medium
Online Coding Interview
Duration70 minutes
Interview date13 Aug 2020
Coding problem2

It was a 60 minute virtual face 2 face round with 2 senior software engineers of the company. Interview started with brief introduction by the engineers followed by my Introduction. Interview started at 3:00 P.M and lasted till 4:10 P.M. Google Doc was used for coding purposes.

1. Search an element in a sorted and rotated array

Moderate
30m average time
65% success
0/80
Asked in companies
PayPalFreshworksSAP Labs

Aahad and Harshit always have fun by solving problems. Harshit took a sorted array consisting of distinct integers and rotated it clockwise by an unknown amount. For example, he took a sorted array = [1, 2, 3, 4, 5] and if he rotates it by 2, then the array becomes: [4, 5, 1, 2, 3].

After rotating a sorted array, Aahad needs to answer Q queries asked by Harshit, each of them is described by one integer Q[i]. which Harshit wanted him to search in the array. For each query, if he found it, he had to shout the index of the number, otherwise, he had to shout -1.

For each query, you have to complete the given method where 'key' denotes Q[i]. If the key exists in the array, return the index of the 'key', otherwise, return -1.

Note:

Can you solve each query in O(logN) ?
Problem approach

1. I first solved the problem with brute force i.e using linear search. Complexity of solution was O(N) . Interviewers asked me to optimise more.
2. Then I used the fact that initially array was sorted , so I started thinking in the direction of binary search and was able to propose a solution with O(NLogn) Complexity.
3. Then Interviewers asked me about the explanation of the solution and I was able to tell them correctly. Interviewers were satisfied with my solution

Try solving now

2. Construct Binary Tree from given Parent Array representation

Easy
15m average time
80% success
0/40
Asked in companies
SAP LabsTraveloka

Given an array parent which represents a binary tree such that parent-child relationship is defined by ('PARENT'[i], 'i') which means that parent of i is 'PARENT'[i]. The value of the root node will be i if -1 is present at 'PARENT'[i].

For example:

For the parent array {1, -1, 1}, the tree will be:- 

1

As, parent of 0 is 'PARENT'[0] i.e. 1.
1 is the root as 'PARENT'[1] = -1.
Parent of 2 is 'PARENT'[2] i.e. 1.

Similarly for the parent array { 1, 2, -1}, the tree will be:-

2

Your task is to create the Binary tree from the given parent array.

Note:

From the parent array, multiple binary trees may be possible. You have to create a binary tree in such a way that these conditions satisfy:-

If the node has a left child as well as a right child, make sure the left child is smaller than the right child. 

If the node has only one child, make sure it has an only left child. 

For {1, -1, 1}, the accepted tree will be:- 

3

And for {1, -1}, the accepted tree will be, 

4

Instead of 

5

Problem approach

1. Read the questions and constraints carefully.
2. Came to conclusion that I have to find the height of binary tree represented by parent arrary.
3. Coded the solution while keeping the corner cases in mind.

Try solving now
03
Round
Medium
Online Coding Interview
Duration60 minutes
Interview date19 Aug 2020
Coding problem2

It was a face 2 face algorithmic round taken by Senior Backend engineer. Interview Round Started at around 2:00 P.M and lasted till 3:05 P.M. Interview started with the brief introduction followed by 2 algorithmic questions. Interviewer was focusing problem solving skills. After discussing the approach, Coding part was to be done on google doc.

1. Maximum path sum in the matrix

Moderate
35m average time
70% success
0/80
Asked in companies
AmazonPayPalMicrosoft

You have been given an N*M matrix filled with integer numbers, find the maximum sum that can be obtained from a path starting from any cell in the first row to any cell in the last row.

From a cell in a row, you can move to another cell directly below that row, or diagonally below left or right. So from a particular cell (row, col), we can move in three directions i.e.

Down: (row+1,col)
Down left diagonal: (row+1,col-1)
Down right diagonal: (row+1, col+1)
Try solving now

2. Partition equal subset sum

Moderate
25m average time
65% success
0/80
Asked in companies
OlaAdobeAmazon

You are given an array 'ARR' of 'N' positive integers. Your task is to find if we can partition the given array into two subsets such that the sum of elements in both subsets is equal.

For example, let’s say the given array is [2, 3, 3, 3, 4, 5], then the array can be partitioned as [2, 3, 5], and [3, 3, 4] with equal sum 10.

Follow Up:

Can you solve this using not more than O(S) extra space, where S is the sum of all elements of the given array?
Problem approach

1. Initially I wasn't able to come up with solution then I thought of brute force solution.
2. I focused on solving with brute force and solved the problem with brute force i.e using Backtracking. Complexity of solution was Exponential . Interviewer asked me to optimise more, since solution was of exponential time complexity.
3. Then I used the fact that if sum of entire array is even then only we can divide the array into two parts. With the help of this logic I optimised my solution a bit more.
4. I wasn't able to provide the most optimised solution.
5. Since I was optimising my previous solutions Interviewer was happy with my approach of slowly building the solution .

Try solving now
04
Round
Medium
Online Coding Interview
Duration120-130 minutes
Interview date24 Nov 2020
Coding problem1

It was a face 2 face round which was taken by Line manager. Interview started at 11:00 A.M and lasted around 2 hours approx. Interviewer was very friendly and supportive. Interview started with brief introduction of the interviewer followed by mine. Then a System design question was asked by the interviewer over google doc. Interviewer was focusing on how I'm approaching the problem. Overall It was a good experience.

1. System Design

Build Search Functionality, for a Hotel booking system like OYO, which should results in relevant search result based on User query. Constraints were as follows:-
1. User Query can be anything.
2. Hotel Records/Data can be Huge.
3. Have to respond with relevant search result even if user query is not correct. Have to respond with closest relevant result.



Schema of Data:-
Hotel ABC,
Name: 1, Hotel ABC, 2. Hotel XYZ.

Description: 1. 100 character -> “5 star hotel….”

Geo {
India
Asia
}


Facilities (upto 10) [
Swimming pool,
Free Lunch.

].


Following Important Questions were asked during the discussion of this problem.
Q:-1. How do you divide your data?
Q:2. how do we do a best relevant search for hotel product.
Q:3. How do you store the data?

Problem approach

Tip 1 : Clarify each and everything with the Interviewer.
Tip 2 : Don't assume anything.
Tip 3 : You should be able to reason your decision of choosing one thing over another. Answering without any reasoning is a red flag .

Tip 4: This resource really helped. https://github.com/donnemartin/system-design-primer

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 the purpose of the return keyword?

Choose another skill to practice
Similar interview experiences
company logo
SDE - 1
3 rounds | 7 problems
Interviewed by OYO
4782 views
0 comments
0 upvotes
company logo
SDE - Intern
2 rounds | 3 problems
Interviewed by Amazon
1012 views
0 comments
0 upvotes
company logo
SDE - 1
2 rounds | 5 problems
Interviewed by Meesho
6543 views
0 comments
0 upvotes
company logo
SDE - 1
3 rounds | 9 problems
Interviewed by Salesforce
3567 views
0 comments
0 upvotes
Companies with similar interview experiences
company logo
SDE - 1
5 rounds | 12 problems
Interviewed by Amazon
114869 views
24 comments
0 upvotes
company logo
SDE - 1
4 rounds | 5 problems
Interviewed by Microsoft
58031 views
5 comments
0 upvotes
company logo
SDE - 1
3 rounds | 7 problems
Interviewed by Amazon
35057 views
7 comments
0 upvotes