19. Recreate Siri Knowledge Graph in Swift

In a technical interview, you are asked to design the essential components needed to recreate the very popular Siri virtual assistant present on iOS and Mac OS devices. While the inner workings of Siri are assumed to be complex (much beyond the scope of a technical interview), some fundamental elements of Siri could be replicated through well-known data structures, algorithms as well as the Swift SDK:

 
jeremy-zero-yh5M-4aBiZ0-unsplash.jpg
 

Hints

As the code challenge suggests, Siri is a knowledge graph, which presents some slight differences between itself and traditional graph-based models. Other questions include:

  • What is a knowledge graph?

  • How would you represent the data structures needed to represent a graph in Swift?

  • How is Siri able to retrieve the answer to your question through spoken language.

    • Could this process be replicated through existing libraries present in the iOS SDK?