Goldman Sachs | Online assessment | Experienced hire
Anonymous User
1628

Online Assessment :Hackerank assessment : 2 hours

Q1 : Given a list of resources return the list of resources based on a certain priority condition
If any resource is occuring for a single time it is directly added to the output list , if the same resource occurs again
it should be updated with the newly occured resource value.
The order of resources should be maintained

input : List<List> resources
eg : [P1:b , p2 : x : p4:q] [P1 : a , p3 : x : p4:t]
output : List
eg : a , x , t , x

P1 -> updated value = a
P2 -> occurs one time = x
P4 -> updated value = t
P3 -> occurs one time = x

Note : order of incoming resource is maintained

Q2 : Better compression
Given a string , return the compressed version of string

Eg : input : a3c9b2c1
output : a3c10b2
Since c occurs 2 times it needs to compressed like this.

Eg : input :a12c4b2a1
output : a13c4b2

Note count can be 2 digits also (more than 1 digit)
Also order of the characters needs to be maintained.

PS : I had got all test cases passed , but haven't recieved any feedback yet.

Comments (4)