I applied for a job and they asked me to write code with the following requirements:Get a toolbar offer description from  http..update.utorrent.com/installoffer.php?offer=conduit.  Parse the  bencoded (see http://en.wikipedia.org/wiki/Bencode) response and  extract the URL of the binary and its SHA1 hash.  The hash is contained  in the value of the key 'offer_hash'. The binary is in list for the  key 'offer_urls'  please use the one prefixed with  http..download.utorrent.com/.Download the binary and calculate its hashVerify that the calculated SHA1 hash is identical to the one provided  in the offer details.  It is okay to use existing libraries for  bencoding, hashing, etc.What is wrong with my code? The recruiter said it didn't meet their bar.# Script that verifies the correctness of a toolbar offersimport urllib, bencode , hashlibfrom hashlib import sha1url = http://update.utorrent.com/installoffer.php?offer=conduitfilename = content.txtf= urllib.urlretrieve(url, filename)#Bdecoding the responsewith open (str(filename), 'rb') as myfile:           data=myfile.read()           decoded = bencode.bdecode(data)# Returning the list for the key 'offer_urls'list = decoded['offer_urls']#print list# Returning the URL of the binary that is prefixed with http://download3.utorrent.com/length = len (list)prefix = http://download3.utorrent.com/i= -1while i < length:     i = i + 1     if list[i].startswith(prefix) :        breakbinary= list[i]print The URL of the the binary is:  , binary# Returning the sha1 hash contained in the value of the key 'offer_hash'encrypted_hash = decoded['offer_hash']sha1_hash1 = encrypted_hash.encode('hex')print The sha1 hash contained in the value of the key 'offer_hash' is:  , sha1_hash1 # Downloading the binary and calculating its hashurllib.urlretrieve ( binary , utct2-en-conduit-20130523.exe)file = C:\Python27\utct2-en-conduit-20130523.exewith open (file, 'rb') as myfile:           downloaded=myfile.read()k = hashlib.sha1()k.update(downloaded)sha1file = k.hexdigest()print The sha1 hash of the downloaded binary is:  , sha1file# Verify that the calculated sha1 hash is identical to the one provided in the offer detailsif (sha1file == sha1_hash1) :    print Test result = Passelse :    print Test result = Fail
Calculate SHA1 hash from binary and verify with a provided hash
python;algorithm;interview questions