Crack Hulu 2020 Campus Coding Test: 4 Algorithm Challenges Explained
This article provides a concise overview of Hulu's 2020 campus recruitment, including company FAQs, detailed descriptions of four programming problems with input/output specifications, sample cases, and step‑by‑step solution analyses to help candidates prepare for the online coding test.
Hulu 2020 Campus Recruitment Overview
Hulu is a US‑based internet video streaming platform founded in 2006, now owned by Disney. Its Beijing office, established in 2007, is the second‑largest R&D center, focusing on video playback, content recommendation, and advertising, with dedicated AI and machine‑learning teams.
Available positions for the 2020 campus hiring include:
Software Developer / Research Software Developer (software development and algorithm engineering)
Researcher (PhD candidates only)
Eligibility requires graduation in 2020 with no full‑time work experience; majors in computer science, software engineering, or related fields are preferred. Applications can be submitted via the official job portal or employee referral.
Online Programming Test Details
The test is scheduled for September 5, 19:00‑21:00 (2 hours) and will be conducted remotely. It consists of four questions covering data structures, algorithms, and problem‑solving skills.
Problem 1 – Sum of Smaller Numbers
Description: Given a positive integer array a, output an array sums where sums[i] equals the sum of all elements in a that are smaller than a[i]. If none exist, sums[i]=0. Constraints: max(a[i]) ≤ 100000, len(a) ≤ 10000, duplicates allowed.
Input:
n // length of the array
a[1]
a[2]
...
a[n]Output:
sums[1]
sums[2]
...
sums[n]Sample Input:
4
5
4
2
9Sample Output:
6
2
0
11Analysis: A naïve O(n²) solution iterates each element and sums smaller values. An optimized O(n log n) approach sorts the array and uses prefix sums, handling duplicates appropriately.
Problem 2 – Maximum Number of Obtuse‑Angle Triangles
Description: Points lie on a circle centered at the origin. Each point is represented by an integer angle (100×degrees) in the range [0, 36000). Choose any three distinct points to form a triangle. Determine the maximum possible number of obtuse‑angle triangles.
Input:
n // number of points (n ≤ 1000)
a[1]
a[2]
...
a[n]Output: maximum number of obtuse‑angle triangles Sample 1 Input:
4
0
10000
12000
18000Sample 1 Output: 2 Sample 2 Input:
4
9000
0
27000
18000Sample 2 Output: 0 Analysis: A triangle is obtuse iff its three points are not all within any semicircle. After sorting angles, for each point treat it as the start of a 180° window and count points inside; the number of obtuse triangles contributed by that start is C(k, 2) where k is the count of points within the window. Overall O(n log n) time.
Problem 3 – Construction Scheduling
Description: A construction project has m tasks (numbered 1…m) and n workers. Each worker can complete one task per day. Tasks may have dependencies. Each day, workers pick the smallest‑indexed available tasks. Compute the number of days required to finish all tasks, or output E if impossible due to cycles.
Input:
m n k // tasks, workers, number of dependency pairs
i1 j1
i2 j2
...
ik jk // task i depends on task jOutput: minimum days needed // or the character E Sample 1 Input:
6 2 5
2 1
3 1
5 2
5 3
6 5Sample 1 Output: 4 Sample 2 Input:
7 2 6
3 1
2 1
5 4
6 4
7 6
4 7Sample 2 Output: E Analysis: Perform a topological sort using a min‑heap to always select the smallest ready task. Simulate day by day, assigning up to n tasks per day. Detect cycles when not all tasks can be processed.
Problem 4 – Wall‑Building Combinatorics
Description: Build an N×M wall using bricks of sizes 1×1, 1×2, 1×3, and 1×4 placed horizontally. The wall must have no gaps and cannot be split vertically into two separate walls. Compute the number of valid wall configurations.
Input:
T // number of test cases
N1 M1
N2 M2
...
NT MTOutput: result for each test case Sample Input:
4
2 2
3 2
2 3
4 4Sample Output:
3
7
9
3375Analysis: Compute row[i] – the number of ways to fill a single row of length i – using the recurrence row[i]=row[i-1]+row[i-2]+row[i-3]+row[i-4]. The total number of unrestricted walls is any = row[M]^N. To exclude walls that can be vertically split, use DP solid[i]=∑ solid[j]*any[i-j] for 1≤j<i. The final answer is solid[M], applying modulo as needed.
Signed-in readers can open the original source through BestHub's protected redirect.
This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactand we will review it promptly.
Hulu Beijing
Follow Hulu's official WeChat account for the latest company updates and recruitment information.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.
