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

SDE - 2

Adobe
upvote
share-icon
4 rounds | 9 Coding problems

Interview preparation journey

expand-icon
Preparation
Duration: 6 months
Topics: Data structures, Algorithms, OS Concepts, Software Testing Concepts, High Level Design, Low Level Design
Tip
Tip

Tip 1 : Focus on DS/algo
Tip 2 : Learn manual testing scenarios

Application process
Where: Other
Eligibility: Above 1 years of experience
Resume Tip
Resume tip

Tip 1 : Mention experience and skills
Tip 2 : Mention certifications

Interview rounds

01
Round
Easy
Online Coding Test
Duration60 minutes
Interview date15 Aug 2017
Coding problem2

The interviewer asked me 2 questions related to DS/Algo in this round. Both the questions were of Easy-Medium difficulty and I was also required to code them in a production-ready manner.

1. 3 Sum

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

Find the sum ‘sum_of_elements’ of all the numbers in the array. This would require a linear scan, O(n).
Then find the sum ‘expected_sum’ of first ‘n’ numbers using the arithmetic series sum formula i.e. ( n * (n + 1) ) / 2.
The difference between these i.e. ‘expected_sum - sum_of_elements’, is the missing number in the array.

Try solving now

2. Top View Of Binary Tree

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

You are given a Binary Tree of 'n' nodes.


The Top view of the binary tree is the set of nodes visible when we see the tree from the top.


Find the top view of the given binary tree, from left to right.


Example :
Input: Let the binary tree be:

Example

Output: [10, 4, 2, 1, 3, 6]

Explanation: Consider the vertical lines in the figure. The top view contains the topmost node from each vertical line.
Problem approach

As we know that all three traversals, i.e. pre-order, in-order and post-order, visit the tree node at once. We can use any of them. Here we are going to use pre-order traversal for the explanation. So while traversing in the pre-order traversal, we will keep track of the horizontal distance of the node which is going to be visited from the root node, and we also keep track of the vertical level of that node (where the vertical level of the root node would be ‘0’ and its children would be ‘1’ and so on.... ).

Try solving now
02
Round
Medium
Face to Face
Duration60 minutes
Interview date22 Aug 2017
Coding problem3

1 coding problem followed by some questions from OOPS

1. Copy List with Random Pointer

Easy
10m average time
90% success
0/40
Asked in companies
MicrosoftUrban Company (UrbanClap)Amazon

Given a linked list having two pointers in each node. The first one points to the next node of the list, however, the other pointer is random and can point to any node of the list or null. The task is to create a deep copy of the given linked list and return its head. We will validate whether the linked list is a copy of the original linked list or not.

A deep copy of a Linked List means we do not copy the references of the nodes of the original Linked List rather for each node in the original Linked List, a new node is created.

For example,

example

Random pointers are shown in red and next pointers in black.

Problem approach

In the first pass, create a copy of the original linked list. While creating this copy, use the same values for data and arbitrary_pointer in the new list. Also, keep updating the map with entries where the key is the address to the old node and the value is the address of the new node.
Once the copy has been created, do another pass on the copied linked list and update arbitrary pointers to the new address using the map created in the first pass.

Try solving now

2. OOPS Question

Difference between Abstract class and Interface.

3. OOPS Question

What is meant by Interface?

03
Round
Medium
Face to Face
Duration60 minutes
Interview date22 Aug 2017
Coding problem2

2 coding problems of Easy to Moderate level of difficulty

1. String Breaker

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

You are given a string ‘S’ and a set of words named ‘Dictionary’. You can perform the operation of breaking the given string 'S', in any possible way and divide the given string into any number of subparts. Your task is to break the given string 'S', such that all the subparts are present in the Dictionary. You just need to tell the minimum number of times you need to break the string 'S' in order to accomplish the above task.

Note:
1. If string 'S' is already present in the dictionary, then you don’t need to break the string and you can print 0 in such cases.
2. If it is impossible to complete the given task, then print -1.
3. All the characters of string 'S' and words inside the Dictionary only contain Uppercased English Alphabets.
Problem approach

You can solve this problem by segmenting the large string at each possible position to see if the string can be completely segmented to words in the dictionary. To achieve memoization, you can store the second string in a new set each time. This will reduce both time and memory complexities.

