US Cisco OA 26ng questions are not difficult | Cisco is sending out OAs while laying off employees? Sharing three OA questions

644 Views
No Comment
US Cisco OA 26ng questions are not difficult | Cisco is sending out OAs while laying off employees? Sharing three OA questions

Cisco OA The three questions are click-and-deliver, so it's not that hard. Many candidates are taking Cisco's SDE Online Assessment (OA) and interviews, especially in September.

Based on the feedback I got, one thing that is clear is that basically new questions are asked in Cisco's OA, so just relying on brushing up on the questions is not enough, you need to solve a lot of new questions and new patterns so that your brain is ready to deal with the new topics!

Most of the questions this year dealt with trees, greedy algorithms, sorted collection applications, hashing, binary lookups, double pointers, and other related topics. Now let's take a look at a recent Cisco OA.

Cisco OA 1

Problem: The IT department of a company has a problem with users consistently using simple passwords such as "password", "abc123", etc. You need to write an algorithm to find the minimum number of changes (insertion and deletion of characters) required to convert these passwords to more complex versions. You need to write an algorithm to find out the minimum number of changes (number of insertions and deletions of characters) required to convert these simple passwords to more complex versions.

Input:

  • On the first line, enter a string currPassword indicating the current password.
  • On the second line, enter a string newPassword for the new password.

Output: Outputs an integer indicating the minimum number of updates (including character insertions and deletions) required to convert the current password to a new one.

Ideas For Solving The Problem

To compute the minimum number of operations to convert currPassword to newPassword, it can be broken down into the following steps, first finding the longest common subsequence of currPassword and newPassword.

Then it's obvious that for the delete operation currPassword is the length of the LCS minus the length of the LCS, i.e. the number of characters to be deleted. For insertion operation newPassword, the length of LCS is subtracted from the length of newPassword, i.e. the number of characters to be inserted. Total number of operations = number of delete operations + number of insert operations.

Cisco OA 2

Problem: Given two lists, each representing a non-negative integer. The numbers in the lists are arranged in reverse order. Write an algorithm to compute the sum of the two numbers and output the result as a list.

Input:

  • The first line inputs an integer list1_size, representing the size of the first list (N).
  • The second line contains N space-separated integers representing the elements in the first list.
  • The third line enters an integer list2_size, representing the size of the second list (M).
  • The last line contains M space-separated integers representing the elements in the second list.

Output: Outputs K space-separated integers representing the sum of two numbers, with the result presented in reverse order.

Ideas For Solving The Problem

First convert the list to numbers, for the first list, reverse the order and splice it into a string, then convert it to an integer. Similarly for the second list. Add two numbers, add the two converted numbers to get the result. Convert the result to an inverted list, convert the summed result to a string, reverse the order and split it into individual characters, then convert it to a list of integers.

Cisco OA 3

Problem: Write an algorithm that prints the number of occurrences of the largest number in a list of integers.

Input:

  • Enter an integer on the first line list_size, which indicates the number of elements in the list (N).
  • On the second line, enter N space-separated integers representing the elements of the list.

Output: Outputs an integer representing the number of occurrences of the largest element in the list.

Constraints:

Cisco OA 3

Solution: Directly use the function max() to get the maximum number, and then use the function count() to count the number of times the maximum number appears in the list. Return the result can be.

Can you pass Cisco OA without brushing up ?

Programhelp team provides one-stop interview assistance, interview proxy services, covering programming, system design, behavioral analysis, and other question types, to help accurately improve your interview performance. Contact us today to get one step closer to a top tech company offer!

author avatar
ProgramHelp
END
 0
Comment(No Comment)