Search Questions

Latest Questions | Page 11

#1

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

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

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

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

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

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

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

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

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

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