Visa OA questions Codility – 一亩三分地 – OA代写 – 面试代面 – 面试辅助 – OA help

🧪 General Test Info

  • ⏱ Duration: 90 minutes
  • 📋 Number of tasks: 3
  • 📌 Rules:
    1. You can solve the 3 tasks in any order.
    2. No option to pause — the full 90 minutes must be uninterrupted.
    3. You must handle corner cases and large inputs efficiently.
    4. Passing the sample tests does not guarantee correctness.
    5. After the test, you will receive feedback with your score.
    6. 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 InputSample Output
68
3336

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:

  1. The first element: number k, the total number of valid sequences.
  2. The next k elements:
    Each is a string: "c <p> <p+1> ... <p+m>"
    where c 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:

  1. For all stations x on path a→b, convert connected segments of x to red.
  2. 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:

  1. First string: "n m" (number of stations, number of operations)
  2. Next n - 1 strings: "u v" → segment between stations u and v
  3. 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.

Leave a Reply

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