PCAP • Practice Test 4 — 25 Questions
Free PCAP practice test 4 — 25 questions with explanations. No signup required.
A network engineer processes a configuration file containing MAC addresses in the format 'aa:bb:cc:dd:ee:ff'. They need to convert each MAC address into a 6-byte bytes object for use in packet crafting. The current code is: mac_bytes = bytes([int(x, 16) for x in mac_str.split(':')]). This works correctly, but they need to process thousands of MAC addresses and want to optimize performance. They also need to handle invalid MAC addresses (e.g., non-hex characters) without crashing. Which of the following approaches is the most efficient and robust?
Choose an answer to begin — your selection is scored in the full session.
25 questions · instant feedback and full explanations after every question.