CS-OA cs-vo Faang

Tiktok 本周OA真题公布了

  1. SQL: Advertising System AB Tests Report
    Create a query for an advertising system that returns a list of AB tests and the total number of visits for todayallocated to them.
    The result should have the following columns: name / allocation_path prefix allocation_percentage / total visits
    name - test name
    allocation path prefix test allocation path prefix
    allocation percentage - test allocation percentage:
    o Record format is ##%, where the placeholders are ## in the order they appear:1.Test allocation in percentages
    The result should be sorted in ascending order by name.
  1. Message Encryption
    The developers of ByteDance are developing a new encryption algorithm for their Larkplatform. A message to be sent has to be encrypted using this algorithm. Thealgorithm generates a sub_encrypted string of the message. A message consists ofn strings each of length k, where the jth word in the message is represented by thearray element messagelil.
    The errorbetween two strings str1 and str2 is defined as the sum of the absolutedistance between the characters str1lil and str2li7in the English alphabet for eachvalid i.
    For example, for str1 = "abd", str2 ="daf", we have the following
    For i=1 distance between str1[1]=a' and str2[1]= d is 3.For i=2, distance between str1[2] = b' and str2[2]= 'a' is 1.For i=3, distance between str1[3]=d and str2[3]= 'f' is 2
    Hence, the error between the strings str1 and str2 is (3 + 1 + 2) = 6
    The sub encrypted string for the array message is a lexicographically minimumpalindrome oflength k with the sum of the error between the sub encrypted stringand all the strings of the array message is minimum.
  1. Video Distortion
    The engineers at ByteDance are working on improving the user experience of using the video conferencingfeature on their Lark Platform. They are integrating a new algorithm that will stabilize the video. The video is sentover the network in the form of packets consisting of some frame values.There is a packet that needs to be sent over the network, consisting of n frame values, where the ith frame valueis represented by the array element packetslil!
    The distortion in the video is defined to be the maximum absolute difference between the adiacent elements ofthe array packets.
    Before sending the packet over the network, the algorithm will try to decrease the distortion in the video byapplying the following operation exactly once:
    The algorithm will choose an integer x, such that 0 sx S max frame, and replace packets!i]with xfor all suchindices i, where packetsli]= 0 previously.
    Note: lt is possible that there exists no such index i such that packetsli = 0. In that case, the array packets willremain unchanged after applying the operation.
    Given n frame values in a packet, an integer max frame, and an array packets, find the minimumpossible distortion that the algorithm can achieve by applying the operation optimally.

tt OA代做,VO协助联系我。

Leave a Reply

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