[Tutor] Fwd: Puzzle - Next Step to our interviewing process - Pramati Technologies!

Danny Yoo dyoo at hashcollision.org
Wed Apr 23 19:12:42 CEST 2014


Hi Sunil,


Try a simpler but related problem first.

Say that you have two lists of numbers, like:

######
nums1 = [3, 1, 4]
nums2 = [2, 7, 1]
######

Can you design a function addLists() that takes two lists of numbers
of equal length, and adds them together?  For example,

    addLists(nums1, nums2) == [5, 8, 5]

should be true, as well as:

     addLists([4, 6], [8, 5]) == [12, 11]


Would you be able to write the addLists() function?  Would you be able
to write a few test cases to check that the implementation works on
those examples?


More information about the Tutor mailing list