American Express
Proud winner of ABECA 2025 - AmbitionBox Employee Choice Awards
Filter interviews by
Given a binary tree, your task is to print the left view of the tree.
The input will be in level order form, with node values separated by a ...
Print the left view of a binary tree given in level order form.
Traverse the tree level by level and print the first node encountered at each level
Use a queue to perform level order traversal
Keep track of the current level and the maximum level seen so far
Find the minimum number of swaps required to sort a given array of distinct elements in ascending order.
T (number of test cases)
For each test case:
N (size...
The minimum number of swaps required to sort a given array of distinct elements in ascending order.
Use a graph-based approach to find cycles in the array
Count the number of swaps needed to fix each cycle
Sum up the swaps needed for all cycles to get the total minimum swaps
Given an array of integers, determine the maximum sum of a subsequence without choosing adjacent elements in the original array.
The first line consists of an ...
Find the maximum sum of a subsequence without choosing adjacent elements in an array.
Use dynamic programming to keep track of the maximum sum at each index, considering whether to include or exclude the current element.
At each index, the maximum sum is either the sum of the current element and the sum two positions back, or the sum at the previous index.
Iterate through the array and update the maximum sum accordin...
Given a list of cities numbered from 0 to N-1 and a matrix DISTANCE
consisting of 'N' rows and 'N' columns, representing the distances between each pair of cities, find the shor...
The Traveling Salesman Problem seeks the shortest route visiting each city once and returning to the start.
Brute Force Approach: Check all permutations of cities to find the shortest path, but this is inefficient for larger N.
Dynamic Programming: Use bitmasking to represent visited cities and memoization to store results, reducing time complexity.
Example: For cities 0, 1, 2 with distances 0-10-15, the optimal rout...
You are provided with two sorted lists of closed intervals, INTERVAL1
and INTERVAL2
. A closed interval [x, y] (x < y) signifies the set of real numbers z such that x &...
Find the intersections of two sorted lists of closed intervals.
Iterate through both interval lists to find intersections
Compare the intervals and find the common range
Handle cases where there is no intersection between intervals
Develop a Stack Data Structure to store integer values using two Queues internally.
Your stack implementation should provide these public functions:
Implement a stack using two queues to store integer values with specified functions.
Use two queues to simulate stack operations efficiently.
Maintain one queue for storing elements and another for temporary storage during push operation.
Ensure proper handling of edge cases like empty stack or invalid operations.
Example: Push operation involves transferring elements from one queue to another before adding the new el...
For a given singly linked list, identify if a loop exists and remove it, adjusting the linked list in place. Return the modified linked list.
Ai...
Detect and remove loop in a singly linked list in place with O(n) time complexity and O(1) space complexity.
Use Floyd's Cycle Detection Algorithm to identify the loop in the linked list.
Once the loop is detected, use two pointers to find the start of the loop.
Adjust the pointers to remove the loop and return the modified linked list.
Given an array of integers ARR
of length 'N' and a positive integer 'K', find the maximum elements for each contiguous subarray of size K.
ARR = [3, 4, ...
Implement a function to find maximum elements for each contiguous subarray of size K in an array of integers.
Iterate through the array and maintain a deque to store the indices of elements in decreasing order.
Pop elements from the deque that are out of the current window and add the maximum element to the result array.
Return the result array containing maximum elements for each subarray of size K.
Given a string S
of length N
and an integer K
, find the length of the longest substring that contains at most K
distinct characters.
The first ...
Find the length of the longest substring with at most K distinct characters in a given string.
Use a sliding window approach to keep track of the characters and their counts in the substring.
Maintain a hashmap to store the characters and their frequencies within the window.
Update the window size and characters count as you iterate through the string.
Keep track of the longest substring length with at most K distinct...
Given a singly linked list of integers, determine if it is a palindrome. A linked list is considered a palindrome if it reads the same forward and backward.
Check if a singly linked list is a palindrome by comparing elements from both ends.
Traverse the linked list to find the middle point
Reverse the second half of the linked list
Compare the first half with the reversed second half to check for palindrome
Example: Input: 1 2 3 2 1 -1, Output: true
I appeared for an interview before Dec 2020.
Round duration - 90 minutes
Round difficulty - Medium
It consist three question - first que is of related to tree and i gave difficulty level of this question as hard. second que is of based on logical and reasoning , it is medium level question and third que can be done by map and it is also medium level que.
In codility platform we are not able to see hidden test cases whether it is satisfied or not . we just have to submit after passing sample testcases.
Find the minimum number of swaps required to sort a given array of distinct elements in ascending order.
T (number of test cases)
For each test case:
N (siz...
The minimum number of swaps required to sort a given array of distinct elements in ascending order.
Use a graph-based approach to find cycles in the array
Count the number of swaps needed to fix each cycle
Sum up the swaps needed for all cycles to get the total minimum swaps
Given an array of integers, determine the maximum sum of a subsequence without choosing adjacent elements in the original array.
The first line consists of an...
Find the maximum sum of a subsequence without choosing adjacent elements in an array.
Use dynamic programming to keep track of the maximum sum at each index, considering whether to include or exclude the current element.
At each index, the maximum sum is either the sum of the current element and the sum two positions back, or the sum at the previous index.
Iterate through the array and update the maximum sum accordingly.
E...
Given a binary tree, your task is to print the left view of the tree.
The input will be in level order form, with node values separated by a...
Print the left view of a binary tree given in level order form.
Traverse the tree level by level and print the first node encountered at each level
Use a queue to perform level order traversal
Keep track of the current level and the maximum level seen so far
Round duration - 30 minutes
Round difficulty - Medium
basically this round is just same as HR round . they asked me behavioural questions and about my projects , hackathon. the timing is mid noon and interviewer is supportive , it makes first comfortable then start questioning . for this round i suggest be honest , don't just express your qualities but trying to show them by your skills and work.
Tip 1 : all we know focus on ds and algorithms is must but how should we prepare ? so , the answer is read concepts and then practice question topic wise or company wise in gfg.
Tip 2 : do focus on cp it is must to clear very first coding round. Also many of them do cp but in their comfort zone that means those question from which they have good hold but i say this would not give any benefit . so , solve que out of comfort zone , which takes time but is is most efficient way.
Tip 3 : Also balance between cp and projects is must.
Tip 1 : it is crisp . for ex - you have a good knowledge on java, cpp , c , python . and lets say you have basic knowledge of html,css then don't mention these subjects.
Tip 2 : Achievements should be in reverse chronological order like first focus on college achievements , then on school.
Tip 3 : i saw like many of them made just one resume and use for all , but i suggest each time made resume according to post you apply for and in which company. which increases your chances in shortlisted candidates.
I appeared for an interview before Sep 2020.
Round duration - 120 minutes
Round difficulty - Easy
The coding round was at 11 am in the morning. The questions were of medium level. The questions were purely based on Data Structures and Algorithms.
Given an array of integers ARR
of length 'N' and a positive integer 'K', find the maximum elements for each contiguous subarray of size K.
ARR = [3, 4,...
Implement a function to find maximum elements for each contiguous subarray of size K in an array of integers.
Iterate through the array and maintain a deque to store the indices of elements in decreasing order.
Pop elements from the deque that are out of the current window and add the maximum element to the result array.
Return the result array containing maximum elements for each subarray of size K.
Given a string S
of length N
and an integer K
, find the length of the longest substring that contains at most K
distinct characters.
The first...
Find the length of the longest substring with at most K distinct characters in a given string.
Use a sliding window approach to keep track of the characters and their counts in the substring.
Maintain a hashmap to store the characters and their frequencies within the window.
Update the window size and characters count as you iterate through the string.
Keep track of the longest substring length with at most K distinct char...
Round duration - 45 minutes
Round difficulty - Easy
I was selected for the interview. The interview was conducted early in the morning at 10 am. The interviewer was very friendly and calm.
Round duration - 30 minutes
Round difficulty - Easy
This round was a mix of technical, puzzles and HR. The interview was fairly easy, The interviewer asked for my introduction and continued with the interview then.
Develop a Stack Data Structure to store integer values using two Queues internally.
Your stack implementation should provide these public functions:
Implement a stack using two queues to store integer values with specified functions.
Use two queues to simulate stack operations efficiently.
Maintain one queue for storing elements and another for temporary storage during push operation.
Ensure proper handling of edge cases like empty stack or invalid operations.
Example: Push operation involves transferring elements from one queue to another before adding the new element...
Round duration - 45 minutes
Round difficulty - Easy
This was the last round for getting selected as an intern. However, this was a pure technical round. Only coding questions were asked. Also, at the end he asked me the question, Why American express?
For a given singly linked list, identify if a loop exists and remove it, adjusting the linked list in place. Return the modified linked list.
A...
Detect and remove loop in a singly linked list in place with O(n) time complexity and O(1) space complexity.
Use Floyd's Cycle Detection Algorithm to identify the loop in the linked list.
Once the loop is detected, use two pointers to find the start of the loop.
Adjust the pointers to remove the loop and return the modified linked list.
You are provided with two sorted lists of closed intervals, INTERVAL1
and INTERVAL2
. A closed interval [x, y] (x < y) signifies the set of real numbers z such that x ...
Find the intersections of two sorted lists of closed intervals.
Iterate through both interval lists to find intersections
Compare the intervals and find the common range
Handle cases where there is no intersection between intervals
Tip 1 : Have confidence in Data Structures and Algorithms. Have your concepts very clear and then pick one coding platform( leetcode, InterviewBit, CodeZen, GeeksForGeeks) and try to practice around 7-10 questions everyday with varying difficulty and different topics.Also solving questions is not enough, try to optimize it. Analyze its space and time complexities.
Tip 2 : Study properly about OOPS concepts. Coding Ninja's Data Structures and Algorithms course is great for preparing the OOPS concepts specifically. For OS and DBMS refer to your college notes and GeekForGeeks articles.
Tip 3 : Keep participating in coding contests. It helps you increase your problem solving skills.
Tip 1 : Add those skills, projects and achievements which are relevant to your role.
Tip 2 : Do not fake any skills, projects or achievements.
Tip 3 : You do need to have a several number of projects. 1 good project with good knowledge of it will also do fine. The similar rule goes for skills also.
Tip 4 : Try to write achievements which proves your technical skills, leadership quality, communication skills or teamwork.
I appeared for an interview before Sep 2020.
Round duration - 120 minutes
Round difficulty - Easy
It consisted of 3 coding questions which were purely based on Data Structures and Algorithms.
Question 1 - Find the length of the longest switching sub-array. An array is called switching if all numbers in even positions are equal and all numbers in odd positions are equal.
Question 2 - It was a long passage question on Dynamic Programming but the solution was really easy.
Question 3 - Given a string S consisting of N lowercase letters, return the minimum number of letters that must be deleted to obtain a word in which every letter occurs a unique number of times. Ex - "aaaabbbb" should return 1, as when we delete 1 a or 1 b , a and b will have different frequencies.
The major point to note in the coding round was that they did not have any time or space limit, so brute force solutions were also accepted.
The result of my test was declared just as the test ended and I scored a 100%, but they took a long time to release the final shortlist. There was a gap of about a week between the test and interviews.
Determine the length of the longest contiguous subarray in a given array of positive integers, where the subarray qualifies as 'switching'. An array is defined...
Find the length of the longest switching subarray in a given array of positive integers.
Iterate through the array and keep track of the longest switching subarray found so far.
Check if the numbers at even and odd positions are identical to determine a switching subarray.
Return the length of the longest switching subarray.
Example: For input [1, 4, 1, 4, 3, 2, 3, 0], the longest switching subarray is [1, 4, 1, 4] with le...
Given a string 'STR' with lowercase letters, determine the minimum number of deletions required to ensure that every letter in the string appears a unique number of time...
The task is to find the minimum number of deletions needed in a string to ensure each character appears a unique number of times.
Iterate through the string and count the frequency of each character
Track the frequencies in a hashmap
Identify the characters with duplicate frequencies and calculate the minimum deletions needed
Return the minimum number of deletions for each test case
Round duration - 40 minutes
Round difficulty - Easy
Amex came for two profiles - Tech Role and Analyst, 19 and 23 people respectively were shortlisted for the interviews. Fortunately, I was shortlisted for both the roles. I was asked basic question of C++ and it was majorly an HR Round
Round duration - 20 minutes
Round difficulty - Easy
It was a fairly simple round conssting of 5 - 6 questions related to coding, puzzles and me.
What are your interests?
What projects have you done and your field of interest?
Round duration - 50 minutes
Round difficulty - Easy
This round was purely technical
No introduction was done, straight to the point
My preference was the Tech Role, so as I was selected in this, I never had to give interviews for the Analyst role. In total 5 people were selected in the Analyst profile and 4 in the Tech profile.
In the end, I was offered a 6 months internship at Amex.
Given a singly linked list of integers, determine if it is a palindrome. A linked list is considered a palindrome if it reads the same forward and backward.
Check if a singly linked list is a palindrome by comparing elements from both ends.
Traverse the linked list to find the middle point
Reverse the second half of the linked list
Compare the first half with the reversed second half to check for palindrome
Example: Input: 1 2 3 2 1 -1, Output: true
Tip 1 : Do practice a lot of data structures from renowned websites like LeetCode and also from CodeZen
Tip 2 : In your introduction, when asked, you just need to tell your life story.
Tip 3 : Maintain eye contact with the interviewers and clarify every details about the question before proceeding to the solution
Tip 1: Add most recent and relevant projects only
Tip 2: you should know each and everything written on your resume
I appeared for an interview before Nov 2020.
Given a list of cities numbered from 0 to N-1 and a matrix DISTANCE
consisting of 'N' rows and 'N' columns, representing the distances between each pair of cities, find the sho...
The Traveling Salesman Problem seeks the shortest route visiting each city once and returning to the start.
Brute Force Approach: Check all permutations of cities to find the shortest path, but this is inefficient for larger N.
Dynamic Programming: Use bitmasking to represent visited cities and memoization to store results, reducing time complexity.
Example: For cities 0, 1, 2 with distances 0-10-15, the optimal route is ...
Tip 1 : Do competitive programming in 1st and 2nd yr
Tip 2 : Clear the basic of all data structures, algorithms and time, space complexities before trying leetcode.
Tip 3 : Dedicate 2-3 months to Interviewbit.
Tip 1 : Have atleast 2 projects.
Tip 2 : Competitive Coding ranks gives advantage.
Top trending discussions
posted on 20 May 2017
I appeared for an interview in May 2017.
Yes, the string class can be extended in most programming languages.
Inheritance can be used to extend the functionality of the string class.
By creating a new class that inherits from the string class, additional methods and properties can be added.
Extending the string class allows for customization and adding specific functionality to strings.
Example: In Python, the string class can be extended by creating a new class ...
Implicit objects in JSP are predefined objects that are available for use without any declaration or initialization.
Implicit objects in JSP include request, response, session, application, out, config, pageContext, page, exception, and others.
These objects provide access to various aspects of the JSP environment and can be used to perform common tasks.
For example, the request object allows access to HTTP request parame...
A hash map is a data structure that uses a hash function to map keys to values.
Hash map stores key-value pairs
It uses a hash function to compute an index for each key
Collisions can occur when two keys hash to the same index
Hash maps provide fast access to values based on their keys
StringBuffer and StringBuilder are both used to manipulate strings, but StringBuffer is thread-safe while StringBuilder is not.
StringBuffer is synchronized, making it safe for use in multi-threaded environments.
StringBuilder is not synchronized, making it faster but not thread-safe.
StringBuffer is preferred when multiple threads are involved, while StringBuilder is preferred for single-threaded scenarios.
Both classes p...
MVC is a software architectural pattern that separates an application into three main components: Model, View, and Controller.
Model represents the data and business logic of the application.
View is responsible for displaying the user interface.
Controller handles user input, updates the model, and interacts with the view.
MVC promotes separation of concerns and modularity in software development.
Example: In a web applica...
Annotations used in RESTful web services
1. @Path - Specifies the URI path for the resource
2. @GET - Specifies that the method handles HTTP GET requests
3. @POST - Specifies that the method handles HTTP POST requests
4. @PUT - Specifies that the method handles HTTP PUT requests
5. @DELETE - Specifies that the method handles HTTP DELETE requests
6. @PathParam - Binds the value of a URI template parameter to a method paramete...
I appeared for an interview before Mar 2021.
Round duration - 90 minutes
Round difficulty - Medium
There were 33 questions in total. The objective questions were simple.
Mary is an enthusiastic party-goer who struggles with remembering event dates. Help Mary by sorting a given list of event dates in an ascending order.
Sort a list of event dates in ascending order based on year, month, and day.
Sort the list of dates based on year, then month, and finally day.
Use a sorting algorithm to rearrange the dates in ascending order.
Ensure the constraints are met for each date in the list.
You are given an integer array 'ARR' of size 'N' and an integer 'S'. Your task is to find and return a list of all pairs of elements where each sum of a pair equals 'S'.
Given an array and a target sum, find all pairs of elements that add up to the target sum.
Iterate through the array and for each element, check if the complement (target sum - current element) exists in a hash set.
If the complement exists, add the pair to the result list.
Sort the pairs based on the first element and then the second element.
Handle edge cases like duplicate elements and pairs with the same values.
Example...
Given an integer N
, your task is to recursively break it into three integer parts: N / 2
, N / 3
, and N / 4
. You need to compute the maximum sum possible by dividing the numbe...
Given an integer N, recursively break it into three parts and find the maximum sum possible.
Recursively divide N into N/2, N/3, and N/4 to find the maximum sum
Compare the sum obtained by dividing N with the sum of N itself
Return the maximum sum for each test case
Tip 1 : Must do Previously asked Interview as well as Online Test Questions.
Tip 2 : Go through all the previous interview experiences from Codestudio and Leetcode.
Tip 3 : Do at-least 2 good projects and you must know every bit of them.
Tip 1 : Have at-least 2 good projects explained in short with all important points covered.
Tip 2 : Every skill must be mentioned.
Tip 3 : Focus on skills, projects and experiences more
I appeared for an interview before Mar 2021.
Round duration - 60 minutes
Round difficulty - Medium
Technical Interview round with questions based on DSA.
Given an array ARR
of size N
, containing each number between 1 and N-1
at least once, identify the single integer that appears twice.
The first line contains an integer...
Identify the duplicate integer in an array containing numbers between 1 and N-1.
Iterate through the array and keep track of the frequency of each element using a hashmap.
Return the element with a frequency greater than 1 as the duplicate integer.
Ensure the constraints are met and a duplicate number is guaranteed to be present.
You are given an arbitrary binary tree consisting of N nodes, each associated with an integer value from 1 to 9. Each root-to-leaf path can be considered a number formed by concat...
Calculate the total sum of all root to leaf paths in a binary tree formed by concatenating node values.
Traverse the binary tree from root to leaf nodes, keeping track of the current path sum
Add the current node value to the path sum and multiply by 10 for each level
When reaching a leaf node, add the final path sum to the total sum
Return the total sum modulo (10^9 + 7)
You are given a directed acyclic graph (DAG). Your task is to perform topological sorting of the graph and return any valid ordering.
A directed acyclic g...
Implement a function to perform topological sorting on a directed acyclic graph (DAG) and return any valid ordering.
Create a graph data structure to represent the DAG
Use depth-first search (DFS) to perform topological sorting
Maintain a visited array to keep track of visited nodes
Return the ordering of nodes after DFS traversal
Round duration - 60 minutes
Round difficulty - Easy
Technical interview round with questions based on DSA.
You are given a binary tree consisting of distinct integers and two nodes, X
and Y
. Your task is to find and return the Lowest Common Ancestor (LCA) of these two nodes...
Find the Lowest Common Ancestor (LCA) of two nodes in a binary tree.
Traverse the binary tree to find the paths from the root to nodes X and Y.
Compare the paths to find the last common node, which is the LCA.
Handle cases where one node is an ancestor of the other.
Consider edge cases like when X or Y is the root node.
Implement a recursive or iterative solution to find the LCA efficiently.
You are provided with a sorted array that has undergone 'K' rotations (the exact value of 'K' is unknown). A rotation involves shifting each element of the array to the right,...
Implement a function to find the minimum number in a rotated sorted array efficiently.
Use binary search to find the minimum element in the rotated array.
Compare the mid element with the start and end elements to determine which half of the array to search next.
Continue the binary search until the minimum element is found.
Given an array TREE
of 'N' unique integers, construct a maximum binary tree using the following rules:
TREE
.Construct a maximum binary tree from an array of unique integers following specific rules.
Find the maximum number in the array to set as the root of the tree.
Recursively construct the left subtree with elements before the maximum number.
Recursively construct the right subtree with elements after the maximum number.
Tip 1 : Must do Previously asked Interview as well as Online Test Questions.
Tip 2 : Go through all the previous interview experiences from Codestudio and Leetcode.
Tip 3 : Do at-least 2 good projects and you must know every bit of them.
Tip 1 : Have at-least 2 good projects explained in short with all important points covered.
Tip 2 : Every skill must be mentioned.
Tip 3 : Focus on skills, projects and experiences more.
Business Analyst
824
salaries
| ₹5.9 L/yr - ₹13.6 L/yr |
Assistant Manager
727
salaries
| ₹20 L/yr - ₹36 L/yr |
Senior Analyst
669
salaries
| ₹12.3 L/yr - ₹21 L/yr |
Analyst
567
salaries
| ₹12.1 L/yr - ₹20.5 L/yr |
Manager
511
salaries
| ₹27 L/yr - ₹47 L/yr |
MasterCard
Wells Fargo
JPMorgan Chase & Co.
HSBC Group