Search Questions

Latest Questions | Page 8

#1

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


Buyer: 2
Code Size: 30
#2

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


Buyer: 0
Code Size: 31
#3

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


Buyer: 1
Code Size: 23
#4

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


Buyer: 1
Code Size: 23
#5

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


Buyer: 0
Code Size: 13
#6

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


Buyer: 2
Code Size: 62
#7

getQueryAnswers
In a machine learning model, there are n data entries stored in the model's output cache cacheEntries. Each entry contains three values:
1. timestamp โ€“ when the prediction was made.
2. modelId โ€“ the identifier of the machine learning model.
3. predictionValue โ€“ the model's output, represented as a string containing an integer.

A query handler receives q queries in th

Asked in: IBM


Buyer: 0
Code Size: 54
#8

A company needs an efficient strategy to optimize resource allocation for servers based on performance metrics. The performance of each server is represented by performance[i], where 0 โ‰ค i < n. A server's rank is defined by the count of distinct performance metrics that are greater than or equal to its own performance metric.
To allocate resources, two positive integer constants, inc and dec, are

Asked in: JPMORGAN


Buyer: 0
Code Size: 17
#9

FunWithAnagrams
Two strings are anagrams if they are permutations of each other. In other words, both strings have the
same size and the same characters. For example, "aaagmnrs" is an anagram of "anagrams". Given a
array of strings, remove each string that is an anagram of an earlier string then return the remaining array in sorted order.

Example
str = ['code', 'doce', 'ecod', 'framer', 'f

Asked in: JPMORGAN


Buyer: 0
Code Size: 12
#10

Take it apart

Given an array A of length N, Alex and Bob have decided to play a game called "Take it apart." At the beginning of the game, players pick a side of the array, either the start (S) or the end (E), and it's fixed for the rest of the game. Then, they start playing in turns. Alex goes first. They pick a number from their side and remove the number from the array. This number is cons

Asked in: Meesho


Buyer: 0
Code Size: 27