CS-OA cs-vo Faang

Canva又开mid岗位了,冲!- Canva 澳洲 OA – Shopping Cart Billing – Task Scheduling – Message Delivery System



Canva之所以能受到应届生的喜爱,最主要的原因就是——💰给的实在太多了!以Canva墨尔本office的薪资举例,全职Business Analyst薪水能达到$11.52万-$13.65万澳币(约¥53-63万)。





Zoom Call→

Frist Interview→

Final Interview



1. Shopping Cart Billing

An e-commerce company is currently celebrating ten years in business. They are having a sale to honor their privileged members, those who have been using their services for the past five years. They receive the best discounts indicated by any discount tags attached to the product. Determine the minimum cost to purchase all the products listed. As each potential price is calculated, truncate it to its integer part before adding it to the total. Return the cost to purchase all items as an integer.

There are three types of discount tags:

  • Type 0: discounted price, the item is sold for a given price.
  • Type 1: percentage discount, the customer is given a fixed percentage discount from the retail price.
  • Type 2: fixed discount, the customer is given a fixed amount off from the retail price.

Example: products = [['10', 'd0', 'd1'], ['15', 'EMPTY', 'EMPTY'], ['20', 'd1', 'EMPTY']] discounts = [['d0','1','27'], ['d1', '2', '5']]

The products array elements are in the form ['price', 'tag1', 'tag2', ..., 'tag m-1']. There may be zero or more discount codes associated with a product. Discount tags in the products array may be 'EMPTY' which is the same as a null value. The discounts array elements are in the form ['tag', 'type', 'amount'].

  1. If a privileged member buys product 1 listed at a price of 10 with two discounts available:
    • Under discount d0 of type 1, the discounted price is 10 - 10 * 0.27 = 7.30, rounded to 7.
    • Under discount d1 of type 2, the discounted price is 10 - 5 = 5.

2. Task Scheduling

Given an array task_memory of n positive integers representing the amount of memory required to process each task, an array task_type of n positive integers representing the type of each task, and an integer max_memory, find the minimum amount of time required for the server to process all the tasks.

Each task takes 1 unit of time to process. The server can process at most two tasks in parallel only if they are of the same type and together require no more than max_memory units of memory.


Suppose n = 4, task_memory = [7, 2, 3, 9], task_type = [1, 2, 1, 3], and max_memory = 10.

One efficient schedule is shown:

Task PairTask 1Task 2Task TypeMemory RequirementWithin Max Memory
102Same7 + 3 = 10Yes
213Different9 + 2 = 11No

Tasks 0 and 2 are processed concurrently, but the other two must be processed separately due to their memory requirements and because they are not the same type. The minimum amount of time required to process all the tasks is 3 units.

Function Description

Complete the function getMinTime in the editor below.

getMinTime has the following parameter(s):

  • int task_memory[n]: the memory required by the tasks
  • int task_type[n]: the type of the tasks
  • int max_memory: the maximum memory that can be used concurrently

3. Message Delivery System

In this task, a basic message delivery service is to be implemented that has a rate-limiting algorithm that drops any message that has already been delivered in the last k seconds.

Given the integer k, a list of messages as an array of n strings, messages, and a sorted integer array timestamps representing the time at which the message arrived, each message report time string "true" if the message is delivered and "false" otherwise.


Suppose n = 6, timestamps = [1, 4, 5, 10, 11, 14], messages = ['hello', 'bye', 'bye', 'hello', 'bye', 'hello'], and k = 5.

TimestampsMessage RequestLast Same Message at the TimeDelivered

Hence the answer is ["true", "true", "false", "true", "true", "false"].

Function Description

Complete the function getMessageStatus in the editor below.

getMessageStatus has the following parameters:

  • int timestamps[n]: the time at which messages arrive
  • int messages[n]: the messages to be delivered
  • int k: the time window in seconds within which a message cannot be redelivered if it has already been sent once.


We provide OA agency services. Please note that if you search for this article during the OA process, unfortunately, we will not be able to serve you. Thanks to our high-quality service and competitive pricing, our OA outsourcing service requires an appointment to be implemented. Our OA agency is a paid service. If you want to get answers for free, please do not contact us.

联系我,查看题目全文。OA代做,代面试,面试代面,面试辅助。联系我 我们公开透明报价,做华人社区面试suport第一品牌。

Leave a Reply

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