Cisco
30+ Presto Infosolutions Interview Questions and Answers
Q1. Snake and Ladder Problem Statement
Given a 'Snake and Ladder' board with N rows and N columns, where positions are numbered from 1 to (N*N) starting from the bottom left, alternating direction each row, find th...read more
Find the minimum number of dice throws required to reach the last cell on a 'Snake and Ladder' board.
Start from the bottom left cell and move according to dice outcomes (1-6).
Utilize snakes and ladders to reach the last cell faster.
Keep track of the minimum number of throws required to reach the last cell.
If unreachable, return -1 as output.
Q2. Anagram Pairs Verification Problem
Your task is to determine if two given strings are anagrams of each other. Two strings are considered anagrams if you can rearrange the letters of one string to form the other...read more
Check if two strings are anagrams of each other by comparing their sorted characters.
Sort the characters of both strings and compare them.
Use a dictionary to count the frequency of characters in each string and compare the dictionaries.
Ensure both strings have the same length before proceeding with comparison.
Example: For input 'spar' and 'rasp', after sorting both strings, they become 'aprs' which are equal, so return True.
Q3. Pattern Search in Strings
Given two strings S
and P
consisting of lowercase English alphabets, determine if P
is present in S
as a substring.
Input:
The first line contains an integer T
, the number of test case...read more
The task is to determine if a given substring is present in a given string.
Iterate through the string S and check if each substring of length equal to the length of P matches P.
Use string comparison to check for equality between substrings.
Return 'YES' if a match is found, otherwise return 'NO'.
Object Oriented Programming concepts include encapsulation, inheritance, polymorphism, and abstraction.
Encapsulation: Bundling data and methods that operate on the data into a single unit (class). Example: Class Car with properties like color and methods like drive().
Inheritance: Creating new classes based on existing classes, inheriting their attributes and methods. Example: Class SUV inheriting from class Car.
Polymorphism: Objects of different classes can be treated as obje...read more
Q5. Dijkstra's Shortest Path Problem Statement
You are given an undirected graph with V
vertices (numbered from 0 to V-1) and E
edges. Each edge connects two nodes u
and v
and has an associated weight representing ...read more
Q6. LCA of Three Nodes Problem Statement
You are given a Binary Tree with 'N' nodes where each node contains an integer value. Additionally, you have three integers, 'N1', 'N2', and 'N3'. Your task is to find the L...read more
Q7. Subtree Node Count Problem
We are provided with a tree containing 'N' nodes, numbered from 0 to N-1. The objective is to determine the total number of nodes within each subtree of the provided tree. Specificall...read more
Given a tree, find the number of nodes in each subtree rooted at every node.
Traverse the tree using Depth First Search (DFS) to count nodes in each subtree.
Maintain a count of nodes in each subtree while traversing the tree.
Start the DFS from the root node (node 0) and recursively count nodes in each subtree.
For leaf nodes, the subtree size will be 1 (the node itself).
Q8. Spiral Matrix Problem Statement
You are given a N x M
matrix of integers. Your task is to return the spiral path of the matrix elements.
Input
The first line contains an integer 'T' which denotes the number of ...read more
Q9. Binary Tree Traversals
You are provided with a binary tree consisting of integer-valued nodes. The task is to compute the In-Order, Pre-Order, and Post-Order traversals for the given binary tree.
Input:
The inp...read more
Compute In-Order, Pre-Order, and Post-Order traversals for a given binary tree.
Implement tree traversal algorithms like In-Order, Pre-Order, and Post-Order.
Use recursion to traverse the binary tree efficiently.
Maintain separate lists for each traversal type and return them as nested lists.
Q10. Remove Duplicates from String Problem Statement
You are provided a string STR
of length N
, consisting solely of lowercase English letters.
Your task is to remove all duplicate occurrences of characters in the s...read more
Remove duplicate occurrences of characters in a given string.
Use a hash set to keep track of characters seen so far.
Iterate through the string and add non-duplicate characters to a new string.
Return the new string without duplicate characters.
A website sends data to a server through HTTP requests, which include the data in the request body or parameters.
When a user interacts with a website (e.g. submits a form), the website sends an HTTP request to the server.
The data can be sent in the request body (e.g. JSON or XML) or as parameters in the URL.
The server processes the request, retrieves the data, and sends a response back to the website.
Examples of data sent to a server include user input, file uploads, and API ...read more
The topic of the video I submitted for my assignment was the impact of renewable energy on reducing carbon emissions.
Discussed various sources of renewable energy such as solar, wind, and hydro power
Highlighted the benefits of transitioning to renewable energy for the environment and economy
Provided examples of countries successfully implementing renewable energy initiatives
Q13. Can you use a variable in a file using extern which is defined as both static and global in base file?
No, it is not possible to use a variable defined as both static and global in base file using extern.
A variable cannot be both static and global at the same time.
Static variables have file scope and cannot be accessed from other files using extern.
Global variables can be accessed from other files using extern, but cannot be static.
Therefore, it is not possible to use a variable defined as both static and global in base file using extern.
Q14. If you are not having a sizeof operator in C, how will you get to know the size of an int ?
Use the sizeof operator on a variable of type int to get its size.
Use sizeof operator on a variable of type int
Size of int is typically 4 bytes
Size may vary depending on the system architecture
Q15. When we declare union in C, how is the size of union allocated in the memory?
Size of union in C is allocated based on the size of the largest member.
The size of the union is equal to the size of the largest member.
The memory allocated for a union is shared by all its members.
Unions are used to save memory when only one member is accessed at a time.
Q16. What is the boundary problem in allocation of size of structures?
Boundary problem refers to the difficulty in deciding the optimal size of structures to allocate resources.
It involves determining the trade-off between the benefits of larger structures and the costs of building and maintaining them.
The problem is particularly relevant in fields such as architecture, civil engineering, and urban planning.
For example, in urban planning, deciding the optimal size of roads, buildings, and parks can have a significant impact on the quality of li...read more
Q17. How PING works? ICMP protocol.so add ICMP header to ip payload field and stuff.
PING works by sending ICMP echo request packets to a destination host and waiting for ICMP echo reply packets in response.
PING uses the ICMP protocol to send echo request packets to a destination host.
The destination host responds with ICMP echo reply packets if it is reachable.
PING measures the round-trip time for the packets to travel to the destination and back.
PING can also be used to check network connectivity and diagnose network issues.
Q18. How www.google.com typed in browser works??(abt dns server,etc)
When www.google.com is typed in a browser, the DNS server translates the domain name to an IP address to locate the website.
DNS server translates domain name to IP address
Browser sends request to DNS server to resolve domain name
DNS server returns IP address of the website
Browser then connects to the website using the IP address
Q19. Explain ARP. why is udp used? Explain PORT addressing.
Q20. in a sorted matrix of 0s and 1s, return the row with max 1s
Iterate through each row and count the number of 1s, return the row with the maximum count.
Iterate through each row of the matrix
Count the number of 1s in each row
Track the row with the maximum count of 1s
Q21. Tell about scheduling algos(round robin etc),context switching
Q22. do you know any competitors of cisco
Yes, some of the competitors of Cisco are Juniper Networks, Huawei, and Arista Networks.
Juniper Networks is a networking equipment company that provides networking solutions to enterprises and service providers.
Huawei is a Chinese multinational technology company that offers networking and telecommunications equipment and services.
Arista Networks is a computer networking company that specializes in data center switches and cloud networking solutions.
Q23. Tell about different OSI layers.
Q24. How does internet work?
The internet is a global network of interconnected computers and servers that communicate with each other using standardized protocols.
The internet is made up of physical infrastructure such as cables, routers, and servers.
Data is transmitted across the internet using standardized protocols such as TCP/IP.
The Domain Name System (DNS) translates human-readable domain names into IP addresses.
Web browsers such as Chrome and Firefox use HTTP and HTTPS protocols to communicate wit...read more
Q25. Write a macro to set the nth bit ?
A macro to set the nth bit.
Use bitwise OR operator to set the nth bit to 1.
Use left shift operator to move 1 to the nth position.
Use bitwise AND operator to clear the nth bit if needed.
Q26. find unique character from a string and optimize it
Find unique character from a string and optimize it
Use a hash table to store the frequency of each character in the string
Iterate through the hash table to find the character with frequency 1
If there are multiple characters with frequency 1, return the first one
Optimization: Stop iterating through the hash table once a character with frequency 1 is found
Q27. What is cloud computing and types
Cloud computing is the delivery of computing services over the internet.
Cloud computing allows users to access and use computing resources on-demand.
Types of cloud computing include public, private, and hybrid clouds.
Public clouds are owned and operated by third-party providers, like Amazon Web Services (AWS) or Microsoft Azure.
Private clouds are dedicated to a single organization and can be located on-premises or hosted by a third-party provider.
Hybrid clouds combine public ...read more
Q28. What is critical section?
Design a basic hash map
Use an array of linked lists to handle collisions
Implement methods for adding, removing, and retrieving key-value pairs
Include a hashing function to map keys to indices in the array
Q30. write a code for a palindrome
Code to check if a given string is a palindrome or not.
Convert the string to lowercase to ignore case sensitivity.
Use two pointers, one at the start and one at the end of the string.
Compare the characters at both pointers and move them towards each other until they meet.
If all characters match, the string is a palindrome.
Q31. Ospf,Rip,how to swap number in python programming
The question is unclear and seems to be asking for two unrelated things.
Clarify the question and ask for more information.
Provide examples of what is being asked for in regards to swapping numbers in Python.
Discuss OSPF and RIP in relation to network QA engineering.
Q33. Code Insertion sort and time complexity
Insertion sort is a simple sorting algorithm that builds the final sorted array one item at a time.
Iterate through the array starting from the second element
Compare each element with the elements before it and insert it in the correct position
Time complexity is O(n^2) in the worst case scenario
Q34. What is deemed supply?
Deemed supply refers to transactions that are treated as supplies even though no actual supply has taken place.
Deemed supply can include situations where goods or services are transferred without consideration, or when a business owner uses goods or services for personal use.
Examples of deemed supply include gifts or samples given by a business, self-consumption of goods by a business owner, and transfers of assets between related parties.
Deemed supply rules vary by jurisdict...read more
Q35. Dijkastra's Algorithm
Dijkstra's Algorithm is a graph search algorithm that finds the shortest path between nodes in a graph.
Dijkstra's Algorithm is used to find the shortest path from a starting node to all other nodes in a weighted graph.
It works by maintaining a set of nodes whose shortest distance from the starting node is known.
The algorithm iteratively selects the node with the smallest distance and updates the distances of its neighbors.
Example: Finding the shortest path in a map from one c...read more
Top HR Questions asked in Presto Infosolutions
Interview Process at Presto Infosolutions
Top Interview Questions from Similar Companies
Reviews
Interviews
Salaries
Users/Month