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

Intern

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

Interview preparation journey

expand-icon
Preparation
Duration: 6 Months
Topics: Data Structures, Algorithms, OOP in Java, Operating System, Database Management System, Computer Network
Tip
Tip

Tip 1 : First master the basics.
Tip 2 : Make notes. Your future self will thank you.
Tip 3 : Practice and apply as much as possible.

Application process
Where: Other
Eligibility: Nope
Resume Tip
Resume tip

Tip 1 : Keep it short nd to the point.
Tip 2 : Don't make it too fancy

Interview rounds

01
Round
Medium
Online Coding Interview
Duration90 Minutes
Interview date9 Oct 2021
Coding problem1

It was on Sunday fixed time for all.

1. Happy Residents

Moderate
15m average time
85% success
0/80
Asked in company
American Express

Ninja town has ‘N’ houses along a street. The houses are either painted red or blue. The house colours are given in an integer array ‘color’, where 0 denotes the ith house is painted red, and 1 denotes the ith house is painted blue. The residents of a house will be happy if their house colour is different from both its neighbours if they exist. Hence, the Mayor decided to repaint some of the houses. But due to financial reasons, he wants to paint a minimum number of houses. Can you calculate the minimum number of houses that he needs to repaint?

Example: Suppose there are 3 houses and the colours [1, 1, 1], which means all the houses are coloured blue. If the Mayor repaints the second house to red, we will have the colours as [1, 0, 1]. We can see that all the neighbours will be happy. Hence, the minimum number of houses to be repainted is 1.

Try solving now
02
Round
Medium
Video Call
Duration40 Minutes
Interview date15 Apr 2022
Coding problem1

Mostly the questions were from OOPs and OS and there was coding questions from binary tree and queue.

1. Binary Tree Pruning

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

You have been given a Binary Tree where the value of each node is either 0 or 1. Your task is to return the same Binary Tree but all of its subtrees that don't contain a 1 have been removed.

Note :

A subtree of a node X is X, plus every node that is a descendant of X.

For Example :

Look at the below example to see a Binary Tree pruning.
Input: [1, 1, 1, 0, 1, 0, 1, 0, 0, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1]

alt text

Output: [1, 1, 1, -1, 1, -1, 1, -1, -1, -1, -1]

For example, the input for the tree depicted in the below image would be :

alt text

1
2 3
4 -1 5 6
-1 7 -1 -1 -1 -1
-1 -1

Explanation :

Level 1 :
The root node of the tree is 1

Level 2 :
Left child of 1 = 2
Right child of 1 = 3

Level 3 :
Left child of 2 = 4
Right child of 2 = null (-1)
Left child of 3 = 5
Right child of 3 = 6

Level 4 :
Left child of 4 = null (-1)
Right child of 4 = 7
Left child of 5 = null (-1)
Right child of 5 = null (-1)
Left child of 6 = null (-1)
Right child of 6 = null (-1)

Level 5 :
Left child of 7 = null (-1)
Right child of 7 = null (-1)

The first not-null node (of the previous level) is treated as the parent of the first two nodes of the current level. The second not-null node (of the previous level) is treated as the parent node for the next two nodes of the current level and so on.
The input ends when all nodes at the last level are null (-1).

Note :

The above format was just to provide clarity on how the input is formed for a given tree.

The sequence will be put together in a single line separated by a single space. Hence, for the above-depicted tree, the input will be given as:
1 2 3 4 -1 5 6 -1 7 -1 -1 -1 -1 -1 -1
Try solving now
03
Round
Medium
Video Call
Duration40 Minutes
Interview date15 Apr 2022
Coding problem1

I was asked to code question and then some basic questions from OS and SQL were asked.

1. Covid Vaccination

Moderate
0/80
Asked in companies
OracleAmerican ExpressShareChat

We are suffering from the Second wave of Covid-19. The Government is trying to increase its vaccination drives. Ninja wants to help the Government to plan an effective method to help increase vaccination following safety measures. Time is running out. Can you help the nation?

You are given two positive integers: ‘n,’ ‘maxVaccines’ denoting the number of days for which this vaccination drive will go on and the total number of vaccines available for the drive, respectively. You have to find the number of vaccines administered each day. You are also given a number ‘dayNumber,’ and we are interested to know the maximum number of vaccines that can be administered on ‘dayNumber’ th day.

The rules of the vaccination drive :

1. There should be a positive number of vaccines administered each day during the vaccination drive.

2. The absolute difference between the number of vaccines in two consecutive days should not exceed 1.

3. The sum of all the elements of the vaccines array does not exceed maxVaccines, that is, you cannot administer more vaccines than what is provided to you.

4. Vaccines administered on ‘dayNumber’ th day should be maximized.

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
SDE - 1
5 rounds | 8 problems
Interviewed by American Express
1247 views
0 comments
0 upvotes
company logo
SDE - 1
3 rounds | 6 problems
Interviewed by American Express
2542 views
1 comments
0 upvotes
company logo
SDE - 1
3 rounds | 4 problems
Interviewed by American Express
1555 views
0 comments
0 upvotes
company logo
SDE - 1
3 rounds | 3 problems
Interviewed by American Express
63 views
0 comments
0 upvotes
Companies with similar interview experiences
company logo
Intern
3 rounds | 4 problems
Interviewed by CIS - Cyber Infrastructure
650 views
0 comments
0 upvotes
company logo
Intern
2 rounds | 2 problems
Interviewed by Microsoft
1499 views
0 comments
0 upvotes
company logo
Intern
2 rounds | 2 problems
Interviewed by Adobe
1019 views
0 comments
0 upvotes