Yahoo OA 全解析|Yahoo OA 面试流程 + 高频题目类型详解【附准备建议】

Yahoo OA 全解析|Yahoo OA 面试流程 + 高频题目类型详解【附准备建议】

近年来,Yahoo 虽不再是炙手可热的互联网巨头,但它在搜索、金融、媒体等领域仍然拥有稳定的用户基础,也持续在全球招收优秀的工程与数据人才。尤其是 Yahoo SDE 新人岗、Intern 岗,每年都吸引不少申请者,在线笔试是入门的第一关。我们整理了 2025 届 Yahoo OA 的两道代表性题目,涵盖典型的字符串算法与贪心策略,在实测中算是“中等偏上”的难度,适合准备 FAANG 同级别笔试的同学练手。以下是完整题目、拆解思路及经验分享。

Question 1: Count Binary Substrings

Problem Description

You are given a binary string s containing only characters '0' and '1'. Your task is to count the number of non-empty substrings that have the following properties:

  1. The number of 0s and 1s in the substring are equal.
  2. All the 0s and all the 1s in the substring are grouped consecutively. That is, it must look like '000111' or '11', but not '0101'.

Note that substrings can overlap, and duplicates should be counted.

Example:

Input: s = "011001"
Output: 4
Explanation: Valid substrings are "01", "10", "1100", and "01" (at the end).

Question 2: Remove Duplicates for Lexicographically Largest Result

Problem Description

You’re given a string input_str consisting of lowercase letters. You may remove any duplicate character to make the string consist of unique characters only.

Your goal is to return the lexicographically largest possible result string after such removals.

You may perform the removals in any order, and must ensure that each character appears at most once in the final output.

Example:

Input: input_str = "aabcb"
Output: "acb"
Explanation:
We remove the first 'a' and the first 'b'. Among all strings with unique characters, "acb" is lexicographically the largest.

实战体验分享|Yahoo OA 做题节奏

这次我们辅导的学员在参加 Yahoo OA 时,反馈整体界面偏 HackerRank 风格,测试时间约 90 分钟,两道题都需要自己写函数体,编程语言支持 Java / Python / C++ 等主流语言。虽然题目本身不是很难,但需要极强的细节处理能力,否则容易在边界 case 上丢分。

题目虽然没有强调时空复杂度要求,但在最后 10% 提交者中拼的是优化细节,建议练习中直接写 O(n) 的方法,确保可以 AC 所有 test case。

Programhelp 独家协助|远程联机 + 语音提示 + 快速定位

如果你也在准备 Yahoo、Citadel、Amazon 等顶尖公司的 OA,欢迎使用我们的【Programhelp 远程无痕联机协助服务】。我们通过专属 Chrome 插件 + 屏幕控制 + AI 语音实时提醒,帮助你:

  • 快速理解题意、避开坑点;
  • 定位 bug 与逻辑盲区;
  • 提前准备高频题模板,现场直接套用。

无论你是算法不熟、英语读题慢,还是心态容易慌,我们都能根据你的节奏匹配不同等级的远程助攻,真正做到“无痕辅助 + 高分交卷”。

已经有超过 500 位同学通过我们的系统,顺利拿下字节、Meta、Salesforce 等一线 tech offer。

author avatar
azn7u2@gmail.com
正文完
 0
评论(没有评论)