Add office photos
Engaged Employer

Amazon

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

10+ HCP Wellness Interview Questions and Answers

Updated 5 Feb 2024
Popular Designations

Q1. Ways To Make Coin Change

Given an infinite supply of coins of varying denominations, determine the total number of ways to make change for a specified value using these coins. If it's not possible to make the c...read more

Ans.

The task is to find the total number of ways to make change for a specified value using given denominations.

  • Use dynamic programming to solve this problem efficiently.

  • Create a 2D array to store the number of ways to make change for each value using different denominations.

  • Iterate through each denomination and update the array based on the number of ways to make change for each value.

  • Return the value at the last cell of the array as the final result.

Add your answer

Q2. Shopping Options Problem Statement

Given arrays representing the costs of pants, shirts, shoes, and skirts, and a budget amount 'X', determine the total number of valid combinations that can be purchased such t...read more

Ans.

Determine total number of valid shopping combinations within budget

  • Iterate through all possible combinations of items from each array

  • Check if the total cost of the combination is within the budget

  • Return the count of valid combinations

Add your answer

Q3. Reverse Linked List Problem Statement

Given a Singly Linked List of integers, your task is to reverse the Linked List by altering the links between the nodes.

Input:

The first line of input is an integer T, rep...read more
Ans.

Reverse a singly linked list by altering the links between nodes.

  • Iterate through the linked list and reverse the links between nodes

  • Use three pointers to keep track of the current, previous, and next nodes

  • Update the links between nodes to reverse the list

  • Return the head of the reversed linked list

Add your answer

Q4. Median in a Stream Problem Statement

Your task is to determine the median of integers as they are read from a data stream. The median is the middle value in the ordered list of numbers. If the list length is ev...read more

Ans.

Find median of integers in a data stream as they are read.

  • Use two heaps - max heap for lower half of numbers and min heap for upper half.

  • Keep the size of two heaps balanced to find the median efficiently.

  • Handle even and odd number of elements separately to calculate median.

  • Return vector of medians after each element is read from the stream.

Add your answer
Discover HCP Wellness interview dos and don'ts from real experiences

Q5. Max Submatrix Problem Statement

You are provided with a matrix MAT consisting of integers, with dimensions N x M (i.e., N rows and M columns). Your objective is to determine the maximum sum submatrix within thi...read more

Ans.

Find the maximum sum submatrix in a given matrix.

  • Iterate over all possible submatrices and calculate their sums

  • Use Kadane's algorithm to find the maximum sum subarray in each row

  • Combine the sums of rows to find the maximum sum submatrix

Add your answer

Q6. The Ninja Port Problem

Ninja is in a city with 'N' colonies, where each colony contains 'K' houses. He starts at house number "sourceHouse" in colony number "sourceColony" and wants to reach house number "desti...read more

Ans.

The Ninja Port Problem involves finding the minimum time for a ninja to travel between colonies and houses using secret paths and teleportation.

  • Calculate the minimum time considering teleportation within colonies, traveling between colonies, and secret paths.

  • Keep track of the number of secret paths used and ensure they are one-way.

  • Consider the constraints provided to optimize the solution.

  • Example: N=2, K=3, S=1, P=1, sourceHouse=1, sourceColony=1, destinationHouse=3, destinat...read more

Add your answer
Are these interview questions helpful?

Q7. Course Schedule II Problem Statement

You are provided with a number of courses 'N', some of which have prerequisites. There is a matrix named 'PREREQUISITES' of size 'M' x 2. This matrix indicates that for ever...read more

Ans.

Given courses with prerequisites, determine a valid order to complete all courses.

  • Create a graph with courses as nodes and prerequisites as edges.

  • Use topological sorting to find a valid order to complete all courses.

  • Return an empty list if it's impossible to complete all courses.

Add your answer

Q8. Validate Binary Search Tree (BST)

You are given a binary tree with 'N' integer nodes. Your task is to determine whether this binary tree is a Binary Search Tree (BST).

BST Definition:

A Binary Search Tree (BST)...read more

Ans.

Validate if a given binary tree is a Binary Search Tree (BST) or not.

  • Check if the left subtree of a node contains only nodes with data less than the node's data

  • Check if the right subtree of a node contains only nodes with data greater than the node's data

  • Recursively check if both left and right subtrees are also binary search trees

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

Q9. Clone a Binary Tree with Random Pointers

Given a binary tree where each node has pointers to its left, right, and a random node, create a deep copy of the binary tree.

Input:

The first line contains an integer ...read more
Ans.

Clone a binary tree with random pointers and verify if cloning was successful by printing inorder traversal.

  • Create a deep copy of the binary tree with random pointers.

  • Print the inorder traversal of the cloned binary tree.

  • Verify cloning success by printing '1' if successful, '0' otherwise.

Add your answer

Q10. Group Anagrams Together

Given an array/list of strings STR_LIST, group the anagrams together and return each group as a list of strings. Each group must contain strings that are anagrams of each other.

Example:...read more

Ans.

Group anagrams together in a list of strings.

  • Iterate through the list of strings and sort each string to group anagrams together.

  • Use a hashmap to store the sorted string as key and the original string as value.

  • Return the values of the hashmap as the grouped anagrams.

Add your answer

Q11. Add Two Numbers Represented by Linked Lists

Your task is to find the sum list of two numbers represented by linked lists and return the head of the sum list.

Explanation:

The sum list should be a linked list re...read more

Ans.

Add two numbers represented by linked lists and return the head of the sum list.

  • Traverse both linked lists simultaneously while keeping track of carry from previous sum

  • Create a new linked list to store the sum of the two numbers

  • Handle cases where one linked list is longer than the other by padding with zeros

  • Update the sum and carry values accordingly while iterating through the linked lists

Add your answer

Q12. Distance Between Two Nodes in a Binary Tree

Given a binary tree and the values of two distinct nodes, determine the distance between these two nodes in the tree. The distance is defined as the minimum number of...read more

Ans.

Calculate the distance between two nodes in a binary tree.

  • Traverse the tree to find the paths from the root to each node

  • Find the lowest common ancestor of the two nodes

  • Calculate the distance by summing the distances from each node to the common ancestor

Add your answer
Q13. Design a live video broadcast platform.
Ans.

Design a live video broadcast platform.

  • Implement video streaming functionality using protocols like RTMP or WebRTC

  • Include features for live chat, reactions, and audience engagement

  • Ensure scalability and reliability by using cloud services like AWS or Azure

  • Provide analytics for viewership data and user engagement

  • Integrate monetization options such as ads or subscriptions

Add your answer

More about working at Amazon

Top Rated Mega Company - 2024
Top Rated Company for Women - 2024
Top Rated Internet/Product Company - 2024
Contribute & help others!
Write a review
Share interview
Contribute salary
Add office photos
Interview Tips & Stories
Ace your next interview with expert advice and inspiring stories

Top SDE-2 Interview Questions from Similar Companies

3.7
 • 19 Interview Questions
4.0
 • 16 Interview Questions
3.9
 • 14 Interview Questions
4.0
 • 11 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
75 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