Search Questions

Latest Questions | Page 8

#1

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
#2

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
#3

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
#4

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
#5

A number x is called beautiful if the bitwise XOR of all elements from 0 to x is equal to x.

Task
Given an array A of N integers, find the number of beautiful elements in it.

Function Description
Complete the function solve() provided in the editor. This function takes the following parameters and returns the required answer:

- N: Represents the number of elements in the array

Asked in: Meesho


Buyer: 1
Code Size: 20
#6

The manager of an Amazon warehouse needs to ship n products from different locations. The location of the i-th product is represented by an array locations[i]. The manager is allowed to perform one operation at a time. Each operation is described below:

1. If the inventory has two or more products, the manager can pick two products x and y from the inventory if they have different locations,

Asked in: Amazon


Buyer: 1
Code Size: 21
#7

After all the servers are down, the developers must send one more request to conclude the failure of the application.

The developers at Amazon want to perform a reliability drill on some servers. There are n servers where the i-th server can serve request[i] number of requests and has an initial health of health[i] units.

Each second, the developers send the maximum possible number of re

Asked in: Amazon


Buyer: 1
Code Size: 11
#8

A service maintains a database with three string columns:

Column Name | Description
------------|------------
user_id | The user ID of the user who created the URL
short_url | The shortened URL
actual_url | The actual URL to redirect to

There are m users with ids from 0 to m - 1 and q requests for the short URLs. For each request i, report the actual URL and the number of reque

Asked in: Amazon


Buyer: 0
Code Size: 64
#9

Given a string, how many different substrings exist in it that have no repeating characters? Two substrings are considered different if they have a different start or end index.
Example
s = "abac"
The substrings that have no repeating characters in them are "a", "b", "a", "c", "ab", "ba", "ac", and "bac". Note that "aba" and "abac" do not qualify because the character 'a' is repeated in t

Asked in: Amazon


Buyer: 0
Code Size: 42
#10

Network Park - Maximum Noiseless Networks

A network company wants to establish a network park to reduce the noise of different network operators. In network park, different operators will setup up their sender antenna, or receiver antenna, or both. The sender antenna and receiver antenna are represented by two list of size N and M respectively. These antennas will only receive/send to their r

Asked in: Flipkart


Buyer: 1
Code Size: 17