CS-OA cs-vo Faang

Tiktok OA hackrank-TikTok 2024/4/8-12 OA – tiktok 笔试真题

本周的tiktok又开放啦,tiktok的秋招到现在一直保持的高强度的OA 发放。This week's TikTok has opened up again, and TikTok's autumn recruitment has maintained a high intensity of OA distribution.

给不熟悉tiktok OA的朋友们科普一下,tiktok的OA每两周开放一次,当第一次OA未通过时可以再次申请两周后的OA,一般是周一开始做,周五截止。潜规则是周五做OA的人一般不会通过,而越早完成通过率越高。For those who are not familiar with TikTok's OA, it opens every two weeks. When the first OA is not passed, you can reapply for the OA after two weeks, which is generally started on Monday and ends on Friday. The unwritten rule is that people who do the OA on Friday generally do not pass, and the earlier you complete it, the higher the pass rate.

已经有众多的小伙伴们收到了OA的邮件前来预定本周的OA,如果您也在为这周的tiktok的OA苦恼,请尽快联系我们。我们已经辅助众多同学tiktok上岸。

首先还是2道选择题,内容非常简单

  1. Event Handling

A major city's transportation department has developed a system in Python to handle events like traffic jams, road maintenance, and city parades. Each type of event is modeled using a
separate class, inheriting from a common base class Event.

class Event:
def trigger(self):
pass

class TrafficJam(Event):
def trigger(self):
return "Divert traffic to alternative routes."

class RoadMaintenance(Event):
def trigger(self):
return "Issue maintenance warning to all drivers."

class CityParade(Event):
def trigger(self):
return "Schedule road closures and inform public."

The department uses an EventHandler class to trigger these events. It contains a method called handle_event which takes an Event object and calls its trigger method.

class EventHandler:
def handle_event(self, event: Event):
return event.trigger()

  1. Multi-Service Integration

A company is automating the deployment of a multi-component application, including a static front-end, a dynamic back-end server, and a database. The deployment
process involves building and testing the application, deploying the front end to a static hosting service, launching a new server instance for the back end, updating a load
balancer, and verifying the application's functionality.

Given the following pseudocode steps:

1) sync_to_static_service('./frontend', 'static-hosting-url') - Sync front-end files to static hosting service.

2) launch_new_instance(image_id, instance_type, key_pair, security_group, subnet) - Launch a new server instance.

3) remote_command_execution('instance_ssh_key', 'instance-ip', 'update_commands') - Deploy latest back-end code to the new server instance.
4) register_with_load_balancer('load-balancer-name', new_instance_id) - Register the new server instance with the load balancer.

5) run_tests('testing_suite', 'instance-ip') - Run automated tests on the new instance.

6) update_dns_records('domain-name', 'new-ip') - Update DNS records to point to the new instance.

Assuming the new server instance ID is obtained after step 2, and that tests are essential before directing traffic to the new instance, what is the correct order of command
execution for the deployment?

Pick ONE option

1 -> 2 -> 3 -> 5 -> 4 -> 6

2 -> 3 -> 1 -> 5 -> 4 -> 6

1 -> 2 -> 3 -> 4 -> 5 -> 6

2 -> 3 -> 4 -> 5 -> 1 -> 6

后面是难度较高的3道算法题

  1. Social Connections

A popular social media platform provides a feature to
connect people online. Connections are represented as an
undirected graph where a user can see the profiles of those
they are connected to.

There are connection_nodes users numbered 1 to
connection_nodes, and connection_edges connections
where the ith pair connects nodes connection_from[i] and
connection_to[i]. The queries array contains node numbers.
Find the number of users whose profiles are visible to
query[i]. Report an array of integers where the ith value is
the answer to the ith query.

Example

connection_nodes = 7
connection_edges = 4
connection_from = [1, 2, 3, 5]
connection_to = [2, 3, 4, 6]
queries = [1, 3, 5, 7].

  1. Investing in Products

A ByteDance employee aims to maximize their profit by
investing in various ByteDance products and selling them at
different prices. To achieve this, they start with a certain
initial budget and plan to invest in some ByteDance
products, one after the other. They will begin with the first
product, enhance its features, and then sell it to earn a
profit, repeating this process. Each product can be invested
in and sold at most once.

  1. Ball Arrangement for Maximum
    Engagement

In a content creator challenge, a user with a bag of balls,

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

Leave a Reply

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