You have datastructure my $users = [ { name => 'John', score => 10, }, { name => 'Bob', score => 1, }, { name => 'Carlos', score => 5 }, { name => 'Alice', score => 5, }, { name => 'Donald', score => 7 } ]; now u have to arrange the name with highest to lower score, if score is same than in alphabetical order #expected output: # John # Donald # Alice # Carlos # Bob
Perl Developer Interview Questions
103 perl developer interview questions shared by candidates
I face only one question. If you are given 2 array A={3,1,2,4} B={1,4}. Write a program to compare two arrays and create another array which holds the common values between two array!
one question was as under - "Symmetric Difference of Arrays" Input: two arrays of integers Output: one array of integers which occur in only one (not both) arrays Test case: Input: [ 1, 7, 8, 2, 4, 5 ] [ 3, 5, 1, 7, 6, 9 ] Output: [ 8, 2, 4, 3, 6, 9 ]
How do you remove duplicates from an array of integers?
You have the file with word at a single line. #input sample file abactor abaculus abacus Abadite . . Zyrenian #Output ******************a **********b ************************c a) you have to count the character and create a histogram in alphabetical order. b) now you have to produce a histogram with max 80 character in line in reference to max count c) now same out based histrogram based on the character count
Write a function get_hops_from(page1, page2) that will determine the number of hyperlinks that you would need to click on to get from some page1 on the web to some other page2 on the web. For example, if each page below links to the pages that are indented below it, e.g. page 1 links to pages 2 and 5, and page 2 links to pages 3 and 4, and page 5 links to pages 3 and 7, then the get_hops_from(page1, page7) should return 2 (2 hops), since you have to hop once from page 1 to 5 and once more from page 5 to page 7. page1 : distance == 0 page2 : distance == 1 page3 : distance == 2 page4 : distance == 2 page5 : distance == 2 page3 : distance == 2 page7 : distance == 2 Assume that an API is available to: * get_links(a_page) will return an array/list of all pages that a_page links to
Can you optimize the algoritm which you wrote.
Create monolithic sublists from an array of integers ,in increasing order for example [1,2,4,7,5,6,3,2] will give [[1,2,4,7][5,6],[3],[2]]
Convert number above in hexadecimal 312312 Ex. 255 -> FF 254 -> 254 div 16 = 14, int(254/16) = 15. -> F, E Later I found the detailed Division-remainder in source base http://en.wikipedia.org/wiki/Hexadecimal#Division-remainder_in_source_base
You have input arrays and one output. The output one contains only the elements that are only in one of the arrays. Fallow u question is what is the complexity of problem and algorithm
Viewing 1 - 10 interview questions