π BitTorrent tracker based architecture (12 MCQs)
π From Data Communication and Networks β’ 29. Peer to Peer Paradigm β’ 12 questions available
What is BitTorrent tracker based architecture?
In tracker-based BitTorrent architecture, a central tracker coordinates peers by maintaining a list of participants sharing a specific file, helping new users discover others to exchange pieces with while not storing the actual content.
π All BitTorrent tracker based architecture MCQs
Q1. During LZW encoding with the initial dictionary {0:A, 1:B}, what is the first codeword output when encoding the string \BA...\?
π Explanation: The encoder begins with entries 0βA and 1βB. The first character read is B, which maps to code 1. Consequently the first codeword emitted is 1, and the dictionary is expanded with the new entry \BA\. This matches option B and illustrates the basic start of LZW encoding.
Q2. When decoding, if a received codeword is not yet present in the dictionary, which string is produced according to the LZW algorithm?
π Explanation: The LZW decoder handles an unknown codeword by outputting the previous decoded string followed by the first character of that same string. This rule ensures the decoder can reconstruct the missing entry and continue processing correctly, making option A the accurate description.
Q3. After processing codewords 1 (B) and 0 (A), the dictionary contains 0:A, 1:B, 2:BA. The previous string is \A\. If the next codeword received is 5 (not in the dictionary), what string is output?
π Explanation: Because code 5 is absent, the decoder outputs the previous string \A\ concatenated with its first character, also \A\, resulting in \AA\. This follows the LZW rule for unknown codes, so option D correctly represents the produced string.
Q4. Comparing the LZW encoding of \ABABAB\ and \AAAAAA\, which statement is true about the length of the resulting codeword sequences?
π Explanation: The pattern \ABABAB\ generates new dictionary entries for the alternating pair, leading to more distinct codewords than the repetitive \AAAAAA\, which quickly reuses a single entry. Hence the encoded sequence for \ABABAB\ is longer, making option C correct.
Q5. If the initial dictionary is expanded from 2 symbols (A,B) to 4 symbols (A,B,C,D) for the same input text, how is the overall compression ratio likely to change?
π Explanation: Adding more symbols to the initial dictionary reduces the need to create new entries for short substrings, decreasing the number of codewords generated for a given text. Fewer codewords mean a larger output relative to the input, so the compression ratio typically worsens, corresponding to option B.
Q6. Which of the following best differentiates LZW from LZ78 when processing the repeated substring \AB\ in the text \ABABAB\?
π Explanation: LZW builds new entries by appending the first character of the current match to the previous string, so the pattern \AB\ is added only the first time it appears. LZ78, by contrast, creates a fresh entry for each occurrence. This distinction is captured by option A.
Q7. In an LZW implementation, when does the encoder typically reset the dictionary?
π Explanation: Most practical LZW encoders impose a fixed maximum dictionary size to bound memory usage. When this limit is reached, the dictionary is cleared and reβinitialized to the original entries, allowing encoding to continue. This reset behavior aligns with option C.
Q8. Given the encoded numeric sequence 1002163670 produced by LZW with alphabet {A,B}, what is the original text?
π Explanation: Decoding the sequence 1002163670 using the standard LZW steps for the twoβcharacter alphabet reconstructs the original message \BAABABBBAABBBBAA\. The other options do not match the pattern of dictionary expansions indicated by the codewords, making option D the correct reconstruction.
Q9. How does the length of each codeword in bits relate to the current size of the LZW dictionary?
π Explanation: As the dictionary grows, the number of distinct entries eventually surpasses a power of two (e.g., 2^n). At that point the encoder must allocate an extra bit to represent the larger set of codes, so the codeword length increments by one bit each time the dictionary size crosses such a threshold, which is described by option B.
Q10. If a BitTorrent client compresses its tracker request payload using LZW before sending, what is the primary effect on tracker communication?
π Explanation: Applying LZW compression shrinks the binary representation of the request data, meaning fewer bytes travel over the network. This reduction lets the client include more peer information within the same HTTP request size limit, improving efficiencyβexactly what option A states.
Q11. Using a fixed-size dictionary of 256 entries for LZW decoding of a large file, what is the impact on decoding speed compared to a dynamically growing dictionary?
π Explanation: When the dictionary size is capped at 256, entries can be stored in a simple array indexed by a single byte. This allows constantβtime access without needing to handle variableβlength structures, so decoding proceeds faster than with a dynamically expanding dictionary, matching option C.
Q12. During LZW encoding, if the current buffer holds the string \AB\ and the next input character is \A\, which new entry is added to the dictionary?
π Explanation: The encoder concatenates the current buffer \AB\ with the next character \A\ to form the new phrase \ABA\. However, the dictionary entry is recorded using the previous buffer plus the first character of the new phrase, resulting in the entry \BAA\ after the buffer shifts. Therefore option D correctly reflects the added entry.