Problem database last updated: June 20, 2025

CCisco logo

Cisco Coding Interview Questions

84 problems · 24 Easy, 47 Medium, 13 Hard · Ranked #26 of 458

Difficulty breakdown

24 Easy

29% · avg 23%

47 Medium

56% · avg 59%

13 Hard

15% · avg 18%

Top topics

array
58.3%
string
29.8%
dynamic-programming
23.8%
two-pointers
17.9%
hash-table
17.9%
math
16.7%

Interview profile

Based on 84 reported problems, Cisco interviews are in line with industry averages - 15% Hard vs 18% overall. The majority (56%) of questions are Medium difficulty, which is typical for companies that want to see solid fundamentals without excessive trick questions.

Compared to the industry average, Cisco puts unusual emphasis on game-theory (2.4% of problems, 8.2x the industry average), geometry (2.4% of problems, 4.4x the industry average), ordered-set (2.4% of problems, 2.4x the industry average). If you're short on time, these are the categories to double down on.

The most common topics are array (58.3%), string (29.8%), dynamic-programming (23.8%), two-pointers (17.9%). Problems below are sorted by frequency, the ones at the top are asked most often.

All 84 problems

Longest Palindromic Substring

Solve

Given a string s, return the longest palindromic substring in s.

MediumVery Likely
two-pointersstringdynamic-programming

House Robber

Solve

You are a professional robber planning to rob houses along a street. Each house has a certain amount of money stashed, the only constraint stopping you from rob...

MediumVery Likely
arraydynamic-programming

Predict the Winner

Solve

You are given an integer array nums. Two players are playing a game with this array: player 1 and player 2.

MediumVery Likely
arraymathdynamic-programming

Lucky Numbers in a Matrix

Solve

Given an m x n matrix of distinct numbers, return all lucky numbers in the matrix in any order.

EasyVery Likely
arraymatrix

Rotate Image

Solve

You are given an n x n 2D matrix representing an image, rotate the image by 90 degrees (clockwise).

MediumVery Likely
arraymathmatrix

Spiral Matrix

Solve

Given an m x n matrix, return all elements of the matrix in spiral order.

MediumVery Likely
arraymatrixsimulation

Fizz Buzz

Solve

Given an integer n, return a string array answer (1-indexed) where:

EasyLikely
mathstringsimulation

Snakes and Ladders

Solve

