Search Questions

Latest Questions | Page 9

#1

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

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

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

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

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

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

Recruitment Software - Application Display Update
There are N applicants who have applied for a job vacancy. Each applicant has an application ID ranging from 1 to N.
During the initial round of recruitment, the company's software assigns each applicant a score value, which can be positive or negative:
- A positive score indicates the applicant is qualified for the vacancy.
- A negative score

Asked in: Flipkart


Buyer: 1
Code Size: 20
#8

A chat application is building a new immersive feature for their customers to enhance their experience. To train the model for this feature, the developers have prepared a dataset.

In the dataset, there are two columns:
The first column contains a new search term A (a string written without spaces).
The second column contains N unique space-separated words.
Task
The training model is design

Asked in: Flipkart


Buyer: 0
Code Size: 35
#9

Houses in Hackerland
The city of Hackerland has many houses, each of which is connected via roads. There are house_nodes number of houses, numbered 0 to house_nodes - 1, where each pair of houses is connected and has a unique shortest path between them. Thus, the network of houses and roads forms an undirected tree structure comprising house_nodes nodes and (house_nodes - 1) edges. Each of the ed

Asked in: Flipkart


Buyer: 0
Code Size: 92
#10

Modified Knapsack Problem

The Knapsack problem is a well-known problem in the field of computer programming and problem-solving. To make it more interesting, an interviewer uses a modified version of the problem.
Given n items, where the weight of the i-th item is 2^i, and the cost of the i-th item is cost[i], find the minimum amount needed to purchase the items such that the combined weight o

Asked in: Flipkart


Buyer: 0
Code Size: 51