Search Questions

Latest Questions

#1

There are 'N' coders standing in a line, where i denotes the ith position of a coder with a rating of Ri. All ratings are distinct.

You have to form a team of 3 from amongst them with the condition:
- Any three coders with positions (i, j, k) and ratings (Ri, Rj, Rk) can form a team when ("Ri < Rj < Rk" or "Ri > Rj > Rk") and (1 <= i < j < k <= N).

You have to find out how many such teams e

Asked in: GOLDMANSACHS


Buyer: 1
Code Size: 38
#2

A birthday party was attended by N number of kids, and each kid was given a unique ID ranging from 1 to N. As a return gift, there are T toys that must be distributed to the kids.

The host decided the best way to do this is by sitting the kids down in a circle (ordered by ascending ID), and then, starting with a random number D (between 1 and N), distribute one toy at a time to each sequentiall

Asked in: GOLDMANSACHS


Buyer: 0
Code Size: 28
#3

Given a matrix of size m * n, where m denotes the number of rows (starting with index 0) and n denotes the number of columns (starting with index 0), the matrix will hold distinct integers as elements.

We need to find the distinct number of positional elements that are either the minimum or maximum in their corresponding row or column. If any row or any column has multiple minimum or maximum el

Asked in: GOLDMANSACHS


Buyer: 1
Code Size: 24
#4

A traveler is traveling from the city of Zeta to Omega. He starts with X amount of money. Every day he spends some money and may also work on certain days to earn money. On some days, he may earn more than he spends, and on other days, he may spend more than he earns.

You are given an array of integers, which represents his net savings (earnings - expenses) on any day. Your task is to find out

Asked in: GOLDMANSACHS


Buyer: 0
Code Size: 17
#5

As an operations engineer at Amazon, you are responsible for organizing the distribution of n different items in the warehouse. The size of each product is provided in an array `productSize`, where productSize[i] represents the size of the i-th product.

You construct a new array called `variation`, where each element `variation[i]` is the difference between the largest and smallest product size

Asked in: AMAZON


Buyer: 0
Code Size: 13
#6

Given a matrix of size m * n, where m denotes the number of rows (starting with index 0) and n denotes the number of columns (starting with index 0). The elements in the matrix are populated with values either 1 or 0. A 1 indicates the matrix position is available for establishing the connection, and a 0 indicates the matrix position is not available for establishing the connection.

We need to

Asked in: JPMORGAN


Buyer: 0
Code Size: 17
#7

Amazon is launching a revolutionary security feature that incorporates an advanced antivirus program, adept at identifying and halting potential threats. This framework manages n active programs, each with a unique Program Identifier (PID). The antivirus program evaluates the overall security risk of the system using a specialized algorithm.

The algorithm analyzes contiguous subarrays of Progr

Asked in: AMAZON


Buyer: 0
Code Size: 28
#8

Amazon Games has recently launched a new game called Match the Column in which players are supposed to match the numbers from the left column to the right column like a traditional match the column game. Given an array of integers, match, the i-th index in the left column is matched with match[i] in the right column. There is a twist: Intersecting matches, illustrated below, are not allowed.

De

Asked in: AMAZON


Buyer: 0
Code Size: 14
#9

Todd has a grid sheet of paper measuring N by M units and plans to draw squares on it. Each cell in the grid contains an integer X, which represents the center of a square with dimensions (2X - 1) by (2X - 1). Given this grid, Todd wants to know how many squares enclose specific cells. You will be asked Q queries, each with two numbers A and B. Your task is to determine how many of Todd's squares

Asked in: AMAZON_HACKON


Buyer: 1
Code Size: 59
#10

You are given an 8x8 chess board. The board has your rook denoted by 'R' and the rest of the cells are either blank, denoted by 'B' or they have some piece upon them denoted by 'P'. You can move over the blank cells only. A rook can move along its entire row or column in 1 move, up to the point where blank spaces are available.

If current coordinates of a rook are (x, y) then rook can move in t

Asked in: AMAZON_HACKON


Buyer: 0
Code Size: 70