Search Questions

Latest Questions | Page 7

#1

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

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: 7
Code Size: 13
#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 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
#4

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

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

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

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

Prince was playing games on his computer all day, so his father decided to give him the task of arranging the books kept on the bookshelf. Prince can arrange the books on the bookshelf according to the book type, where an English alphabet denotes each book type. He is required to arrange the books in such a way that the book type having the lowest number of copies is kept first, and the book type

Asked in: AMAZON_HACKON


Buyer: 0
Code Size: 51
#9

You are given an NxN matrix 'mat' where each cell contains one of the two characters 'a' or 'z'. A man stands at the bottom-right corner of the matrix (mat[N-1][N-1]) and wants to reach the top-left corner of the matrix (mat[0][0]). The man can only move up or left at each step. Your task is to find the lexicographically smallest string that can be formed by following any valid path from mat[N-1][

Asked in: AMAZON_HACKON


Buyer: 1
Code Size: 60
#10

You want to transmit N packets over a network where each packet needs to be encrypted before being sent. Each packet has some integer data represented by the array data[]. To encrypt the data, you need to perform operations on the N packets. You are given 3 more arrays of length Q: 1. typeOfOperation[]: each element denotes the type of operation to be performed on data[i] (1 or 2), 2. numberOfPack

Asked in: AURIGO


Buyer: 0
Code Size: 18