You are given an n x n integer matrix board where the cells are labeled from 1 to n2 in a Boustrophedon style starting from the bottom left of the board (i.e. b...

MediumLikely
arraybreadth-first-searchmatrix

LRU Cache

Solve

Design a data structure that follows the constraints of a Least Recently Used (LRU) cache.

MediumLikely
hash-tablelinked-listdesign

Number of Valid Words in a Sentence

Solve

A sentence consists of lowercase letters ('a' to 'z'), digits ('0' to '9'), hyphens ('-'), punctuation marks ('!', '.', and ','), and spaces (' ') only. Each se...

EasyLikely
string

Merge Intervals

Solve

Given an array of intervals where intervals[i] = [starti, endi], merge all overlapping intervals, and return an array of the non-overlapping intervals that cove...

MediumLikely
arraysorting

Maximum Difference Between Increasing Elements

Solve

Given a 0-indexed integer array nums of size n, find the maximum difference between nums[i] and nums[j] (i.e., nums[j] - nums[i]), such that 0 <= i < j < n and...

EasyLikely
array

Find the Largest Area of Square Inside Two Rectangles

Solve

There exist n rectangles in a 2D plane with edges parallel to the x and y axis. You are given two 2D integer arrays bottomLeft and topRight where bottomLeft[i]...

MediumLikely
arraymathgeometry

Minimum Cost to Make Array Equal

Solve

You are given two 0-indexed arrays nums and cost consisting each of n positive integers.

HardLikely
arraybinary-searchgreedy

Maximum Subarray

Solve

Given an integer array nums, find the subarray with the largest sum, and return its sum.

MediumLikely
arraydivide-and-conquerdynamic-programming

Check if Binary String Has at Most One Segment of Ones

Solve

Given a binary string s ​​​​​without leading zeros, return true​​​ if s contains at most one contiguous segment of ones. Otherwise, return false.

EasyLikely
string

Word Search II

Solve

Given an m x n board of characters and a list of strings words, return all words on the board.

HardLikely
arraystringbacktracking

Sum of k-Mirror Numbers

Solve

A k-mirror number is a positive integer without leading zeros that reads the same both forward and backward in base-10 as well as in base-k.

HardLikely
mathenumeration

Implement Router

Solve

Design a data structure that can efficiently manage data packets in a network router. Each data packet consists of the following attributes:

MediumLikely
arrayhash-tablebinary-search

Happy Number

Solve

Write an algorithm to determine if a number n is happy.

EasyLikely
hash-tablemathtwo-pointers

Max Points on a Line

Solve

Given an array of points where points[i] = [xi, yi] represents a point on the X-Y plane, return the maximum number of points that lie on the same straight line.

HardLikely
arrayhash-tablemath

Two Sum

Solve

Given an array of integers nums and an integer target, return the indices of the two numbers that add up to target.

EasyLikely
arrayhash-map

Stone Game

Solve

Alice and Bob play a game with piles of stones. There are an even number of piles arranged in a row, and each pile has a positive integer number of stones piles...

MediumLikely
arraymathdynamic-programming

Trapping Rain Water

Solve

Given n non-negative integers representing an elevation map where the width of each bar is 1, compute how much water it can trap after raining.

HardLikely
arraytwo-pointersdynamic-programming

Valid Parentheses

Solve

Given a string s containing just the characters '(', ')', '{', '}', '[' and ']', determine if the input string is valid.

EasyLikely
stringstack

Cherry Pickup

Solve

You are given an n x n grid representing a field of cherries, each cell is one of three possible integers.

HardLikely
arraydynamic-programmingmatrix

Longest Substring Without Repeating Characters

Solve

Given a string s, find the length of the longest substring without duplicate characters.

MediumLikely
hash-tablestringsliding-window

Merge Sorted Array

Solve

You are given two integer arrays nums1 and nums2, sorted in non-decreasing order, and two integers m and n, representing the number of elements in nums1 and num...

EasySometimes
arraytwo-pointerssorting

Decode String

Solve

Given an encoded string, return its decoded string.

MediumSometimes
stringstackrecursion

Remove Boxes

Solve

You are given several boxes with different colors represented by different positive numbers.

HardSometimes
arraydynamic-programmingmemoization

Linked List Cycle

Solve

Given head, the head of a linked list, determine if the linked list has a cycle in it.

EasySometimes
hash-tablelinked-listtwo-pointers

Best Time to Buy and Sell Stock

Solve

You are given an array prices where prices[i] is the price of a given stock on the ith day.

EasySometimes
arraydynamic-programming

3Sum

Solve

Given an integer array nums, return all the triplets [nums[i], nums[j], nums[k]] such that i != j, i != k, and j != k, and nums[i] + nums[j] + nums[k] == 0.

MediumSometimes
arraytwo-pointerssorting

Number of Islands

Solve

Given an m x n 2D binary grid grid which represents a map of '1's (land) and '0's (water), return the number of islands.

MediumSometimes
arraydepth-first-searchbreadth-first-search

Search a 2D Matrix

Solve

You are given an m x n integer matrix matrix with the following two properties:

MediumSometimes
arraybinary-searchmatrix

Letter Combinations of a Phone Number

Solve

Given a string containing digits from 2-9 inclusive, return all possible letter combinations that the number could represent. Return the answer in any order.

MediumSometimes
hash-tablestringbacktracking

Strange Printer

Solve

There is a strange printer with the following two special properties:

HardSometimes
stringdynamic-programming

Move Zeroes

Solve

Given an integer array nums, move all 0's to the end of it while maintaining the relative order of the non-zero elements.

EasySometimes
arraytwo-pointers

Reverse Linked List

Solve

Given the head of a singly linked list, reverse the list, and return the reversed list.

EasySometimes
linked-listrecursion

Longest Consecutive Sequence

Solve

Given an unsorted array of integers nums, return the length of the longest consecutive elements sequence.

MediumSometimes
arrayhash-tableunion-find

Validate IP Address

Solve

Given a string queryIP, return "IPv4" if IP is a valid IPv4 address, "IPv6" if IP is a valid IPv6 address or "Neither" if IP is not a correct IP of any type.

MediumSometimes
string

Add Two Numbers

Solve

You are given two non-empty linked lists representing two non-negative integers. The digits are stored in reverse order, and each of their nodes contains a sing...

MediumSometimes
linked-listmathrecursion

Remove Duplicates from Sorted Array

Solve

Given an integer array nums sorted in non-decreasing order, remove the duplicates in-place such that each unique element appears only once. The relative order o...

EasySometimes
arraytwo-pointers

Valid Palindrome

Solve

A phrase is a palindrome if, after converting all uppercase letters into lowercase letters and removing all non-alphanumeric characters, it reads the same forwa...

EasySometimes
two-pointersstring

Group Anagrams

Solve

Given an array of strings strs, group the anagrams together. You can return the answer in any order.

MediumSometimes
arrayhash-tablestring

Merge k Sorted Lists

Solve

You are given an array of k linked-lists lists, each linked-list is sorted in ascending order.

HardSometimes
linked-listdivide-and-conquerheap-priority-queue

Word Search

Solve

Given an m x n grid of characters board and a string word, return true if word exists in the grid.

MediumSometimes
arraystringbacktracking

Insert Delete GetRandom O(1)

Solve

Implement the RandomizedSet class:

MediumSometimes
arrayhash-tablemath

Permutation in String

Solve

Given two strings s1 and s2, return true if s2 contains a permutation of s1, or false otherwise.

MediumSometimes
hash-tabletwo-pointersstring

Single Number

Solve

Given a non-empty array of integers nums, every element appears twice except for one. Find that single one.

EasySometimes
arraybit-manipulation

Top K Frequent Elements

Solve

Given an integer array nums and an integer k, return the k most frequent elements. You may return the answer in any order.

MediumSometimes
arrayhash-tabledivide-and-conquer

Gas Station

Solve

There are n gas stations along a circular route, where the amount of gas at the ith station is gas[i].

MediumSometimes
arraygreedy

Find Servers That Handled Most Number of Requests

Solve

You have k servers numbered from 0 to k-1 that are being used to handle multiple requests simultaneously. Each server has infinite computational capacity but ca...

HardSometimes
arrayheap-priority-queuesimulation

Expressive Words

Solve

Sometimes people repeat letters to represent extra feeling. For example:

MediumSometimes
arraytwo-pointersstring

Sliding Window Maximum

Solve

You are given an array of integers nums, there is a sliding window of size k which is moving from the very left of the array to the very right. You can only see...

HardSometimes
arrayqueuesliding-window

Restore IP Addresses

Solve

A valid IP address consists of exactly four integers separated by single dots. Each integer is between 0 and 255 (inclusive) and cannot have leading zeros.

MediumSometimes
stringbacktracking

Beautiful Arrangement

Solve

Suppose you have n integers labeled 1 through n. A permutation of those n integers perm (1-indexed) is considered a beautiful arrangement if for every i (1 <= i...

MediumSometimes
arraydynamic-programmingbacktracking

Remove K Digits

Solve

Given string num representing a non-negative integer num, and an integer k, return the smallest possible integer after removing k digits from num.

MediumSometimes
stringstackgreedy

Unique Paths II

Solve

You are given an m x n integer array grid. There is a robot initially located at the top-left corner (i.e., grid[0][0]). The robot tries to move to the bottom-r...

MediumSometimes
arraydynamic-programmingmatrix

Zigzag Conversion

Solve

The string "PAYPALISHIRING" is written in a zigzag pattern on a given number of rows like this: (you may want to display this pattern in a fixed font for better...

MediumSometimes
string

Largest Rectangle in Histogram

Solve

Given an array of integers heights representing the histogram's bar height where the width of each bar is 1, return the area of the largest rectangle in the his...

HardSometimes
arraystackmonotonic-stack

Find Minimum in Rotated Sorted Array

Solve

Suppose an array of length n sorted in ascending order is rotated between 1 and n times. For example, the array nums = [0,1,2,4,5,6,7] might become:

MediumSometimes
arraybinary-search

Permutations

Solve

Given an array nums of distinct integers, return all the possible permutations. You can return the answer in any order.

MediumSometimes
arraybacktracking

Jump Game

Solve

You are given an integer array nums. You are initially positioned at the array's first index, and each element in the array represents your maximum jump length...

MediumSometimes
arraydynamic-programminggreedy

Palindromic Substrings

Solve

Given a string s, return the number of palindromic substrings in it.

MediumSometimes
two-pointersstringdynamic-programming

Unique Paths

Solve

There is a robot on an m x n grid. The robot is initially located at the top-left corner (i.e., grid[0][0]). The robot tries to move to the bottom-right corner...

MediumSometimes
mathdynamic-programmingcombinatorics

Edit Distance

Solve

Given two strings word1 and word2, return the minimum number of operations required to convert word1 to word2.

MediumSometimes
stringdynamic-programming

Pascal's Triangle

Solve

Given an integer numRows, return the first numRows of Pascal's triangle.

EasySometimes
arraydynamic-programming

Product of Array Except Self

Solve

Given an integer array nums, return an array answer such that answer[i] is equal to the product of all the elements of nums except nums[i].

MediumSometimes
arrayprefix-sum

Reverse Words in a String

Solve

Given an input string s, reverse the order of the words.

MediumSometimes
two-pointersstring

Missing Number

Solve

Given an array nums containing n distinct numbers in the range [0, n], return the only number in the range that is missing from the array.

EasySometimes
arrayhash-tablemath

Subarray Sum Equals K

Solve

Given an array of integers nums and an integer k, return the total number of subarrays whose sum equals to k.

MediumSometimes
arrayhash-tableprefix-sum

Climbing Stairs

Solve

You are climbing a staircase. It takes n steps to reach the top.

EasySometimes
mathdynamic-programmingmemoization

Number of 1 Bits

Solve

Given a positive integer n, write a function that returns the number of set bits in its binary representation (also known as the Hamming weight).

EasySometimes
divide-and-conquerbit-manipulation

Two Sum IV - Input is a BST

Solve

Given the root of a binary search tree and an integer k, return true if there exist two elements in the BST such that their sum is equal to k, or false otherwis...

EasySometimes
hash-tabletwo-pointerstree

Rising Temperature

Solve

Table: Weather

EasySometimes
database

Longest Palindromic Subsequence

Solve

Given a string s, find the longest palindromic subsequence's length in s.

MediumSometimes
stringdynamic-programming

Min Stack

Solve

Design a stack that supports push, pop, top, and retrieving the minimum element in constant time.

MediumSometimes
stackdesign

Count of Integers

Solve

You are given two numeric strings num1 and num2 and two integers maxsum and minsum. We denote an integer x to be good if:

HardSometimes
mathstringdynamic-programming

Design Browser History

Solve

You have a browser of one tab where you start on the homepage and you can visit another url, get back in the history number of steps or move forward in the hist...

MediumSometimes
arraylinked-liststack

Kth Smallest Element in a BST

Solve

Given the root of a binary search tree, and an integer k, return the kth smallest value (1-indexed) of all the values of the nodes in the tree.

MediumSometimes
treedepth-first-searchbinary-search-tree

Can Place Flowers

Solve

You have a long flowerbed in which some of the plots are planted, and some are not. However, flowers cannot be planted in adjacent plots.

EasySometimes
arraygreedy

Maximum Product of Two Elements in an Array

Solve

Given the array of integers nums, you will choose two different indices i and j of that array. Return the maximum value of (nums[i]-1)(nums[j]-1).

EasySometimes
arraysortingheap-priority-queue

Compare Version Numbers

Solve

Given two version strings, version1 and version2, compare them. A version string consists of revisions separated by dots '.'. The value of the revision is its i...

MediumSometimes
two-pointersstring

How often are these problems asked?

Frequency scores are based on crowdsourced interview reports. A higher score means the problem has been reported more often in recent Cisco interviews.

Very Likely

75-100%

Likely

50-74%

Sometimes

25-49%

Rare

0-24%

Preparing for your Cisco coding interview

Cisco interviews focus heavily on array, string, dynamic-programming problems. If you're short on time, these are the categories to prioritize. The problems on this page are sorted by frequency, so start from the top and work your way down.

Beyond solving problems, practice explaining your approach. Cisco interviewers care about your thought process - how you break down a problem, consider edge cases, and evaluate tradeoffs between solutions. A clean O(n) solution you can explain clearly beats an O(log n) solution you can't articulate.

Looking for more companies? Browse all 458 companies in our directory, or sharpen your fundamentals with our free data structure visualizers and AI-powered DSA tutor.

Frequently Asked Questions

What coding problems does Cisco ask in interviews?add

Cisco has been reported to ask 84 distinct coding problems. The most common topics are array, string, dynamic-programming. 24 are Easy difficulty, 47 are Medium, and 13 are Hard. Problems are sorted by frequency - the ones at the top are asked most often.

How hard are Cisco coding interviews?add

Based on 84 reported problems, Cisco interviews are in line with industry averages - 15% Hard vs 18% overall. 56% of questions are Medium difficulty. Focus on the high-frequency Medium problems first, then work through the Hard ones.

How should I prepare for a Cisco coding interview?add

Start with the highest-frequency problems listed on this page. Focus on the core topics: array, string, dynamic-programming. Practice solving them under time pressure and explaining your approach out loud. Mock interviews with AI can simulate the real experience.

Other companies to explore

Ready to ace your Cisco interview?

Simulate a real Cisco coding interview with an AI interviewer. Get a scorecard with specific feedback on your problem-solving, code quality, and communication.

Simulate a Cisco interview with AIarrow_forward