Try solving now

2. Intersection of Two Linked Lists

Easy
25m average time
73% success
0/40
Asked in companies
OracleThought WorksIBM

You are given two Singly Linked Lists of integers, which may have an intersection point.

Your task is to return the first intersection node. If there is no intersection, return NULL.


Example:-
The Linked Lists, where a1, a2, c1, c2, c3 is the first linked list and b1, b2, b3, c1, c2, c3 is the second linked list, merging at node c1.

alt.txt

Problem approach
  • Traverse the first list and store the address/reference to each node in a hash set/map/dictionary.
  • Then check every node in the second list:
    • If the address of the node of the second list appears in the hash set/map/dictionary, then the node is the intersection node
    • If we do not find any address of the second list node in the hash set/map/dictionary then return -1
Try solving now
04
Round
Easy
Face to Face
Duration60 minutes
Interview date22 Aug 2017
Coding problem2

2 coding problems followed by a brief project discussion

1. Merge Intervals

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

You are given N number of intervals, where each interval contains two integers denoting the start time and the end time for the interval.

The task is to merge all the overlapping intervals and return the list of merged intervals sorted by increasing order of their start time.

Two intervals [A,B] and [C,D] are said to be overlapping with each other if there is at least one integer that is covered by both of them.

For example:

For the given 5 intervals - [1, 4], [3, 5], [6, 8], [10, 12], [8, 9].

Since intervals [1, 4] and [3, 5] overlap with each other, we will merge them into a single interval as [1, 5].

Similarly, [6, 8] and [8, 9] overlap, merge them into [6,9].

Interval [10, 12] does not overlap with any interval.

Final List after merging overlapping intervals: [1, 5], [6, 9], [10, 12].
Problem approach

List of input intervals is given, and we’ll keep merged intervals in the output list.

For each interval in the input list:

If the input interval is overlapping with the last interval in the output list then we’ll merge these two intervals and update the last interval of output list with merged interval.
Otherwise, we’ll add an input interval to the output list.

Try solving now

2. Count Ways To Reach The N-th Stairs

Moderate
30m average time
80% success
0/80
Asked in companies
OYOLinkedInGrab

You have been given a number of stairs. Initially, you are at the 0th stair, and you need to reach the Nth stair.


Each time, you can climb either one step or two steps.


You are supposed to return the number of distinct ways you can climb from the 0th step to the Nth step.

Note:

Note: Since the number of ways can be very large, return the answer modulo 1000000007.
Example :
N=3

Example

We can climb one step at a time i.e. {(0, 1) ,(1, 2),(2,3)} or we can climb the first two-step and then one step i.e. {(0,2),(1, 3)} or we can climb first one step and then two step i.e. {(0,1), (1,3)}.
Problem approach
  1. We can take the one-step from (currStep-1)th step or,
  2. We can take the two steps from (currStep-2)th step.

So the total number of ways to reach “currStep” will be the sum of the total number of ways to reach at (currStep-1)th and the total number of ways to reach (currStep-2)th step.

Let dp[currStep] define the total number of ways to reach “currStep” from the 0th. So,

dp[ currStep ] = dp[ currStep-1 ] + dp[ currStep-2 ]
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

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

Choose another skill to practice
Similar interview experiences
company logo
Software Engineer
3 rounds | 5 problems
Interviewed by Adobe
1689 views
0 comments
0 upvotes
company logo
SDE - 2
4 rounds | 4 problems
Interviewed by Adobe
2859 views
2 comments
0 upvotes
company logo
SDE - 2
3 rounds | 5 problems
Interviewed by Adobe
1693 views
0 comments
0 upvotes
company logo
Software Engineer
5 rounds | 5 problems
Interviewed by Adobe
1005 views
0 comments
0 upvotes
Companies with similar interview experiences
company logo
SDE - 2
5 rounds | 12 problems
Interviewed by Walmart
29892 views
8 comments
0 upvotes
company logo
SDE - 2
3 rounds | 5 problems
Interviewed by Amazon
6765 views
1 comments
0 upvotes
company logo
SDE - 2
6 rounds | 8 problems
Interviewed by Amazon
5280 views
0 comments
0 upvotes