You are given a maze with N cells. Each cell may have multiple entry points but not more than one exit (ie. entry/exit points are unidirectional doors like valves). The cells are named with an integer value from 0 to N-1. You need to find the the length of the largest cycle in the maze. Return -1 if there are no cycles. INPUT FORMAT First line has the number of cells N Second line has list of N values of the edge[] array. edge[i] contains the cell number that can be reached from of cell ‘i’ in one step. edge[i] is -1 if the ‘i’th cell doesn’t have an exit. OUTPUT FORMAT largest sum among all cycles Sample input: 23 4 4 1 4 13 8 8 8 0 8 14 9 15 11 -1 10 15 22 22 22 22 22 21 Sample output 6 I have already tried to do this with DFS to find all possible cycles and print the largest cycle size. Please let me know if there is any better solution for the same.
Desenvolvedor De Software Interview Questions
Desenvolvedor De Software Interview Questions
A área de desenvolvimento de projetos está em alta e oferece bons salários e realização profissional. Em entrevistas para cargos de desenvolvimento de software, são normalmente feitas perguntas relacionadas às suas habilidades técnicas e comportamentais e a como você gerencia projetos de maneira eficiente.
Principais perguntas de entrevista para desenvolvedor(a) de software e como respondê-las
Pergunta 1: Com qual tipo de desenvolvimento de software você trabalha no momento?
Pergunta 2: Descreva um problema de desenvolvimento que você tenha tido e como o solucionou.
Pergunta 3: Como é seu processo de garantia de qualidade?
93,176 desenvolvedor de software interview questions shared by candidates
Write a function that reverses a sentence, keeping the words together. Eg This sentence will be reversed. -> reversed. be will sentence This
Describe a project you've worked on
Asked if I would be willing to learn COBOL when coming in as a Java dev.
Difference between an interface and abstract class?
what would you do if you are not able to handle a team?
Basic of C++,lot of question on Project and implemantation of stack ,linked list,in c++ and in STL,STL is most Imp
Basic Concepts,Sql...
Basic networking and conceptual level questions of OOPS, PhP level questions as company uses php Yii framework javscript basic questions like array, callback functions
1st Round : 1. Nearest prime number of given number if there are two nearest prime numbers print both. Ex - input = 30 output = 29, 31. 2.Write a function that takes input as a String. It should return true if all characters in the string are unique, false otherwise. You cannot use additional data structure. (a-z and 1-9. No Unicode/Special character/Uppercase characters) 3. For “aabcccccaaa” input, your method will return “a2b1c5a3” but for “abcd” input, your method will return “abcd” 4. Cool Dude program. 5.Write a function which takes input as a number: If the given number is a Fibonacci number, print the number If the given number is NOT Fibonacci number, print the sum of all even Fibonacci numbers less than the given number. 2nd Round: 1. Array contains only 0 and 1, Write a program that sort this numbers using single loop 2. input = Raja Software Labs output = Raja%20Software%20Labs. You are not allowed to use extra string or extra array. You have to modify the given input string only. 3rd Round: 1. You will find question here : https://www.geeksforgeeks.org/add-1-number-represented-array/ 2. Find the unique substrings of a given string. 3. I don't remember the question now 4. puzzle : https://www.geeksforgeeks.org/puzzle-rope-escape/ 4th Round: It consists of general discussion about you and your resume, Projects. 1. Check for balanced parenthesis, If the given string is not balanced then balance it and return. string only contain "{" and "}"
Viewing 901 - 910 interview questions