Below coding questions were asked in HackerRank test along with 8 MCQs and test was for 90 mins.
Question 1 : You are given an array of integers.
Return an array of sum of factors of each integer.
E.g. : Input -> [12]
factors are - 1, 2, 3, 4, 6, 12
Output -> [28]
Note - Sum can be greater than Integer, so consider it as long or Long, so ou can return
List<Long>
Ever integer will in range of 1 to 1000000
Input array size will be in range of 1 to 100000000
Return an array of sum of factors of each integer.
E.g. : Input -> [12]
factors are - 1, 2, 3, 4, 6, 12
Output -> [28]
Note - Sum can be greater than Integer, so consider it as long or Long, so ou can return
List<Long>
Ever integer will in range of 1 to 1000000
Input array size will be in range of 1 to 100000000
Question 2 : You are given a string of binary number.
You need to return the count of unique integers which can be created by the
subsets of given binary number.
E.g. : Input -> 011
Subsets -> 0, 1, 01, 11, 011
Integers -> 0, 1, 1 3, 3
Unique Integers -> 0, 1, 3
Output -> 3
Note - Input binary string will be of length 1 to 20
You need to return the count of unique integers which can be created by the
subsets of given binary number.
E.g. : Input -> 011
Subsets -> 0, 1, 01, 11, 011
Integers -> 0, 1, 1 3, 3
Unique Integers -> 0, 1, 3
Output -> 3
Note - Input binary string will be of length 1 to 20
Please suggest your answers for the above questions.