Cisco SDE Intern OA 面经|90 分钟 3 题独家真题解析,高分必看

857閱讀
沒有評論

最近参加了 Cisco 的 SDE Intern OA,整体体验就是 题目不算特别难,但时间非常紧。三道题 90 分钟,稍微卡壳就很容易写不完。Cisco 的 OA 更看重你能否快速抓住本质,而不是陷在 brute force 里浪费时间。这里整理一下题目和思路,希望能帮到准备的同学。

Cisco SDE Intern OA 面试概览

  • 题量:3 道编程题
  • 时长:90 分钟
  • 考点分布
    1. 矩阵操作(考察空间/时间优化)
    2. 字符串处理(palindrome 高频考点 + 字典序规则)
    3. HashMap 应用(频率统计与抽象建模)

整体难度:中等偏上。关键是识别规律,写出高效解法。

Cisco SDE Intern OA 真题分享 + 思路

1. Matrix Rotation Print
Question:
Given an N × M matrix, rotate it 90 degrees clockwise and print it row by row.

Naive approach:

  • Create a new M × N matrix.
  • For each element matrix[i][j], place it into rotated[j][N - 1 - i].
  • Finally, print row by row.
  • Complexity: O(NM) time, O(NM) space.

Optimized approach:

  • Notice you don’t actually need to build a rotated matrix.
  • For a clockwise 90° rotation, the first row of the result corresponds to the last column of the original matrix.
  • Instead of allocating extra space, iterate over the original matrix column by column (left → right), printing each column in reverse (bottom → top).
  • Complexity: O(NM) time, O(1) space.

2. Longest Palindromic Substring
Question:
Given a string, return the longest palindromic substring. If multiple substrings have the same maximum length, return the lexicographically smallest one.

Approach 1 (Expand Around Center):

  • For each index, expand outward for both odd-length and even-length palindromes.
  • Keep track of the longest palindrome found.
  • If two palindromes have the same length, compare and keep the lexicographically smaller one.
  • Complexity: O(N²) time, O(1) space.

Approach 2 (Dynamic Programming):

  • Use a DP table dp[i][j] = true if substring s[i...j] is a palindrome.
  • Fill table bottom-up and track the longest palindrome.
  • Lexicographical comparison needed when length ties occur.
  • Complexity: O(N²) time and space.

3. Maximum Coordinates in One Flight
Question:
Given a list of coordinate pairs (x, y). You can “fly” either horizontally (same y) or vertically (same x), but only once. Find the maximum number of coordinates you can pass through.

Approach:

  • The problem reduces to:
    • Count how many points share the same x-coordinate.
    • Count how many points share the same y-coordinate.
  • Use two HashMaps:
    • x_count[x]++ for every point.
    • y_count[y]++ for every point.
  • The answer is max(max(x_count.values()), max(y_count.values())).
  • Complexity: O(N) time, O(N) space.

稳拿Offer的秘诀

Cisco 的 OA 节奏特别快,题目还多,如果一直用 brute force 慢慢写,时间根本不够。Programhelp 可以通过 OA无痕联机助攻,提前带你演练 Cisco 高频题型(矩阵优化、回文、HashMap 统计),真正上场时还能语音提醒你及时换思路,不会陷在低效解法里。像 Cisco、Amazon、Akuna 这类高压 OA,想要稳稳拿下高分,靠自己硬撑远远不够,提前演练 + 实战助攻 才是王道。

author avatar
jor jor
正文完
 0
评论(沒有評論)