Weride oa3 | Weride Interviews | VO Substitute Interviews | Interview Aids | VO Aids | OA Aids | Interview Cheats

Weride oa3

Wenyuan WeRide, committed to "changing human travel with driverless", is the only technology company in the world that owns autonomous driving licenses in China, the United Arab Emirates, Singapore, and the United States at the same time, and has carried out autonomous driving research and development, testing, and operation in 30 cities in 7 countries around the world. As a Chinese automated driving company, it's still worthwhile for people to pitch. Below is sharing the OA 3 questions from Weride that I did recently.

Weride OA 1

In many real-world applications, the problem of finding a pair of closest points arises. In the real world, data is usually distributed randomly. Given n points on a plane, randomly generated with uniform distribution, find the squared shortest distance between pairs of these points.

Example
There are 3 points with x coordinates x=[0,1,2] and y=[0,1,4]. The points have the xy coordinates (0,0),(1,1),(2,4). The closest points are (0,0) and (1,1), and their squared shortest distance is.

Function Description
Complete the function closestSquaredDistance in the editor below.

closestSquaredDistance has the following parameter(s).

  • int x[n]: each x[i] denotes the x coordinate of the ith point.
  • int y[n]: each y[i] denotes the y coordinate of the ith point.

Returns: long: a long integer that denotes the squared shortest distance between the pairs of points.


Weride OA 2

Given an array of strings, each of the same length, and a target string, construct the target string using characters from the strings in the given array such that the indices of the characters in the order in which they are used form a strictly increasing sequence. such that the indices of the characters in the order in which they are used form a strictly increasing sequence. Here the index of a character is the position at which it appears in the string. Here the index of a character is the position at which it appears in the string. Note that it is acceptable to use multiple characters from the same string.

Determine the number of ways to construct the target string. One construction is different from another if either the sequences of indices they use are different or the sequences are the same but there exists a character at some index such that it is chosen from a different string in these constructions. different or the sequences are the same but there exists a character at some index such that it is chosen from a different string in these constructions. Since the answer can be very large, return the value modulo 10000007.

Example
Consider an example with n=3 strings, each of length 3. Let the array of strings be words=[adc,aec,efg], and the target string target=ac. There are 4 ways Let the array of strings be words=[adc,aec,efg], and the target string target=ac.

  1. Select the 1st character of adc and the 3rd character of aec.
  2. Select the 1st character of adc and the 3rd character of adc.
  3. Select the 1st character of aec and the 3rd character of adc.
  4. Select the 1st character of aec and the 3rd character of aec.

Function Description
Complete the function numWays It must return an integer, modulo 10000007.

numWays has the following parameters.

  • string words[n]: an array of strings.
  • string target: the target string.

Constraints:

  • 1≤n≤10^5.
  • 1≤length of words[i]≤3000.
  • All words[i] are of equal length per test case.
  • The sum of the lengths of all words[i] ≤ 10^5.
  • 1≤length of target≤length of words[i].
  • All characters are lowercase English letters.

Weride OA 3

There are employee_nodes employees in a company, out of which there are k There are special employees who have data networks and share their mobile hotspots with other employees. employee_edges connections already made between the employees, where the ith connection connects the employees employee_from[i] and employee_to[i], such that either of the employees can share a mobile hotspot.

Two employees x and y are connected if there is a path between them. All the employees connected to a special employee x will use the mobile hotspot of the All the employees connected to a special employee x will use the mobile hotspot of the special employee x.

Up to now, to restrict data usage, any employee was connected to at most one special employee. As data consumption has increased, any employee can be connected to at most one special employee. connected to at most max_connections number of special employees.

Find the maximum number of edges that can be added to the graph such that any employee is connected to at most max_connections special employees.

Example
It is given that employee_nodes = 4, employee_edges = 1, k = 2, max_connections = 1,
special_employees = [1, 3], employee_from = [1], and employee_to = [2].


    1 4
     \ /
      2 - 3
    

Employees 1 and 3 are special, and max_connections = 1, so they cannot be connected. Hence, employee 4 can be connected to 1 and 2, making two total edges.

Hence, the answer is 2.

Function Description
Complete the function getMaximumEdges in the editor below.

getMaximumEdges has the following parameters.

  • int employee_nodes: the number of employees.
  • int employee_from[employee_edges]: the one end of the connection.
  • int employee_to[employee_edges]: the other end of the connection.
  • int special_employees[k]: the special employees.
  • int max_connections: the maximum number of special employees to which an employee can be connected.

Returns
long: the maximum number of edges that can be added to the graph such that any employee is connected to at most max_connections number of special employees.

Constraints

  • The input graph does not contain self-loops or multiple parallel edges.
  • The updated graph should not contain self-loops or multiple parallel edges.
  • It is guaranteed that in the given graph, no two special employees are connected to each other.

Reference

WeRide-Interview-Questions

Weride | Acreage

The above is the content of 2025 Weride OA3. If you need more weride OA or VO question, please contact us, We provide services for writing online assessments (OA), proxy interviews, and interview assistance. If you need more weride OA or VO questions, please contact us, we provide services for writing online assessments (OA), proxy interviews, and interview assistance. For the OA writing service, we will ensure that you achieve a perfect score. Contact us Now to make an appointment.

author avatar
ProgramHelp
END
 0
Comment(没有评论)