Morgan Stanley Morgan Stanley OA-9 2024 Problem Description The library has a strategy for issuing books to its members. If a requested book is not available and there is no space for new books, the least recently used (LRU) book is removed to make room for the requested one. If there is space, the book is
Uber Uber OA-8 2023 Problem Description You are starting a Debate Club in your college and want to make its opening as eye-catching as possible! To achieve this, you plan to host a mock round table conference among the students. You sent out invitations to your colleagues, but they have one condition: each colleague
Cisco Cisco OA-11 2023 Problem Description Mandy's elder brother Rob is a chess prodigy. Mandy challenges Rob to a chess problem on a standard 8*8 board: * A knight is placed at the coordinates X. * There are M pawns placed at coordinates Y[i] (i = 1 to M). Task: Determine the minimum
Google Google OA-12 2024 Problem Description You are given N integers representing the locations of homes on a straight street (x-axis). The ith home is located at A[i], You need to determine the optimal integer location X to build a dark store such that the sum of the absolute distances from the dark
Uber Uber OA-9 2023 Problem Description You have a healthy tree with N nodes rooted at node 1, where each node has a certain number of fruits attached to it. In one operation, you can collect all the fruits from a node and keep them for yourself. A tree is considered healthy if there
Uber Uber OA-10 2023 Problem Description You are given a sorted array of vehicle types ( v ), where each element indicates the number of passengers that a vehicle can accommodate. Each vehicle type has an infinite supply. You also have a total number of passengers ( p ). Your task is to determine the minimum number of
Google Google OA-13 2024 Problem Description You are given a string S1 of length N. You have a machine that will generate a string Q of length M using a string S2 of length M. However, the machine will not generate the string Q at once. Initially. you're given a string Q
JP Morgan JP Morgan OA-6 2024 Problem Description You are given a string s that consists only of the characters 'X' and 'Y'. In one move, you can delete either the substring 'XY' or 'YY' and concatenate the remaining parts of the string. Objective: Return the minimum possible
Uber Uber OA-11 2023 Problem Description In the thrilling world of "Jump Master," you embark on a daring journey through a magical land with mystical teleporting stones. You are gifted with the power to make forward jumps based on the range indicated by each stone. The challenge lies in reaching the final
Uber Uber OA-12 2023 Problem Description In the modern world of text processing systems, we need to handle words with the same "feeling." Design an algorithm to efficiently group words that share the same "feeling." Two words have the same "feeling" if they contain the same letters with
Google Google OA-14 2024 Problem Description You are given an array of integers. Your task is to determine the maximum number of partitions you can make. A partition divides the array into two parts such that the sum of the elements in each part is equal. Additionally, you are allowed to perform one operation
Uber Uber OA-13 2023 Problem Description Venky discovered himself in an extraordinary Uber binary cafeteria, renowned for its popularity and uniqueness. The cafeteria provides k various delightful desserts, each uniquely numbered from 0 to (k-1). The cost of the i-th dessert is (2^i) coins, following the binary pricing system. Venky's budget
Uber Uber OA-14 2023 Problem Description Uber has recently introduced the Share Cab Service, which starts at a point and returns to the same point after picking up all passengers from different pickup points. There are n pick-up points in total, labeled from 0 to (n-1). All pick-up points are connected by roads with
Google Google OA-15 2024 Problem Description You are given a string of lowercase English alphabets. Your task is to find the number of palindromic triplets in the string. A palindromic triplet consists of three non-overlapping substrings S1, S2, and S3 such that each substring is a palindrome and all substrings are non-overlapping. Test Case
Oracle Oracle OA-10 2024 Problem Description You are given a string str, and your task is to determine how many unique substrings it contains that do not have any repeated characters. Two substrings are considered distinct if they start or end at different indices. Function Description: Complete the function countUniqueSubstrings as described below. Parameters:
Uber Uber OA-15 2023 Problem Description Lazy Alex is playing with the 'Tower of Swapol' game, where there are n towers. Some of these towers contain rings, and the sum of all rings across the towers is exactly n. The goal is to make every tower contain exactly one ring. In a