Google Interview Report
- 0of 0 votes
AnswerGive the structure of a directed graph
- ajay.raj February 13, 2018 in United States
START -> a -> b -> c -> END
If a word can start from start and end at END, then we think the word is in this diagram
For example, the string "abc" is consistent, but "ab" does not match,
Although "ab" is also inside the graph, b's next is "c" instead of END, so it's not legal word
(Note: each node can have more than one next)
1. According to the problem, design the data structure
Write a function, input is START and a string, to determine whether the string is a valid word
3. follow up, if the graph has cycle, how to do?
4. If the graph has repeated characters how to do?| Report Duplicate | Flag | PURGE
Google Java Developer - 0of 0 votes
AnswersGiven a list of relationship of report
- ajay.raj February 13, 2018 in United States
A reported to D, D reported to Z, who are reported to Z| Report Duplicate | Flag | PURGE
Google Java Developer
CareerCup is the world's biggest and best source for software engineering interview preparation. See all our resources.