Visa OA 真题 – Codesignal – OA 代写 – Visa NG 岗位 – 一亩三分地

Visa的笔试题近期大量发放,全部是随机出题,Codesignal题库大概有2800题,随机选4题,所以靠真题做到满分比较难。借助我们CSoahelp轻松拿满分

Question 1

Imagine you are developing a tool for authors that helps them analyze their writing patterns to enhance consistency. One feature of this tool involves examining the structure of words within text. You are given a string text that represents a sequence of words consisting of English letters (both uppercase and lowercase) separated by spaces.

Your task is to find all words in the string that start and end with the same letter, considering that the letter may appear in different cases (e.g., a word may start with an a and end with an A). Return the number of such words as an integer.

Note: You are not expected to provide the most optimal solution, but a solution with time complexity not worse than O(text.length) will fit within the execution time limit.

Example:

text = "Level dEmaND noNe"
Output: solution(text) = 2

Question 2

In cooking terms, recipe is a prep-list combination of ingredients if you can prepare it by mixing together the first several ingredients from your list, one after another, starting from the very beginning. More formally, string recipe is a prep-list combination of array of strings ingredients if there is some index i ≥ 0 such that
recipe = ingredients[0] + ingredients[1] + ... + ingredients[i]

Task: Given two arrays of ingredients ingredients and recipes, for each recipe in recipes, find out whether it is a prep-list combination of ingredients. As a result, return an array of length recipes.length, where the i-th element is true if recipes[i] is a prep-list combination of ingredients, and false otherwise.

Note: You are not expected to provide the most optimal solution, but a solution with time complexity not worse than O(ingredients.length^2 * recipes.length) will fit within the execution time limit.

Example:

ingredients = ["flour", "sugar", "eggs"]
recipes = ["floursugar", "random", "flour", "sugarflour", "sugareggs"]
Output: solution(ingredients, recipes) = [true, false, true, false, false]

Question 3

For a rectangular matrix of integers, a cross is a figure formed by joining one row and one column. A cross is considered to be regular if all the elements in it are equal.

A cross is called nearly regular if all of its elements are equal except for, at times, the element in the intersection of the row and the column which form the cross.

You are given a rectangular matrix of integers matrix. Your task is to return the number of nearly regular crosses within matrix. Note that by definition the regular cross is also considered to be a nearly regular cross.

Note: You are not expected to provide the most optimal solution, but a solution with time complexity not worse than O(matrix.length^2 * matrix[0].length + matrix[0].length^2 * matrix.length) will fit within the execution time limit.

Example:

matrix = [
  [1, 2],
  [2, 1]
]
Output: solution(matrix) = 4

matrix = [[2, 3]]
Output: solution(matrix) = 2

Question 4

You've decided to create a bot for handling stock trades. For now, you have a simple prototype which handles trades for just one stock. Each day, it's programmed to either buy or sell one share of the stock.

You are given prices, an array of positive integers where prices[i] represents the stock price on the i-th day. You're also given algo, an array of 0s and 1s representing the bot's schedule, where 0 means buy and 1 means sell.

In order to improve the bot’s performance, you’d like to choose a range of k consecutive days where the bot will be programmed to sell; in other words, set a range of k consecutive elements from algo to 1. Your task is to choose the interval such that it maximizes the bot’s total revenue. The revenue is defined as the sum of all selling prices minus the sum of all buying prices (in other words, the difference between the end and start amount).

Note: Assume you begin with enough shares of the stock that it’s always possible to sell.

Example:

prices = [2, 4, 1, 5, 2, 6, 7]
algo = [0, 1, 0, 1, 0, 0, 0]
k = 4

Question 5

You are developing a feature for a new social media platform where you need to analyze user-generated content for reporting purposes.

Given an array of strings messages, each representing a user message, your task is to count how many messages have an odd length and contain at least one vowel (letters 'a', 'e', 'i', 'o', 'u', both uppercase and lowercase).

Note: You are not expected to provide the most optimal solution, but a solution with time complexity not worse than
O(messages.length * max(message.length)) will fit within the execution time limit.

Example:

messages = ["I", "love", "CSS", "She respects HTML"]
Output: solution(messages) = 2

Question 6

Imagine you're a curator organizing a digital art exhibition featuring sculptures of various heights, each represented by a unique number in the array heights. We define a sculpture height as a highlight if it is taller than its neighboring sculptures.

Formally, heights[i] is a highlight if it meets these criteria:

  • heights[i] > heights[i - 1] or heights[i - 1] doesn’t exist
  • heights[i] > heights[i + 1] or heights[i + 1] doesn’t exist

The task is to compile an array (let’s call it highlightOrder) based on these steps:

  1. Identify the smallest highlight in heights
  2. Remove this highlight from heights and add it to the end of highlightOrder
  3. Keep repeating the above steps until heights has no highlights left

Note: Since each sculpture height is unique, there will be no tie when selecting the smallest highlight.

Also note: You are not expected to provide the most optimal solution, but a solution with time complexity not worse than O(heights.length^2) will fit within the execution time limit.

Example:

heights = [2, 7, 8, 5, 1, 6, 3, 9, 4]
Output: solution(heights) = [6, 8, 7, 5, 2, 9, 4, 3, 1]

Question 7

You are a senior chemist working in a cutting-edge molecular research laboratory. Your team has developed a revolutionary molecular reactor that can synthesize complex compounds through a series of controlled chemical reactions. The reactor operates on a strict schedule where each synthesis reaction requires exactly 5 minutes to complete.

The laboratory receives research samples at various times throughout the day, and each sample must undergo a synthesis reaction in the molecular reactor. However, there's a critical limitation: the reactor can only process one sample at a time, and samples waiting to be processed are stored in a specialized cooling chamber. If the cooling chamber contains more than 10 samples, any newly arriving samples will be rejected due to stability concerns.

Your task is to determine the total time required to process all accepted samples through the molecular reactor. The output should be the time in seconds since the start of the laboratory’s operating day.

Notes:

  • The cooling chamber capacity is calculated by the number of samples waiting to start synthesis, not including the sample currently being processed in the reactor.
  • If a new sample arrives at the same moment as when another sample completes its synthesis, the first sample waiting in the cooling chamber proceeds to the reactor.

Example 1:

times = [1, 6, 9, 502]
Output: solution(times) = 1201

Example 2:

times = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15]
Output: solution(times) = 3601

Question 8

You are tasked with analyzing the potential space in a cityscape outlined by a series of skyscrapers. Each skyscraper’s height is represented by an element in the array cityLine, where the width of each skyscraper is consistently 1, and they are placed directly adjacent to each other along a road with no gaps.

Your mission is to determine the largest square area that can fit within this row of skyscrapers.

Example 1:

cityLine = [1, 2, 3, 2, 1]
Output: solution(cityLine) = 4

Example 2:

cityLine = [4, 3, 4]
Output: solution(cityLine) = 9

我们长期稳定承接各大科技公司如Visa、TikTok、Google、Amazon等的OA笔试代写服务,确保满分通过。如有需求,请随时联系我们。

We consistently provide professional online assessment services for major tech companies like TikTok, Google, and Amazon, guaranteeing perfect scores. Feel free to contact us if you're interested.

Leave a Reply

Your email address will not be published. Required fields are marked *