🧪 General Test Info
- ⏱ Duration: 90 minutes
- 📋 Number of tasks: 3
- 📌 Rules:
- You can solve the 3 tasks in any order.
- No option to pause — the full 90 minutes must be uninterrupted.
- You must handle corner cases and large inputs efficiently.
- Passing the sample tests does not guarantee correctness.
- After the test, you will receive feedback with your score.
- If the browser closes, use the invitation link to resume.
Task 1: Counting Game
Problem Description:
The counting game is a widely popular casual game. Every participant in the game must count numbers in sequence. However:
- If the next number to be called is a multiple of 7,
- Or if the number contains the digit 7,
→ then that number must be skipped, otherwise, you lose the game.
Rose and Zack find it too easy and modify the rules:
For any number containing the digit 7, all its multiples cannot be called either!
Example:
- Rose calls out 6 → 7 is invalid → Zack must call 8.
- Rose calls 33 → 34 = 17×2 and 35 = 7×5 → Zack must call 36.
- Rose calls 69 → all numbers 70–79 contain 7 → Zack must call 80.
Input Format:
A single positive integer x
— the number Rose calls.
Output Format:
An integer:
- If
x
is invalid (should not have been called): output -1. - Otherwise: output the next valid number Zack should call.
Samples:
Sample Input | Sample Output |
---|---|
6 | 8 |
33 | 36 |

Task 2: Successive Squares Sum
Description:
Given a number n
(1 ≤ n ≤ 10^10), find all possible sequences of successive positive integers
(p, p+1, ..., p+m) such that:
n = p^2 + (p+1)^2 + ... + (p+m)^2
Input:
A single integer n
.
Output:
An array of strings in two parts:
- The first element: number
k
, the total number of valid sequences. - The next
k
elements:
Each is a string:"c <p> <p+1> ... <p+m>"
wherec
is the count of numbers in the sequence.
- Sequences should be sorted by
c
in descending order.
Sample Input:
2030
Sample Output:
["2","4 21 22 23 24", "3 25 26 27"]
Task 3: Map Segment Color Operations
Description:
You are given a map with n
segments. Each segment can be:
- Red (initially)
- Black
The map is a tree (no cycles).
You need to perform m
operations. There are 2 types:
Operation 1: Paint path black
Given stations a
and b
:
- For all stations
x
on patha→b
, convert connected segments ofx
to red. - Then color only the path a→b segments to black.
Operation 2: Count black segments
Given stations a
and b
, return the number of black segments on the path a→b
.
Input Format:
Input is an array of strings:
- First string:
"n m"
(number of stations, number of operations) - Next
n - 1
strings:"u v"
→ segment between stationsu
andv
- Next
m
strings:"opi ai bi"
where:opi = 1
: operation 1 (paint path)opi = 2
: operation 2 (count black segments)ai ≠ bi
Example Test Input:
7 7
1 2
1 3
3 4
3 5
3 6
6 7
1 1 7
2 1 4
2 2 7
1 5 2
2 7 1
2 1 2
2 1 7
Expected Output:
7
7

我们长期稳定承接各大科技公司如Visa、TikTok、Google、Amazon等的OA笔试代写服务,确保满分通过。如有需求,请随时联系我们。
We consistently provide professional online assessment services for major tech companies like TikTok, Google, and Amazon, guaranteeing perfect scores. Feel free to contact us if you're interested.
