Affirm| Tech Screen| SDE-2 2022

Anonymous User
3449
Feb 07, 2022
Feb 07, 2022

Virtual Live coding done through hacker rank

  1. Given an input dataset consisting of JSON records, return the schema of the dataset

[
{"a": 1, "b": ["hello", "world"], "c": "foo"}
]

schema should show 'a' is of type int, 'b' is of type list of string, 'c' is of type string
There can be nessted records lke

[
{a: b:{ "hello", "world"}) , "c": "foo"}
]

schema should show 'a' is of type 'b' of type list of string, 'c' is of type string
There can be nessted records lke

Used a recurisve approach to break down each record in dataset and returned a dictionary of key which map to the type

Comments (5)