Pergunta de entrevista da empresa Dolby

One riddle about 2 ropes and logic for counting digit "1" in an integer value.