Add office photos
Employer?
Claim Account for FREE

American Express

4.2
based on 3.1k Reviews
Video summary
Proud winner of ABECA 2024 - AmbitionBox Employee Choice Awards
Filter interviews by

10+ Heights Incorporation Interview Questions and Answers

Updated 12 Nov 2024
Popular Designations

Q1. Maximum Non-Adjacent Subsequence Sum

Given an array of integers, determine the maximum sum of a subsequence without choosing adjacent elements in the original array.

Input:

The first line consists of an integer...read more
Ans.

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 can be either the sum of the current element and the element two positions back, or the sum at the previous index.

  • Iterate through the array and update the maximum sum accordingly.

  • Example: For input [3, 2, 7, 10], the maximum non-a...read more

Add your answer

Q2. Word Break Problem Statement

You are given a list of N strings called A. Your task is to determine whether you can form a given target string by combining one or more strings from A.

The strings from A can be u...read more

Ans.

Given a list of strings, determine if a target string can be formed by combining one or more strings from the list.

  • Iterate through all possible combinations of strings from the list to form the target string.

  • Use recursion to try different combinations of strings.

  • Check if the current combination forms the target string.

  • Return true if a valid combination is found, otherwise return false.

Add your answer

Q3. All Paths From Source Lead To Destination Problem Statement

In a directed graph with 'N' nodes numbered from 0 to N-1, determine whether every possible path starting from a given source node (SRC) eventually le...read more

Ans.

Determine if all paths from a source node lead to a destination node in a directed graph.

  • Check if there is at least one path from source to destination.

  • If a node has no outgoing edges, it should be the destination.

  • Ensure the number of paths from source to destination is finite.

  • Traverse the graph to validate all paths lead to the destination.

Add your answer

Q4. Find All Anagrams Problem Statement

Given a string STR and a non-empty string PTR, identify all the starting indices of anagrams of PTR within STR.

Explanation:

An anagram of a string is another string that can...read more

Ans.

Given a string STR and a non-empty string PTR, find all starting indices of anagrams of PTR within STR.

  • Create a frequency map of characters in PTR.

  • Use sliding window technique to check anagrams in STR.

  • Return the starting indices of anagrams found.

Add your answer
Discover Heights Incorporation interview dos and don'ts from real experiences

Q5. Ninja And The Tree Problem Statement

Ninja, while learning Binary Search Trees (BST), accidentally swapped two nodes in her self-constructed BST. Your task is to help Ninja by correcting the BST so that all pro...read more

Ans.

The task is to correct a Binary Search Tree by swapping two nodes in the tree.

  • Parse the input level order tree and construct the BST

  • Identify the two nodes that are swapped incorrectly

  • Swap the values of the incorrectly swapped nodes to correct the BST

  • Return the corrected BST in level order form

Add your answer

Q6. Maximum Sum With Specific Difference Problem Statement

Given an array of integers and a number 'K', your task is to find the maximum possible sum of disjoint pairs of numbers where the absolute difference betwe...read more

Ans.

Find maximum sum of disjoint pairs with absolute difference less than K in an array.

  • Iterate through the array and sort it.

  • Find all possible disjoint pairs with absolute difference less than K.

  • Calculate the sum of these pairs to get the maximum sum.

Add your answer
Are these interview questions helpful?
Q7. How can you detect a loop in a linked list?
Ans.

A loop in a linked list can be detected using Floyd's Cycle Detection Algorithm.

  • Use two pointers - slow and fast, where slow moves one step at a time and fast moves two steps at a time.

  • If there is a loop, the two pointers will eventually meet at some point within the loop.

  • To detect the start of the loop, reset one pointer to the head and move both pointers one step at a time until they meet again.

Add your answer

Q8. find if array of numbers, which are prime, using streams

Ans.

Use streams to find prime numbers in an array

  • Use Java streams to filter out non-prime numbers from the array

  • Check if a number is prime by dividing it by all numbers less than its square root

  • Create a method to check if a number is prime

Add your answer
Share interview questions and help millions of jobseekers 🌟

Q9. Spring java and how do you leverage in your project

Ans.

I leverage Spring Java for dependency injection, MVC framework, and transaction management in my projects.

  • Utilize Spring's dependency injection to manage object dependencies and improve code maintainability

  • Leverage Spring MVC framework for building web applications with clean separation of concerns

  • Use Spring's transaction management to ensure data integrity and consistency in database operations

Add your answer

Q10. How to implement security in microservices

Ans.

Implement security in microservices by using authentication, authorization, encryption, and monitoring.

  • Use authentication mechanisms like OAuth, JWT, or API keys to verify the identity of clients accessing the microservices.

  • Implement authorization controls to define what actions users can perform within the microservices.

  • Encrypt data in transit and at rest using protocols like HTTPS and TLS, and tools like Vault or AWS KMS.

  • Implement monitoring and logging to detect and respon...read more

Add your answer

Q11. A program to print 1 to n prime numbers

Ans.

Program to print 1 to n prime numbers

  • Iterate from 2 to n and check if each number is prime

  • Use a function to check if a number is prime

  • Print the prime numbers found

Add your answer

More about working at American Express

Top Rated Large Company - 2024
Top Rated Company for Women - 2024
Top Rated Financial Services Company - 2024
HQ - New York City,New York, United States
Contribute & help others!
Write a review
Share interview
Contribute salary
Add office photos

Interview Process at Heights Incorporation

based on 8 interviews
1 Interview rounds
Coding Test Round
View more
Interview Tips & Stories
Ace your next interview with expert advice and inspiring stories

Top Software Developer Interview Questions from Similar Companies

3.8
 • 71 Interview Questions
3.8
 • 47 Interview Questions
3.1
 • 19 Interview Questions
3.8
 • 16 Interview Questions
4.3
 • 15 Interview Questions
3.7
 • 15 Interview Questions
View all
Share an Interview
Stay ahead in your career. Get AmbitionBox app
qr-code
Helping over 1 Crore job seekers every month in choosing their right fit company
70 Lakh+

Reviews

5 Lakh+

Interviews

4 Crore+

Salaries

1 Cr+

Users/Month

Contribute to help millions

Made with ❤️ in India. Trademarks belong to their respective owners. All rights reserved © 2024 Info Edge (India) Ltd.

Follow us
  • Youtube
  • Instagram
  • LinkedIn
  • Facebook
  • Twitter