GetMinimalCost
One of the products listed on Amazon Ecommerce is available in n sizes as indicated in the array size. The category manager recognizes that some of the sizes are repetitive and do not provide a good user experience. To make the best use of inventory, the product should be available in distinct sizes. The size of the ith product, size[i], can be increased by one unit for an amount
Asked in: AMAZON
User Transaction Report for 2023
In the digital age, payment systems are essential for online transactions. For businesses managing these systems, understanding user activity is key to optimizing services and enhancing engagement.
A development team is tasked with creating a report that shows:
The total number of transactions made by each user.
The total sum of those transactions.
Analyzing t
Asked in: DOCUSIGN
Roman Numerals
You are given an array of integers. Your task is to convert each integer into its Roman numeral equivalent.
The following table contains some reference values for converting between Arabic (standard integers) and Roman numerals:
Arabic - Roman
1 - I
4 - IV
5 - V
9 - IX
10 - X
40 - XL
50 - L
90 - XC
100 - C
400 - CD
500 - D
900 - CM
1000 - M
Example
Input: n
Asked in: DOCUSIGN
Hackerrank developers want to deploy an application on a set of exactly k servers with different vulnerabilities. They have an option to choose the k servers from a sequence of n servers where vulnerability[i] represents the vulnerability of the ith server.
The vulnerability of the chosen k servers is defined as the maximum vulnerability amongst any of the chosen servers. To avoid congestion, t
Asked in: DOCUSIGN
FindMaximumWeights
Amazon's fulfillment centers handle packages of various weights, and they need to optimize their sorting process.
Given an array weight that denotes the weights of n packages, the goal is to create the lexicographically maximal resulting array sorted in non-increasing order using the following operations:
1. Discard the first package from the current weight array.
2. A
Asked in: Amazon
GetMaxThroughput
The developers at Amazon are working on optimizing database query times. There are n host servers, where the throughput of the i-th host server is given by host_throughput[i].
These servers are grouped into clusters of size three. The throughput of a cluster, denoted as cluster_throughput, is defined as the median of the three servers’ throughput values. Each host server can
Asked in: Amazon
Given a String and an Array
Your solution will be scored against multiple hidden test cases, with a sample case provided for reference.
The default code includes a mechanism for reading input strings. You will need to parse these strings into the appropriate variables as needed.
The output data type does not matter, as long as the characters in the output match the expected result.
Task:
Give
Asked in: No companies listed
Format a String
Your solution will be scored against multiple hidden test cases, with a sample case provided for your reference.
The default code includes a mechanism for reading input strings. You will need to parse these strings into the appropriate variables as needed.
The output data type is not a concern, as long as the characters within the output match the expected outcome.
Task:
Giv
Asked in: No companies listed
CPU scheduling algorithms are used to efficiently manage the execution of processes. A core can handle one process at a time, but CPUs often have multiple cores. Given n processes, where ith process starts at start i and finishes at end i, both inclusive, determining the minimum number of cores needed to handle all the processes.
Asked in: IDFC
In an e-commerce product search system, users input queries to search for items. You are given an array products of length n representing the product names and an array queries of length q containing search query strings.
Implement a function that, for each query string, returns all products that are anagrams of the query string. An anagram is any string that can be formed by rearranging the le
Asked in: IBM