Google Google OA-1 2023 Problem Description You are presented with an undirected tree consisting of N nodes, each assigned a specific value. Your task is to partition these nodes into the smallest number of groups possible, ensuring that no two adjacent nodes are included in the same group. For any group G, consider a
Google Google OA-2 2023 Problem Description You are given N toys in a shop, each with a price represented in an array A. You have a budget of C to spend on toys, and there are K broken toys that you want to avoid purchasing. For each of the Q queries, your task is
Google Google OA-3 2023 Problem Description You are provided with a string S made up entirely of 0's and 1's. Your task is to count the number of substrings in which the number of 1's exceeds the number of 0's. Note: A substring of a string
Google Google OA-4 2023 Problem Description You are presented with a matrix M that contains n rows and m columns, filled exclusively with 0's and 1's. A right-angled isosceles triangle is defined by the following criteria: * The hypotenuse must be parallel to the x-axis. * The length of the hypotenuse must
Google Google OA-5 2023 Problem Description You are given an array of S containing N elements. Your goal is to determine the count of distinct arrays A of N elements that satisfy the following conditions: * A[i] < A[i+1] for all 1 ≤ i < N. * The sum of the digits of A[
Google Google OA-6 2023 Problem Description A hybrid sequence is a sequence that can be divided into two disjoint subsequences. Every subsequence is an array. Given two arrays, A and B, of sizes N and M, respectively. You are also given a hybrid sequence S. The expression Σ (i=1 to N+M) max(
Google Google OA-7 2023 Problem Description You are given the following: Two integers N and K and an array A of size N. Let sequence B(B_1, B_2, ..., B_2K) of size 2K is a subsequence of array A. Let's define F(B)= (B_1 |B_2|...|B_K) ⊕ (B_
Flipkart Flipkart OA-2 2023 Problem Description A schedule for an upcoming tech conference has been released, listing the start and end times of each session. Once a session begins, attendees cannot enter or leave the room. Moving between sessions takes no time. The task is to determine the maximum number of sessions a single
Intuit OA-2 2023 Problem Description Chef enters the kitchen which consists of N linear blocks where each block contains only 1 ingredient from a list of ingredients. Chef has to prepare the dish using one ingredient I. To prepare the dish D, the first task for Chef is to group blocks of all
Zomato Zomato OA-2 2022 Problem Description Given three integers A, B, and C, the goal is to compute the sum of all possible numbers that can be formed using the digit 4 up to A times, the digit 5 up to B times, and the digit 6 up to C times. Note: Output the
BNY Mellon BNY Mellon OA-2 2023 Problem Description Lily is guiding a group of young students for an upcoming Mathematics Challenge in honor of Women's Day. In one of her lessons, she decides to teach the students about modulo arithmetic. She takes an array of numbers and asks the girls to perform the following
Uber Uber OA-2 2023 Problem Description HCVs (High Capacity Vehicles) run across the city of Disney Land. Disney Land has N stops where the HCVs pick up or drop the passengers. There is a network of M bidirectional roads that connect various stops. Each road has a particular length attached to it. The Disney
Juspay Juspay OA-2 2023 Problem Description You are given a forest (it may contain a single tree or more than one tree) with N nodes. Each node has an integer value ranging from 0 to (N-1). You need to determine the depth of the forest at which the maximum number of nodes are present.
Salesforce Salesforce OA-2 2023 Problem Description In the game of cricket, players can score runs by hitting the ball delivered by another player (the bowler) and running between designated spots (wickets). Suppose a player is only allowed to score 1, 2, 4, or 6 runs on any ball. How many ways can the player
Morgan Stanley Morgan Stanley OA-2 2022 Problem Description A product manufacturing company labels all its products and manages production through an online hierarchy on their website. Each product is represented as a node in the hierarchy, where the node’s value denotes the quantity of the manufactured product. The oldest product is set as the root
Cisco Cisco OA-2 2022 Problem Description Company ABC operates a corporate campus that consists of multiple buildings, which may or may not be linked to each other. Goal: Alice in figuring out the minimum number of mail rooms required to ensure all buildings are adequately serviced, considering the following constraints: Constraints: * Each building can
Oracle Oracle OA-3 2023 Problem Description Alice has an integer array A of length N. However, due to a virus, some digits in these integers have been replaced by uppercase English letters from 'A' to 'J'. For example, let us suppose an integer was "1221321", and due to
Flipkart Flipkart OA-3 2023 Problem Description A networking company is implementing procedures to manage network traffic. The network server is connected to N devices (numbered from 0 to N-1). The server receives messages from each of these N devices, which are then transmitted in different possible sequences. The team has generated M possible sequences
JP Morgan JP Morgan OA-3 2023 Problem Description You are provided with a string str of length n. Your task is to find and print the largest integer found within the string. An integer is formed by consecutive digit characters in the string. Note: * If no integer is present in the string, print -1. * If the
Intuit Intuit OA-3 2023 Problem Description Emma is playing a game with a sequence made up of only 0's and 1's. She wants to determine how many subarrays have a specific ratio of 0's to 1's, which is given by the ratio X:Y. However, as
Zomato Zomato OA-3 2022 Problem Description You are given an array A of integers with size N. Additionally, there are Q queries to be processed on this array. For each query, three integers L, R, and X are provided, and the task is to compute the sum of the XOR between X and each
Morgan Stanley Morgan Stanley OA-4 2022 Problem Description An online taxi service is facing losses due to recent changes in its discount prices. To address the issue, the team has created a list of M places in a city with N routes between them. Each route has three components: 1. The pickup position ID. 2. The
Uber Uber OA-3 2023 Problem Description Earth is now home to sentient creatures from thousands of different planets. As part of a committee maintaining the records of these visitors, you are tasked with answering queries about the guests. One evening, you receive a query from the Daily Newspaper, which is writing an article on
Juspay Juspay OA-3 2023 Problem Description You are given a forest with N nodes, where each node has an integer value from 0 to N-1. Each node's parent is described by an array, where the value at index i indicates the parent of node i. Your task is to perform a level
Salesforce Salesforce OA-3 2023 Problem Description After defeating Dr. Eggman, Sonic the Hedgehog has returned to the Green Hill Zone. The forest critters make him the de facto king for his victory. However, the oxygen levels in the zone are unstable, and Sonic needs to evacuate his subjects to a safe area as soon