Cisco interview experience Real time questions & tips from candidates to crack your interview

SDE - 1

Cisco
upvote
share-icon
3 rounds | 6 Coding problems

Interview preparation journey

expand-icon
Preparation
Duration: 6 Months
Topics: C, C++, Data Structures, Pointers, OOPS, System Design, Algorithms, Dynamic Programming, Networking, Operating System
Tip
Tip

Tip 1 : Must do Previously asked Interviews Questions.
Tip 2 : Prepare OS, DBMS, OOPs, Computer Networks well.
Tip 3 : Prepare well for one project mentioned in the resume, the interviewer may ask any question related to the project, especially about the networking part of the project.

Application process
Where: Referral
Eligibility: Above 7 CGPA
Resume Tip
Resume tip

Tip 1 : Have at least 2 good projects mentioned in your resume with a link
Tip 2 : Focus on skills, internships, projects, and experiences.
Tip 3 : Make it simple, crisp, and one page

Interview rounds

01
Round
Medium
Online Coding Test
Duration90 Minutes
Interview date17 May 2022
Coding problem2

This was the online test taken on the hackerrank platform. There were 15 MCQs questions based on coding, DBMS, networking, operating system and there were 2 coding questions.

1. Next Permutation

Moderate
15m average time
85% success
0/80
Asked in companies
Wells FargoPharmEasyMeesho

You have been given a permutation of ‘N’ integers. A sequence of ‘N’ integers is called a permutation if it contains all integers from 1 to ‘N’ exactly once. Your task is to rearrange the numbers and generate the lexicographically next greater permutation.

To determine which of the two permutations is lexicographically smaller, we compare their first elements of both permutations. If they are equal — compare the second, and so on. If we have two permutations X and Y, then X is lexicographically smaller if X[i] < Y[i], where ‘i’ is the first index in which the permutations X and Y differ.

For example, [2, 1, 3, 4] is lexicographically smaller than [2, 1, 4, 3].

Problem approach

