Your country

Tools that support it use your country for local currency, number formats, units and paper size. Your choice is saved only in this browser.

Type a name or a two-letter code. Use the up and down arrow keys to move through the countries, Enter to choose one and Escape to close.

Computer Networks Module 3

Data link layer: framing and error detection interview questions

Interview questions on “Data link layer: framing and error detection”: warm-ups, then what each harder question tests and how a good answer starts.

10 questions: 4 warm-ups and 6 with model answers · Levels: Fresher to staff

Warm-up questions

Short questions with short answers, each answered in full.

  1. Fresher

    The physical layer already delivers bits. Why does a link layer still need framing?

    Answered in the lesson Link-layer services and framing

  2. Fresher

    What does a code's minimum Hamming distance tell you?

    Answered in the lesson Parity, checksums and Hamming codes

  3. Fresher to mid

    Why does a receiver add up an IPv4 header, checksum included, and expect 0xFFFF?

    Answered in the lesson Parity, checksums and Hamming codes

  4. Fresher

    Why does the sender append r zero bits before dividing by the generator?

    Appending r zeros multiplies the message by x^r, which shifts it left and leaves r empty places at the end. The remainder of that division, which has at most r bits, then fills those places: adding the remainder (XOR) to the shifted message makes the whole codeword an exact multiple of the generator, without touching a single message bit. The receiver checks precisely that: a codeword that leaves a zero remainder is accepted.

    From the lesson Cyclic redundancy check (CRC) step by step

Questions with model answers

What each question tests, the first step of a good answer and the follow-ups to expect.

  1. Fresher to mid

    Your serial protocol frames messages with PPP-style byte stuffing, and clients choose their own payload bytes. One client starts sending payloads made only of 0x7E bytes. What happens to frame sizes and link time, and how do you design the receiver for it?

    What it tests
    Whether the worst case of byte stuffing is known and computed, and whether buffers and time limits are sized for hostile input rather than for average data.
    First step
    Work out the worst case first: every 0x7E or 0x7D in a payload goes out as two bytes, so an n-byte payload of them takes 2n + 2 bytes with the two flags, against about 1.008n + 2 for random data. Then size every limit in bytes on the link, not in payload bytes.
    Follow-ups

    From the lesson Link-layer services and framing

    Model answer, Pro. Model answers open with any pass; prices are in the notice on this page.

    Opening the model answers with your pass…

    Model answers open with any MySmartCoPilot pass.

    • Pro pass · 1 week₹79$2.99
    • 30 days₹179$5.99
    • 1 year₹1,699$45

    One payment; a pass never renews. The price shown is the total you pay: no fees or charges are added at checkout.

    It also opens every other in-depth part in Learn and every Pro tool. Sales are final, except where the law gives you a right to withdraw, for example in the EU and the UK (refund policy).

    In the answer:

    • Model answer
    • Follow-up answers
    • Common mistakes
    • Rubric
    • Variants
    • about 3 minutes
  2. Mid to senior

    A sensor sends 40-byte readings to a gateway over a noisy UART at 9,600 bit/s, and the gateway may start listening in the middle of a reading. Design the framing. How does the gateway find the first good reading, and what does one corrupted byte cost?

    What it tests
    Choosing a framing method for a byte stream, resynchronising after damage, pairing framing with a CRC, and reasoning about the link with numbers.
    First step
    Start from the two failures the design must survive: joining mid-stream and damaged bytes. Both need a marker the receiver can hunt for, so use a flag byte with escaping, plus a CRC over every reading, and reject anything that fails it. A bare length prefix cannot resynchronise.
    Follow-ups

    From the lesson Link-layer services and framing

    Model answer, Pro.

    In the answer:

    • Model answer
    • Follow-up answers
    • Common mistakes
    • Rubric
    • Variants
    • about 4 minutes
  3. Mid to senior

    A router decrements the TTL of every IPv4 packet it forwards. Show how it can update the header checksum from the change alone, and explain what goes wrong with the obvious shortcut HC' = HC + m + ~m'.

    What it tests
    Ones' complement arithmetic and its two zeros, the formula of RFC 1624 against the older one of RFC 1141, and how receivers verify a checksum.
    First step
    Write the checksum as the complement of a ones' complement sum, so that changing one word from m to m' changes the sum by m' − m. Undo the complement, apply the change, complement again: HC' = ~(~HC + ~m + m'). Then try it on a change that makes the new sum 0xFFFF.
    Follow-ups

    From the lesson Parity, checksums and Hamming codes

    Model answer, Pro.

    In the answer:

    • Model answer
    • Follow-up answers
    • Common mistakes
    • Rubric
    • Variants
    • about 3 minutes
  4. Mid to staff

    An application stores 64 KB records, each with a 16-bit Internet checksum, and corrupted records occasionally pass the check. Which corruptions can that checksum miss, roughly how often, and what would you replace it with?

    What it tests
    The blind spots of the Internet checksum, the escape rate of a 16-bit check, what a CRC adds, and when only a keyed MAC will do.
    First step
    List what a sum of words cannot see: words that swap places or whole blocks written in the wrong order, a 0x0000 word turning into 0xFFFF, and pairs of flips that cancel. Then estimate how often random damage escapes a 16-bit check, about 1 in 65,536, and compare that with what the data needs.
    Follow-ups

    From the lesson Parity, checksums and Hamming codes

    Model answer, Pro.

    In the answer:

    • Model answer
    • Follow-up answers
    • Common mistakes
    • Rubric
    • Variants
    • about 4 minutes
  5. Fresher to mid

    Your CRC-32 code gives a different value from zlib.crc32 on every input, including b"123456789". How do you find the bug quickly?

    What it tests
    The parameters that define a CRC (width, generator, starting value, reflection, final XOR), the use of check values, and debugging one hypothesis at a time.
    First step
    Test two inputs before reading any code: b"123456789" must give the check value 0xCBF43926 and an empty input must give 0. The wrong values themselves point at the parameter: compare them with what each likely mistake produces, then fix one parameter at a time.
    Follow-ups

    From the lesson Cyclic redundancy check (CRC) step by step

    Model answer, Pro.

    In the answer:

    • Model answer
    • Follow-up answers
    • Common mistakes
    • Rubric
    • Variants
    • about 3 minutes

All Computer Networks interview questions · The Computer Networks track

Quick answers and tool search

Type to search tools or to get a quick answer, for example 18% of 2500. Use the up and down arrow keys to move through the results, Enter to choose, and Escape to close.