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.

MicroPython for Microcontrollers Module 10

Networking: Wi-Fi, sockets, HTTP, MQTT, TLS and radios interview questions

Interview questions on “Networking: Wi-Fi, sockets, HTTP, MQTT, TLS and radios”: warm-ups, then what each harder question tests and how a good answer starts.

6 questions: 1 warm-up and 5 with model answers · Levels: Fresher to senior

Warm-up questions

Short questions with short answers, each answered in full.

  1. Fresher

    What does wlan.isconnected() tell you on a Pico W, and why is a loop that waits for it not enough?

    Answered in the lesson Connect to Wi-Fi on Pico W and ESP32

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

    After a power cut on a farm, 9 of 40 Pico W sensors stay offline until someone power-cycles them. Their boot code waits while wlan.status() == network.STAT_CONNECTING and calls machine.reset() for any other status. The last log line before each reset reads status 2. What is happening, and what do you change?

    What it tests
    Reading the Pico W's link states, how a router behaves after an outage, and replacing a status test with a deadline and a recovery that never needs a person.
    First step
    Status 2 on a Pico W is the driver's state for joined with no address yet. After a power cut the access point comes up before its DHCP server answers, so boards join and then wait. The loop reads that wait as a failure and resets, and each reset starts the join again from nothing.
    Follow-ups

    From the lesson Connect to Wi-Fi on Pico W and ESP32

    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 building's router restarts every night. Its 200 ESP32 boards retry every 500 ms with no limit, the router logs thousands of join attempts a minute when it returns, and some boards take 20 minutes to rejoin. Design the reconnect policy, with numbers.

    What it tests
    A deadline per try, a capped exponential back-off with jitter, resetting after a success, and keeping the port's own retries under the program's control.
    First step
    Count the load first: 200 boards trying every 0.5 s is 400 joins a second aimed at a router that is still starting. Then give each try a deadline of about 10 s, wait 2, 4, 8 s and so on up to 60 s between tries, add a random share to each wait, and reset the wait after a success.
    Follow-ups

    From the lesson Connect to Wi-Fi on Pico W and ESP32

    Model answer, Pro.

    In the answer:

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

    An ESP32 opens a gate when it receives the ESP-NOW frame b"open" from a remote button. Explain how someone who recorded one frame could open it again, and design the frame and the receiver's checks so that only a fresh command from the right button works.

    What it tests
    Telling authentication from freshness, a truncated HMAC with a per-device key, a counter that survives reboots, and what ESP-NOW's own encryption does and does not give.
    First step
    Separate two questions: who made the frame, and is it new. A fixed command answers neither, so add a counter and a tag of HMAC-SHA256 with the button's own key, and make the receiver refuse any counter not above the last one it accepted.
    Follow-ups

    From the lesson Bluetooth LE with aioble, and ESP-NOW

    Model answer, Pro.

    In the answer:

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

    A sensor sends its readings over ESP-NOW, and every send() returns True, yet the gateway's database is missing about a third of them, mostly after the sensor wakes from sleep and sends its backlog. What is going on, and what do you change?

    What it tests
    What send()'s True means, the receive buffer and its documented drops, pacing through answers from the receiving program, and testing the fix without radios.
    First step
    Read what True means: a radio on the same channel acknowledged the frame, which says nothing about the program on the gateway. Then follow a frame from that radio to the program, for a backlog that arrives in a burst.
    Follow-ups

    From the lesson Bluetooth LE with aioble, and ESP-NOW

    Model answer, Pro.

    In the answer:

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

    A coin-cell Bluetooth LE thermometer built with aioble lasts weeks instead of the months planned. It notifies the temperature as text, every second. Which parts of the radio design would you change, and how do you check each change without guessing?

    What it tests
    Knowing what costs radio time in Bluetooth LE, compact standard encodings, notifying on change, advertising choices, and separating what a fake can test from what needs a meter.
    First step
    Count what goes over the air: a notification every second, in text, is far more traffic than a reading needs. Send the standard Temperature characteristic, two bytes, and notify only when the value changes by a set step, so the radio is idle most of the time.
    Follow-ups

    From the lesson Bluetooth LE with aioble, and ESP-NOW

    Model answer, Pro.

    In the answer:

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

All MicroPython for Microcontrollers interview questions · The MicroPython for Microcontrollers 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.