class Solution {
public:

void nextPermutation(vector& permutation) {
int n = permutation.size(), k,l;
for(k=n-2; k>=0; k--){
if(permutation[k]k; l--){
if(permutation[k] }
swap(permutation[k],permutation[l]);
reverse(permutation.begin()+k+1, permutation.end());
}
}
};

Try solving now

2. Longest Common Prefix

Moderate
40m average time
60% success
0/80
Asked in companies
AdobeGrofersDunzo

You are given an array ‘ARR’ consisting of ‘N’ strings. Your task is to find the longest common prefix among all these strings. If there is no common prefix, you have to return an empty string.

A prefix of a string can be defined as a substring obtained after removing some or all characters from the end of the string.

For Example:
Consider ARR = [“coding”, ”codezen”, ”codingninja”, ”coders”]
The longest common prefix among all the given strings is “cod” as it is present as a prefix in all strings. Hence, the answer is “cod”.
Problem approach

class Solution {
public String longestCommonPrefix(String[] strs) {
if (strs.length == 0) 
return "";
String prefix = strs[0];
int len=0;
for (int i = 1; i < strs.length; i++)
while (strs[i].indexOf(prefix) != 0) {
len = prefix.length()-1;
//System.out.println(len);
prefix = prefix.substring(0, len);
if (prefix.isEmpty()) return "";

return prefix;
}

}

Try solving now
02
Round
Medium
Video Call
Duration60 Minutes
Interview date20 May 2022
Coding problem2

This was technical interview taken by the senior software developer at Cisco. Interviewer gave two coding questions during the interview.

1. Decode Ways

Moderate
15m average time
85% success
0/80
Asked in companies
AccentureUberAdobe

Given a string ‘strNum’ which represents a number, your task is to find the ways to decode the given string ‘strNum’.

The format of encoding is as follows: ‘A’ - 1, ‘B’ - 2, ‘C’ - 3, ‘D’ - 4, ……………, ‘Z’ - 26.

Encoding is possible in letters from ‘A’ to ‘Z’. There is an encoding between character and number.

Example :

subsequence

‘n = 226’ so we can decode ‘226’ in such a way-

‘BZ = 2-26’, as B maps to 2 and Z maps to 26.

‘BBF = 2-2-6’

‘VF = 22-6’

‘226; can be decoded in three ‘BZ’, ‘BBF’, ‘VF’ possible ways.

Point to be noticed we can’t decode ‘226’ as ‘226’ because we have no character which can directly map with ‘226’ we can only decode numbers from ‘1’ to ‘26’ only.

Problem approach

A top down solution for the "Decode Ways" problem. The approach followed is similar to the solution for the "Word Break" problem, which in turn is similar to the "Rod Cutting" problem in CLRS. Every partition is checked to see if it can be decoded. Since partitions may be repeatedly considered, memoization is used to prevent repeating computations.

'''

class Solution {

int numWays(string s, int i, int * dp) {

int res = 0;

int n = s.length();

// The end of the array has been reached and so the string 
// can be decoded
if(i == n) {
return 1;
}

// Get results from memo table if available
if(dp[i] != -1) {
return dp[i];
}

// Cut input string at i creating a substring of size 1
// and determine if remaining substring can be decoded
if(i < n) {
string s_loc = s.substr(i, 1);
int val = stoi(s_loc);
if(1 <= val && val <= 26) {
if(s[i] == '0') {
res = 0;
}
if(s[i] != '0') {
res = numWays(s, i + 1, dp);

}
}

// Cut input string at i creating a substring of size 2
// and determine if remaining substring can be decoded 
if(i < n - 1) {
string s_loc = s.substr(i, 2);
int val = stoi(s_loc);
if(1 <= val && val <= 26) {
if(s[i] == '0') {
res = 0;
}
if(s[i] != '0') {
res = res + numWays(s, i + 2, dp);

}
}

// Store results in memo table
dp[i] = res;

return res;
}

public:
int numDecodings(string s) {

int n = s.length();

// Declare and initialize memo table
int * dp = new int[n];
for(int i = 0; i < n; ++i) {
dp[i] = -1;
}

// Compute number of ways to decode
return numWays(s, 0, dp);
}
};

Try solving now

2. Search In A 2D Matrix

Easy
10m average time
90% success
0/40
Asked in companies
CiscoCIS - Cyber InfrastructureUber

You have been given a 2-D array 'mat' of size 'M x N' where 'M' and 'N' denote the number of rows and columns, respectively. The elements of each row are sorted in non-decreasing order.


Moreover, the first element of a row is greater than the last element of the previous row (if it exists).


You are given an integer ‘target’, and your task is to find if it exists in the given 'mat' or not.


Example:
Input: ‘M’ = 3, 'N' = 4, ‘mat’ = [[1, 2, 3, 4], [5, 6, 7, 8], [9, 10, 11, 12]], ‘target’ = 8

Output: true

Explanation: The output should be true as '8' exists in the matrix.
Problem approach

Since the array is Sorted in both row wise and column wise, Start the checking from first row and last col.
Why Not first row and First Col? Coz If the target is greater than the currentElement You will get confused as u can
move in both directions row wise and colwise.
Hence starting for first row and last col u can explore only 1 direction. If the target is greater than current element then move downwards(As array is sorted , we will have larger elements in the following rows) else move sidewards(bcos target is less than cur element).

class Solution {
public boolean searchMatrix(int[][] matrix, int target) {
int m = matrix.length;
int n = matrix[0].length;
int row = 0;
int col = n - 1;
while(row < m && col >=0){
if(matrix[row][col] == target)
return true;
else if(matrix[row][col] < target)
row++;
else
col--;
}
return false;
}
}

Try solving now
03
Round
Medium
Video Call
Duration60 Minutes
Interview date27 May 2022
Coding problem2

This was 2nd technical round taken by the senior Software developer from the Cisco. This interview was focused on the DSA and project work.

Explain you project in detail
what challenges you have faced while making this project
why did you choose this technology to make this project
where did you hosted your project and how ?

1. Maximum Size Rectangle Sub-matrix With All 1's

Hard
10m average time
80% success
0/120
Asked in companies
HikeAdobeSamsung R&D Institute

You are given an 'N' * 'M' sized binary-valued matrix 'MAT, where 'N' is the number of rows and 'M' is the number of columns. You need to return the maximum size (area) of the submatrix which consists of all 1’s i.e. the maximum area of a submatrix in which each cell has only the value ‘1’.

subMatrix_image

In the above image, areas in green, red, and violet color are all submatrices of the original 4x4 matrix.

Note:

1. Binary valued matrix has only two values in each cell : 0 and 1.
2. A submatrix is a matrix formed by selecting certain rows and columns from a larger matrix.
3. The area of a matrix with 'h' rows and 'w' columns is equal to 'h' * 'w'. 
Problem approach

Simple C++ Solution based on histogram question
If you haven't done histogram question then complete it first because it concept is same just with one extra loop.

Time Complexity - O(N^2)

Space Complexity - O(N)

int maximalRectangle(vector> &m)
{
int ans = 0;
vector sums(m[0].size(), 0);
for (int i = 0; i < m.size(); i++)
{
// From here histogram solution starts
stack st;
for (int j = 0; j <= sums.size(); j++)
{
// Summing up each row in sums vector but replacing with zero if current element is zero
if(j != sums.size())
sums[j] += (m[i][j] == '0') ? -sums[j] : m[i][j] - '0';

// Simple increasing Montonic Stack
while (!st.empty() && (j == sums.size() || sums[st.top()] >= sums[j]))
{
int height = sums[st.top()], width;
st.pop();
width = (st.empty()) ? j : j - st.top() - 1;
ans = max(ans, width * height);
}
st.push(j);
}
}
return ans;
}

Try solving now

2. Reverse Linked List

Easy
15m average time
85% success
0/40
Asked in companies
PayPalOracleVisa
Note :
You do not need to print anything, just return the head of the reversed linked list. 
Problem approach

ListNode* reverseList(ListNode* head) {
ListNode *prev = NULL, *cur=head, *tmp;
while(cur){
tmp = cur->next;
cur->next = prev;
prev = cur;
cur = tmp;
}
return prev;
}

Try solving now

Here's your problem of the day

Solving this problem will increase your chance to get selected in this company

Skill covered: Programming

To make an AI less repetitive in a long paragraph, you should increase:

Choose another skill to practice
Similar interview experiences
company logo
SDE - 1
2 rounds | 4 problems
Interviewed by Cisco
2369 views
0 comments
0 upvotes
company logo
SDE - 1
2 rounds | 4 problems
Interviewed by Cisco
1556 views
0 comments
0 upvotes
company logo
SDE - 1
3 rounds | 5 problems
Interviewed by Cisco
834 views
0 comments
0 upvotes
company logo
SDE - 1
3 rounds | 5 problems
Interviewed by Cisco
968 views
0 comments
0 upvotes
Companies with similar interview experiences
company logo
SDE - 1
5 rounds | 12 problems
Interviewed by Amazon
114453 views
24 comments
0 upvotes
company logo
SDE - 1
4 rounds | 5 problems
Interviewed by Microsoft
57719 views
5 comments
0 upvotes
company logo
SDE - 1
3 rounds | 7 problems
Interviewed by Amazon
34914 views
7 comments
0 upvotes