tag:blogger.com,1999:blog-2211014955289196332.post7848817944905741947..comments2022-03-03T18:45:10.120-08:00Comments on Break the CODE!!!: Google Fresher InterviewRajhttp://www.blogger.com/profile/17337354573345310652noreply@blogger.comBlogger1125tag:blogger.com,1999:blog-2211014955289196332.post-20962647801478675032014-02-15T10:39:21.729-08:002014-02-15T10:39:21.729-08:00Please implement a graph database (a kind of NoSQL...Please implement a graph database (a kind of NoSQL). This graph database <br />should consist of nodes (with have properties) for entities and edges (which <br />have single or multiple properties and can be directional or bidirectional) for <br />relationships, and support node indexing and query. The query language has <br />following keywords: START, MATCH, WHERE, RETURN, ORDER BY, <br />AGGREGATE, SKIP, and LIMIT. <br /> <br />Example Input: <br />Node martin = graphDB.createNode(); <br />martin.setProperty(“name”, “Martin”); <br />Node pramod = graphDB.createNode(); <br />pramod.setProperty(“name”, “Pramod”); <br />Node barbara = graphDB.createNode(); <br />pramod.setProperty(“name”, “Barbara”); <br />martin.createRelationshipTo(pramod, FRIEND, since = 1998); <br />pramod.createRelationshipTo(martin, FRIEND, since = 1998); <br />martin.createRelationshipTo(barbara, FRIEND); <br />barbara.createRelationshipTo(martin, FRIEND); <br />START node = Node:nodeIndex(name = “Barbara”) <br />MATCH path = node-[relation*1..3]->related_node <br />WHERE type(relation) = ‘FRIEND’ <br />RETURN related_node.name, length(path), relation.since; <br />KALYAN CHERUKURIhttps://www.blogger.com/profile/16350077111237507064noreply@blogger.com