最近參加了 Cisco 的 SDE Intern OA,整體體驗就是 題目不算特別難,但時間非常緊。 三道題 90 分鐘,稍微卡殼就很容易寫不完。 Cisco 的 OA 更看重你能否快速抓住本質,而不是陷在 brute force 裡浪費時間。 這裡整理一下題目和思路,希望能幫到準備的同學。

Cisco SDE Intern OA 面試概覽
- 題量:3 道程式設計題
- 時長:90 分鐘
- 考点分布:
- 矩陣操作(考察空間/時間優化)
- 字串處理(palindrome 高頻考點 + 字典序規則)
- 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 intorotated[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 smallestone.
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] = trueif substrings[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 youcan 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,想要穩穩拿下高分,靠自己硬撐遠遠不夠,提前演練 + 實戰助攻 才是王道。