Company Name | YOE (Payscale) | Question |
---|---|---|
HashedIn | 3 | users = [ |
{"name": "Alice", "age": 30, "location": "New York"}, | ||
{"name": "Bob", "age": 25, "location": "Paris"}, | ||
{"name": "Charlie", "age": 35, "location": "New York"}, | ||
{"name": "David", "age": 30, "location": "London"}, | ||
{"name": "Eve", "age": 22, "location": "Paris"} | ||
] |
Write a function in Python that groups the users by their location and returns a dictionary where the keys are locations and the values are lists of user names in that location, sorted alphabetically.
e.g. { ‘New York’:[’Alice’,’Charlie’] | | HashedIn | 3 | Input: [100, 4, 200, 1, 3, 2] find the longest consecutive sequence of number. e.g. [1,2,3,4] | | HCODE | 2 | Create a flat file format from a list of nested lists without loops: a = [[1,2], [1,2,3], [2,4]] | | HCODE | 2 | Return the ids which have python as skills:
a= { "users": [ { "id": 1, "name": "Alice", "role": "Data Engineer", "skills": ["Python", "SQL", "Spark"] }, { "id": 2, "name": "Bob", "role": "Analyst", "skills": ["Excel", "PowerBI"] }, { "id": 3, "name": "Charlie", "role": "Data Scientist", "skills": ["Python", "TensorFlow", "Pandas"] } ] } | | HCODE | 2 | Total transaction amount per user from a csv dataset using pandas | | | | |