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

SDE - 1

American Express
upvote
share-icon
3 rounds | 4 Coding problems

Interview preparation journey

expand-icon
Preparation
Duration: 12 months
Topics: Graphs, Trees, Dynamic Programming, Recursion, DSA
Tip
Tip

Tip 1 : Try to learn the basic fundamentals first.
Tip 2 : Give as much contests you can, It will help you in coding rounds.
Tip 3 : Practice as much you can.

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

Tip 1 : Make it one-pager 
Tip 2 : Mention things that are related to the job profile only

Interview rounds

01
Round
Medium
Online Coding Test
Duration60 minutes
Interview date10 Nov 2022
Coding problem2

It was a normal coding round, where I have to solve the 2 questions in 60 minutes.

1. Odd and even positioned linked list nodes

Easy
10m average time
90% success
0/40
Asked in companies
Expedia GroupAmerican ExpressDream11

You are given a singly linked list ‘HEAD’ consisting of ‘N’ nodes. The task is to group all the odd nodes together, followed by the even nodes, maintaining the relative order of nodes given in the input. Note that we are talking about the node’s positions and not the value stored in the node. Try to write an in-place algorithm (i.e., without using any extra space) to solve this problem.

Example:
Given linked list: ‘2 => 1 => 3 => 4 => 6 => 5’

While maintaining the relative order of nodes as it is in the input, Nodes at odd positions are (2, 3, 6), and nodes at evens position are (1, 4, 5).

Modified linked list: ‘2 => 3 => 6 => 1 => 4 => 5’
Note:
1. Consider that the first node is odd, the second is even, and so on.
Problem approach

I did it by simply dividing linked list in two parts and then finally merging it.

Try solving now

2. LCA - Lowest Common Ancestor

Hard
40m average time
70% success
0/120
Asked in companies
QualcommOYOAmazon

The lowest common ancestor (LCA) is a concept in graph theory and computer science.

Let ‘T’ be a rooted tree with ‘N’ nodes. The lowest common ancestor is defined between two nodes, ‘u’ and ‘v’, as the lowest node in ‘T’ that has both ‘u’ and ‘v’ as descendants (where we allow a node to be a descendant of itself). - Wikipedia

For the given tree, The LCA of nodes 5 and 8 will be node 2, as node 2 is the first node that lies in the path from node 5 to root node 1 and from node 8 to root node 1.

Path from node 5 to root node looks like 5 → 2 → 1.

Path from node 8 to root node looks like 8 → 6 → 2 → 1.

Since 2 is the first node that lies in both paths. Hence LCA will be 2.

Given any two nodes ‘u’ and ‘v’, find the LCA for the two nodes in the given Tree ‘T’.

Note: For each test case, the tree is rooted at node 1.

Problem approach

If left subtree height is greater, then the result is whatever returned by the left as it has highest depth elements.
Similarly if right subtree height is greater, then the result is whatever returned by the right as it has highest depth elements.
If heights of both left and right subtrees are equal then the current node is the common ancestors of the deepest leaves.

Try solving now
02
Round
Medium
Video Call
Duration70 minutes
Interview date30 Nov 2022
Coding problem1

First, they start with an introduction. Then they ask me about my current company and my projects. He also asks about some computer fundamentals. We discussed that much, and then he gave me coding questions and asked me to solve them with the best approach.

1. Left And Right Rotation Of A String

Easy
15m average time
85% success
0/40
Asked in companies
AmazonAmerican ExpressBajaj Electricals Ltd

You are given a string 'str' and an integer 'D'. Your task is to rotate the given string left (anticlockwise) and right (clockwise) by 'D' units from the starting index. You are required to return the rotated string.

Example :

Left-Right Rotation

Problem approach

It was a straightforward question, you just have to rotate the string1 2 times clockwise & anticlockwise and check if in any case it is equal to the second string.

Try solving now
03
Round
Hard
Video Call
Duration45 minutes
Interview date6 Dec 2022
Coding problem1

In this round, he asks me lot about my projects, sql, computer fundamentals, current job and role. Then after discussing all this he gives me one coding question at the end.

1. Detect Cycle in a Directed Graph

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

Given a directed graph, check whether the graph contains a cycle or not. Your function should return true if the given graph contains at least one cycle, else return false.

Problem approach

Its a simple dfs question and we just need to do dfs and check if we are visiting the same node again, If yes, then there's is a cycle.

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
4 rounds | 7 problems
Interviewed by American Express
4130 views
0 comments
0 upvotes
company logo
SDE - 1
5 rounds | 8 problems
Interviewed by American Express
1217 views
0 comments
0 upvotes
company logo
SDE - 1
3 rounds | 6 problems
Interviewed by American Express
2400 views
1 comments
0 upvotes
company logo
SDE - 1
3 rounds | 4 problems
Interviewed by American Express
1517 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