Cisco Coding Questions and Answers

Cisco Coding Questions with Solutions

This page will help you get Cisco Coding Questions and Answers asked in Online Assessment and Technical Interview of the company’s recruitment process. Other than that you will find Insights on Recruitment process of Cisco for particular job profiles. 

cisco-coding-questions

Steps of Cisco Recruitment Process

This Cisco Recruitment process consists of the following steps :

  1. Online Coding Round
  2. Technical Interview
  3. HR Interview

Insight on Cisco Online Assessment

Here are some facts related to Cisco Recruitment Test:

  1. Cisco Conducts its Recruitment Test on Hackerrank.
  2. On Hackerrank candidates can choose any Programming Language to solve the given Problem Statement.
  3. Aptitude Based Questions may or may not be asked in Online Assessment, but Coding Questions are always asked.
  4. Team of 3 Members needs to be formed to participate in the Online Assessment.
  5. Discussion within the team is allowed, while solving the given problem statements.

Details of  Cisco Recruitment Process

Cisco Recruitment Process starts with Online Assessment and is followed by a Technical Interview, we have given further details below :

RoundsTopicsNo. of QuestionsTime
Online AssessmentAdvanced Coding Questions31 Hour

Prime Course Trailer

Related Banners

Get PrepInsta Prime & get Access to all 200+ courses offered by PrepInsta in One Subscription

Cisco Technical Test Coding Questions with Solutions

Question 1 : Coin Game

Raman was playing a game,  he starts with x coins. Now in every step, he wins and loses and he has to get the money or pay the money as needed. He came in contact with a psychic who can see the future and the Psychic predicted the outcomes after each step. Now Raman wants to start the game with the minimum wage where he doesn’t run out of money.  Help Raman to find what money he should start with. The only rule to keep playing is not going in a credit situation.

Input Format:

  • First line with n, number of steps in the game
  • Next n lines, n integers denoting outcomes of every game. Positive means winning and negative means losing that money.

Output Format:

  • One single integer denoting the minimum amount to start with

Constraints:

  • Number of steps<=10^9
  • -1000<=Money needed in each step<=1000

Sample Input:

4
2
-9
15
2

Sample Output:

7

Explanation:

If he starts with 7 rupees, then after steps : 7 ->9 -> 0-> 15 -> 17.

Question 02 : Device Name System

Problem statement: Rocky is a software engineer and he is creating his own operating system called “myFirst os”. myFirst os is a GUI (Graphical user interface) based operating system where everything is stored in files and folders. He is facing issues on  creating unique folder names for the operating system . Help rocky to create the unique folder name for it’s os.If folder name already exists in the system and integer number is added at the name to make it unique. The integer added starts with 1 and is incremented by 1 for each new request of an existing folder name. Given a list of folder names , process all requests and return an array of corresponding folder names.

Example 

  • n=5
  • foldername= [‘home’ , ‘myfirst’ ,’downloads’, ‘myfirst’, ‘myfirst’]
  • Foldername[0] = ‘home’ is unique.
  • Foldername[1] = ‘myfirst’ is unique.
  • foldername [2] =’downloads’ is unique.
  • Foldername[3] =’myfirst’ already exists in our system. So Add1 at the end of the folder name i.e foldername[3] =”myfirst1″
  • Foldername[4 ]=’myfirst’ also already exists in our system.So add 2 at the end of the folder name i.e. foldername[4]=”myfirst2″.

Function description 

  • Complete the function folderNameSystem In the editor below
  • folderNameSystem has the following parameters
  • string foldername[n]: an array of folder name string in the order requested

Returns:

  • String[n]:  an array of strings usernames in the order assigned

Constraints

  •     1<=n<=10^4
  •     1<=length of foldername[i]<20
  •     foldername[i] contains only lowercase english letter in the range ascii[a-z]

Input Format:

  • The first line contains an integer n , denoting the size of the array usernames Each line i of the n subsequent lines (where i<=0<=n) contains a string usernames[i] representing a username request in the order received.

Sample case 0

  • 4
  • home 
  • download
  • first
  • first

Sample Output 0

  • home
  • download
  • first
  • first1

Explanation 0

  •    foldername[0] = ‘home’ is unique
  •    foldername[1]=’download’ is unique
  •    foldername[2]= ‘first’ is unique
  •    foldername[3]=’first’ is already existing . so add 1 to it and it become first1

Question 3 : Coloured Zenga

Problem Statement :

Rahul is playing a game, wherein he has multiple coloured wooden blocks, stacked one above the other, his task is to remove all the wooden blocks from the stack, without letting it fall and in the minimum number of steps. He can remove one block of a colour at a time, but he can remove multiple blocks of the same colour together. Determine the minimum number of steps in which he can perform this task.

For example, if you remove [red,red] from (white,red,red,white), the resulting array is [white,white].

Note- there are only two colour blocks – red and white

Function description :

Complete the minMoves function in the provided editor. It contains the following parameters:

Parameters:

NameTypeDescription
NIntegerNo. of Wooden blocks
Array[ ]Integer ArrayArray of Blocks.

Input format :

The first line contains an integer n denoting the number of blocks. Each n line denotes the colour of the wooden block .

Constraints :
1<=n<=700
0<=a[i]<=1

Sample input 1 :

4
red
white
white
red

Sample Output 2 :

2

Explanation :

Remove [white,white] first The array will be [red,red] The remaining numbers can  be removed in one strap .

Sample Input 1:

4
white
red
white
red

Sample Output 1:

3

Sample Explanation:
0
The steps are [white,red,white,red]->[red,white,red]->[red,red]->[]. Therefore the answer is 3.

Question 4 :Make It Palindrome

Problem Statement  :

You’re given a string, you’ve to print additional characters needed to make that string a palindrome.

A Palindrome is a sequence of characters that has the property of reading the same in either direction.

Input :
abede
Output :
ba

Sample Input :
abcfe

Sample output :
fcba

Question 5 : Seating Arrangement in Exam Hall

Problem Statement  :

Semester exams are going on for university students. Examiners noticed that a group of people are trying to cheat. They marked students of that group as ‘1’ and students of another group ( who are not cheating ) as ‘0’ 

We can reduce cheating by not allowing students from group 1 to sit together, means no two students from group 1 can sit together. Seatings are marked using above conditions. Your task is to give the seating placement of nth possibility Possibility order from 1 to 10 is given below

[1  10  100  101  1000  1001  1010  10000  10001  10010]

Sample input :

3 → number of test cases

4

6

9

Sample output :

101

1001

10001

Explanation :

4th possibility is 101 

6th possibility is 1001

9th possibility is 10001

FAQs related to Cisco Coding Questions with Solutions

Question 1: What is Cisco Coding Round Process for 2023.
  • There is a Online coding assessment where students need to solve 3 Coding problems in 1 Hour.
  • Students can participate in the team of 3 members and every team must have 1 leader.
  • Only leader can solve the Coding problems while the other team mates can help the leader.
  • All the team members need to present on a common google meet while attempting the test.
Question 1: How many team members are allowed in Cisco Online Coding Assessment?

Team of 3 candidates must be formed to participate in Cisco Online Coding Assessment.

Question 2: How much time is allotted in Cisco's Code With Cisco Coding Assessment?

1 Hour is allotted to the particular team to complete whole Online Coding Assessment.

Question 3: How many Problem Statements are given to the particular team in Code With Cisco Coding Assessment?

Total 3 Problem Statements are given to the particular team to solve in 1 Hour time Slot.

Question 4: Is discussion is allowed in Code With Cisco Coding Assessment ?

Yes, Discussion is allowed within the Team. If team members are in separate locations, they can use Google Meet to communicate with each other.

Get over 200+ course One Subscription

Courses like AI/ML, Cloud Computing, Ethical Hacking, C, C++, Java, Python, DSA (All Languages), Competitive Coding (All Languages), TCS, Infosys, Wipro, Amazon, DBMS, SQL and others

Checkout list of all the video courses in PrepInsta Prime Subscription

Checkout list of all the video courses in PrepInsta Prime Subscription