×

Trending Technologies MCQs

eBPF MCQs (Multiple-Choice Questions)

eBPF (Extended Berkeley Packet Filter) is a technology that allows programs to run in a sandboxed environment within the Linux kernel. It enables developers and system administrators to extend kernel functionality, monitor system events, analyze network traffic, and implement security policies without modifying the kernel source code.

eBPF MCQs

eBPF is widely used in cloud-native infrastructure, observability, networking, performance monitoring, and security applications. It provides a programmable mechanism for interacting with kernel events through verified programs, maps, helper functions, and attachment points.

These eBPF MCQs cover fundamental and advanced concepts, including kernel architecture, bytecode, verification, maps, program types, hooks, tracing, networking, XDP, security, and performance monitoring. They are useful for Linux administrators, system programmers, DevOps engineers, cybersecurity professionals, and cloud-native developers.

List of eBPF MCQs

The following multiple-choice questions cover eBPF architecture, execution, development tools, kernel interaction, networking, observability, and practical use cases. Each question includes four options, the correct answer, and an explanation to help reinforce understanding.

1. What does eBPF stand for?

  1. Extended Berkeley Packet Filter
  2. Enhanced Binary Processing Framework
  3. External Berkeley Programming Function
  4. Extended Basic Processing Format

Answer: A) Extended Berkeley Packet Filter

Explanation:

eBPF stands for Extended Berkeley Packet Filter. It is a Linux kernel technology that allows verified programs to execute in a controlled environment and extend kernel functionality for networking, observability, security, and performance analysis.

2. What is the primary purpose of eBPF?

  1. To replace the Linux operating system
  2. To extend kernel functionality using sandboxed programs
  3. To create graphical user interfaces
  4. To manage relational database schemas

Answer: B) To extend kernel functionality using sandboxed programs

Explanation:

eBPF allows developers to execute specialized programs inside the Linux kernel under safety restrictions. These programs can observe system activity, process network packets, enforce security policies, and collect performance information.

3. Which operating system is most closely associated with eBPF?

  1. Windows
  2. macOS
  3. Linux
  4. DOS

Answer: C) Linux

Explanation:

eBPF is primarily associated with the Linux kernel, where it provides a programmable execution environment. Although related technologies and implementations exist elsewhere, Linux is the main platform for eBPF development and deployment.

4. Where do eBPF programs execute?

  1. Only in a web browser
  2. Inside the Linux kernel's eBPF execution environment
  3. Only in a relational database
  4. Inside a graphical desktop application

Answer: B) Inside the Linux kernel's eBPF execution environment

Explanation:

eBPF programs execute within the Linux kernel using a controlled virtual instruction set and runtime. The kernel verifies programs before allowing them to run, helping protect kernel stability and security.

5. What is the role of the eBPF verifier?

  1. To compile application source code into HTML
  2. To verify that eBPF programs satisfy safety requirements before execution
  3. To manage database transactions
  4. To encrypt all network traffic automatically

Answer: B) To verify that eBPF programs satisfy safety requirements before execution

Explanation:

The eBPF verifier analyzes programs before they are loaded into the kernel. It checks properties such as memory access, control flow, pointer usage, and other safety constraints to prevent unsafe kernel operations.

6. What is eBPF bytecode?

  1. A set of instructions executed by the eBPF virtual machine
  2. A database backup format
  3. A Linux graphical interface
  4. A network cable configuration

Answer: A) A set of instructions executed by the eBPF virtual machine

Explanation:

eBPF bytecode consists of instructions designed for the eBPF virtual instruction set. Programs are commonly compiled from C or other supported languages into eBPF bytecode before being loaded into the kernel.

7. Which programming language is commonly used to write eBPF programs?

  1. HTML
  2. CSS
  3. C
  4. SQL

Answer: C

Explanation:

C is commonly used to develop eBPF programs because it can be compiled into eBPF bytecode using suitable compiler toolchains. Other languages and frameworks also support eBPF development through specialized libraries and compilers.

8. Which compiler is commonly used to compile C-based eBPF programs?

  1. GCC only
  2. Clang/LLVM
  3. Java Compiler
  4. TypeScript Compiler

Answer: B) Clang/LLVM

Explanation:

Clang, which is part of the LLVM compiler infrastructure, is commonly used to compile C source code into eBPF bytecode. The resulting object file can then be loaded using an appropriate eBPF loader.

9. What is an eBPF map?

  1. A graphical representation of a Linux directory
  2. A data structure used to store and share information with eBPF programs
  3. A tool for compiling kernel modules
  4. A network routing protocol

Answer: B) A data structure used to store and share information with eBPF programs

Explanation:

eBPF maps are kernel-managed data structures that store information such as counters, configuration values, network statistics, and connection details. They allow eBPF programs and user-space applications to exchange data.

10. Which eBPF map type stores key-value pairs using a hash table?

  1. Array map
  2. Hash map
  3. Ring buffer
  4. Program array

Answer: B) Hash map

Explanation:

An eBPF hash map stores data as key-value pairs and uses hashing to locate entries. It is useful for storing information such as process statistics, network connection records, and event counters.

11. What is the purpose of an eBPF array map?

  1. To store elements using integer indexes
  2. To execute network packets automatically
  3. To compile C programs
  4. To manage Linux user accounts

Answer: A) To store elements using integer indexes

Explanation:

An array map stores a fixed number of elements that can be accessed using integer indexes. It is useful for counters, configuration values, and other data that can be organized by index.

12. What is the purpose of a ring buffer map in eBPF?

  1. To compile kernel source code
  2. To exchange event data efficiently between kernel-space programs and user-space applications
  3. To manage filesystem permissions
  4. To replace network interfaces

Answer: B) To exchange event data efficiently between kernel-space programs and user-space applications

Explanation:

The eBPF ring buffer provides a mechanism for transferring events from kernel space to user space. It is useful for sending monitoring events, tracing information, and security alerts to user-space applications.

13. What is a helper function in eBPF?

  1. A function provided by the kernel for supported operations in eBPF programs
  2. A function that automatically modifies application source code
  3. A database query executed by MySQL
  4. A shell command used only for file deletion

Answer: A) A function provided by the kernel for supported operations in eBPF programs

Explanation:

eBPF helper functions provide controlled access to kernel functionality. Depending on the program type and kernel support, helpers can perform operations such as map access, time retrieval, checksum calculation, and event output.

14. What is the purpose of an eBPF program type?

  1. To identify the context and operations supported by an eBPF program
  2. To define the programming language of the Linux kernel
  3. To specify the database storage engine
  4. To determine the desktop screen resolution

Answer: A) To identify the context and operations supported by an eBPF program

Explanation:

An eBPF program type determines the kind of kernel event or subsystem with which a program can interact. It also influences the available context fields, helper functions, and permitted operations.

15. What is a kprobe in eBPF?

  1. A mechanism for attaching programs to kernel function entry or return points
  2. A database monitoring application
  3. A Linux package manager
  4. A network encryption algorithm

Answer: A) A mechanism for attaching programs to kernel function entry or return points

Explanation:

Kprobes allow eBPF programs to observe selected kernel function execution points. They are useful for debugging, performance analysis, and monitoring kernel behavior without modifying the original kernel source code.

16. What is a uprobe in eBPF?

  1. A mechanism for attaching programs to selected user-space function locations
  2. A tool for managing Linux kernel modules
  3. A database indexing method
  4. A protocol for transferring files

Answer: A) A mechanism for attaching programs to selected user-space function locations

Explanation:

Uprobes allow eBPF programs to observe selected locations in user-space applications, such as function entry and return points. They are useful for analyzing application behavior and tracing function execution.

17. What is a tracepoint in eBPF?

  1. A stable instrumentation point exposed by the kernel for observing events
  2. A method for storing application images
  3. A type of relational database
  4. A Linux desktop theme

Answer: A) A stable instrumentation point exposed by the kernel for observing events

Explanation:

Tracepoints are predefined instrumentation locations in the Linux kernel. eBPF programs can attach to supported tracepoints to collect structured information about kernel events such as system calls, scheduling, and networking activity.

18. What is the difference between kprobes and tracepoints?

  1. Kprobes attach to selected kernel function locations, while tracepoints use predefined instrumentation points
  2. Kprobes work only in browsers, while tracepoints work only in databases
  3. Both are programming languages
  4. Tracepoints cannot be used for kernel monitoring

Answer: A) Kprobes attach to selected kernel function locations, while tracepoints use predefined instrumentation points

Explanation:

Kprobes can instrument selected kernel functions, whereas tracepoints are predefined event locations provided by the kernel. Tracepoints often offer more stable event interfaces, while kprobes provide flexibility for observing specific functions.

19. What is XDP in the context of eBPF?

  1. Extended Data Processing
  2. eXpress Data Path
  3. External Device Protocol
  4. Extended Development Platform

Answer: B) eXpress Data Path

Explanation:

XDP stands for eXpress Data Path. It provides a high-performance packet processing framework in Linux that allows eBPF programs to process network packets at an early stage in the receive path.

20. At which stage does native XDP typically process incoming packets?

  1. After the application has processed the packet
  2. At the earliest practical point in the network receive path, before normal kernel network stack processing
  3. Only after a database transaction completes
  4. During filesystem initialization

Answer: B) At the earliest practical point in the network receive path, before normal kernel network stack processing

Explanation:

Native XDP executes an eBPF program in the driver receive path before the packet enters the regular kernel networking stack. This early processing enables fast packet filtering, forwarding, and other network operations.

21. Which XDP action indicates that a packet should be dropped?

  1. XDP_PASS
  2. XDP_TX
  3. XDP_DROP
  4. XDP_REDIRECT

Answer: C) XDP_DROP

Explanation:

XDP_DROP tells the kernel to discard the packet. It is commonly used for packet filtering, security enforcement, and blocking unwanted network traffic at an early processing stage.

22. What does XDP_PASS do?

  1. It drops the packet immediately
  2. It allows the packet to continue through the normal kernel network stack
  3. It redirects the packet to a different interface automatically
  4. It terminates the network interface

Answer: B) It allows the packet to continue through the normal kernel network stack

Explanation:

XDP_PASS allows a packet to proceed through the regular kernel networking stack after XDP processing. It is useful when a program inspects a packet but does not need to discard or redirect it.

23. What does XDP_TX do?

  1. It transmits the packet back through the interface on which it was received
  2. It deletes the packet from memory permanently
  3. It sends the packet to a database
  4. It blocks all incoming network connections

Answer: A) It transmits the packet back through the interface on which it was received

Explanation:

XDP_TX instructs the XDP processing system to transmit the packet back out through the receiving network interface. It can be used in packet response and forwarding scenarios.

24. What is the purpose of XDP_REDIRECT?

  1. To redirect a packet to another supported destination, such as a network interface or CPU
  2. To delete all network routes
  3. To restart the Linux kernel
  4. To convert packets into database records

Answer: A) To redirect a packet to another supported destination, such as a network interface or CPU

Explanation:

XDP_REDIRECT sends a packet to a selected supported destination. It is useful for high-performance packet forwarding, load balancing, and redirecting packets to other processing components.

25. Which Linux networking technology is commonly used with eBPF for high-performance packet processing?

  1. XDP
  2. SMTP
  3. FTP
  4. DHCP

Answer: A) XDP

Explanation:

XDP is a Linux networking technology built around eBPF programs. It enables early packet processing and is commonly used for filtering, load balancing, denial-of-service mitigation, and high-performance networking.

26. What is the purpose of TC-BPF?

  1. To attach eBPF programs to Linux traffic control hooks for packet processing
  2. To manage application user interfaces
  3. To compile database queries
  4. To monitor desktop application licenses

Answer: A) To attach eBPF programs to Linux traffic control hooks for packet processing

Explanation:

TC-BPF allows eBPF programs to attach to Linux traffic control ingress and egress hooks. It can be used for packet filtering, traffic classification, shaping-related processing, and network policy enforcement.

27. What is the purpose of eBPF in observability?

  1. To collect system and application telemetry with low-level kernel visibility
  2. To replace all monitoring dashboards
  3. To create application user accounts
  4. To store source code in a database

Answer: A) To collect system and application telemetry with low-level kernel visibility

Explanation:

eBPF enables observability tools to collect information about system calls, network activity, process execution, and other kernel events. This provides detailed visibility into system and application behavior.

28. Which tool is commonly used to inspect and troubleshoot eBPF programs?

  1. bpftool
  2. Photoshop
  3. Microsoft Word
  4. FileZilla

Answer: A) bpftool

Explanation:

bpftool is a command-line utility for inspecting and managing eBPF programs, maps, links, and related kernel objects. It is useful for debugging and understanding the state of eBPF components.

29. What is BCC in eBPF development?

  1. BPF Compiler Collection
  2. Binary Control Configuration
  3. Berkeley Computing Container
  4. Basic Kernel Compiler

Answer: A) BPF Compiler Collection

Explanation:

BCC stands for BPF Compiler Collection. It is a toolkit that provides libraries and tools for creating and running eBPF programs, particularly for system tracing and performance analysis.

30. What is libbpf?

  1. A user-space library for loading and managing eBPF programs
  2. A Linux filesystem format
  3. A network encryption protocol
  4. A database management system

Answer: A) A user-space library for loading and managing eBPF programs

Explanation:

libbpf is a library that provides APIs for loading, verifying through kernel interfaces, attaching, and managing eBPF programs and maps. It is commonly used with CO-RE-based eBPF applications.

31. What does CO-RE stand for in eBPF?

  1. Compile Once - Run Everywhere
  2. Code Operation - Runtime Execution
  3. Control Output - Resource Extension
  4. Compiler Optimization - Runtime Engine

Answer: A) Compile Once - Run Everywhere

Explanation:

CO-RE stands for Compile Once - Run Everywhere. It is an approach that helps eBPF programs remain portable across compatible Linux kernel versions by adapting to differences in kernel data structures at load time.

32. What is BTF in eBPF?

  1. BPF Type Format
  2. Basic Transfer Function
  3. Binary Table Framework
  4. Berkeley Traffic Filter

Answer: A) BPF Type Format

Explanation:

BTF stands for BPF Type Format. It provides type information about kernel and eBPF data structures. BTF supports features such as CO-RE relocations, debugging, and improved inspection of eBPF objects.

33. What is the purpose of a BPF trampoline?

  1. To support efficient attachment of eBPF programs to certain kernel or user-space functions
  2. To compress network packets
  3. To manage database replication
  4. To create virtual machines

Answer: A) To support efficient attachment of eBPF programs to certain kernel or user-space functions

Explanation:

BPF trampolines provide an efficient mechanism for attaching programs to supported function entry and exit points. They are used by mechanisms such as fentry, fexit, and other tracing-related attachments.

34. What are fentry and fexit programs used for?

  1. Tracing supported function entry and exit events
  2. Managing application file permissions
  3. Creating database indexes
  4. Encrypting network packets automatically

Answer: A) Tracing supported function entry and exit events

Explanation:

fentry and fexit are eBPF tracing attachment types that allow programs to observe supported function calls. They provide information about function execution and are useful for performance analysis and debugging.

35. What is the purpose of an eBPF link?

  1. To represent and manage an attachment between an eBPF program and a hook
  2. To connect two database tables
  3. To create a website hyperlink
  4. To transfer files through FTP

Answer: A) To represent and manage an attachment between an eBPF program and a hook

Explanation:

An eBPF link represents the attachment of an eBPF program to a supported kernel or subsystem hook. It provides a way to manage the lifetime of the attachment independently of the process that created it.

36. What is a tail call in eBPF?

  1. A mechanism that transfers execution from one eBPF program to another
  2. A method for deleting the last database record
  3. A technique for compressing application logs
  4. A Linux command for shutting down a server

Answer: A) A mechanism that transfers execution from one eBPF program to another

Explanation:

A tail call allows one eBPF program to transfer execution to another program through a program array map. It supports modular program design and can help divide complex processing into smaller components.

37. What is the purpose of a per-CPU map in eBPF?

  1. To maintain separate map values for individual CPUs
  2. To store data only on external disks
  3. To disable CPU scheduling
  4. To create network interfaces automatically

Answer: A) To maintain separate map values for individual CPUs

Explanation:

Per-CPU maps maintain separate values for each CPU. They can reduce contention when multiple CPUs update statistics or counters concurrently, although applications must account for per-CPU values when aggregating results.

38. What is the purpose of the eBPF JIT compiler?

  1. To translate eBPF bytecode into native machine instructions
  2. To convert HTML into CSS
  3. To generate database backups
  4. To manage Linux user permissions

Answer: A) To translate eBPF bytecode into native machine instructions

Explanation:

The eBPF Just-In-Time (JIT) compiler translates eBPF bytecode into native machine instructions for the host architecture. This can improve execution performance compared with interpreting the instructions.

39. What is the purpose of the eBPF instruction limit?

  1. To restrict program execution complexity and support safe verification
  2. To limit the number of Linux users
  3. To restrict the number of installed applications
  4. To control network cable length

Answer: A) To restrict program execution complexity and support safe verification

Explanation:

The kernel applies verifier constraints to eBPF programs, including limits and complexity checks related to instruction processing. These restrictions help ensure that programs can be safely analyzed and do not execute without acceptable bounds.

40. What is the role of capabilities and permissions when loading eBPF programs?

  1. They determine whether a process is authorized to perform privileged eBPF operations
  2. They automatically optimize application source code
  3. They control database query syntax
  4. They determine monitor screen resolution

Answer: A) They determine whether a process is authorized to perform privileged eBPF operations

Explanation:

Loading and attaching eBPF programs may require specific Linux privileges or capabilities, depending on the operation, program type, kernel version, and system configuration. These controls help restrict access to powerful kernel functionality.

41. What is Cilium in the context of eBPF?

  1. A cloud-native networking, security, and observability platform that uses eBPF
  2. A relational database management system
  3. A programming language for frontend development
  4. A desktop image editor

Answer: A) A cloud-native networking, security, and observability platform that uses eBPF

Explanation:

Cilium uses eBPF to provide networking, network security, and observability capabilities for cloud-native environments. It is commonly used in Kubernetes clusters to manage connectivity and enforce network policies.

42. How does eBPF help implement network security policies?

  1. By inspecting and controlling network traffic at supported kernel hooks
  2. By removing all network interfaces
  3. By disabling application authentication
  4. By replacing every network protocol

Answer: A) By inspecting and controlling network traffic at supported kernel hooks

Explanation:

eBPF programs can inspect packets and network metadata at supported attachment points. They can enforce filtering and access policies, monitor connections, and support security tools that operate close to the kernel networking stack.

43. What is one advantage of using eBPF for performance monitoring?

  1. It requires modifying every application source file
  2. It provides low-level visibility into kernel and system events with targeted instrumentation
  3. It disables all system calls
  4. It replaces the Linux scheduler

Answer: B) It provides low-level visibility into kernel and system events with targeted instrumentation

Explanation:

eBPF provides detailed visibility into system behavior through targeted instrumentation. It can help monitor CPU scheduling, system calls, network activity, and other kernel events without requiring extensive modifications to application code.

44. What is an eBPF-based security monitoring tool designed to detect?

  1. Suspicious system activity and potentially malicious behavior
  2. Changes in desktop wallpaper
  3. Incorrect spreadsheet formatting
  4. Unused website images only

Answer: A) Suspicious system activity and potentially malicious behavior

Explanation:

eBPF-based security tools can monitor events such as process execution, file access, network connections, and system calls. These events can help identify suspicious activity and support runtime threat detection.

45. What is Tetragon?

  1. An eBPF-based security observability and runtime enforcement tool
  2. A database query optimizer
  3. A programming language for mobile applications
  4. A Linux desktop environment

Answer: A) An eBPF-based security observability and runtime enforcement tool

Explanation:

Tetragon is an eBPF-based security tool associated with the Cilium ecosystem. It provides runtime observability and enforcement capabilities by monitoring process, system, and network activity.

46. What is one limitation of eBPF?

  1. It cannot interact with kernel events
  2. It requires all applications to use Java
  3. Its capabilities depend on kernel support, program type restrictions, and verifier constraints
  4. It works only with relational databases

Answer: C) Its capabilities depend on kernel support, program type restrictions, and verifier constraints

Explanation:

eBPF provides powerful kernel programmability, but not every operation is allowed. Supported features vary across kernel versions and program types, while verifier rules and system permissions impose additional constraints.

47. What is the purpose of eBPF CO-RE relocations?

  1. To adapt references to kernel data structures when their layouts differ across supported kernels
  2. To move database files between servers
  3. To compress eBPF bytecode into images
  4. To change the Linux kernel programming language

Answer: A) To adapt references to kernel data structures when their layouts differ across supported kernels

Explanation:

CO-RE relocations use type information, commonly provided through BTF, to adjust references to kernel data structures at load time. This improves portability across compatible kernel versions with different structure layouts.

48. Which statement best describes the relationship between eBPF and traditional kernel modules?

  1. Both use exactly the same unrestricted execution model
  2. eBPF provides a more constrained and verifier-checked execution environment than traditional kernel modules
  3. Traditional kernel modules cannot interact with the kernel
  4. eBPF always requires rebuilding the Linux kernel

Answer: B) eBPF provides a more constrained and verifier-checked execution environment than traditional kernel modules

Explanation:

Traditional kernel modules can execute kernel code with broad privileges and can introduce serious stability risks if they contain errors. eBPF programs operate under verifier-enforced restrictions, providing a more controlled way to extend kernel functionality.

49. Which of the following is a major use case of eBPF in cloud-native environments?

  1. Designing website logos
  2. Replacing container images with database tables
  3. Managing office document formatting
  4. Providing Kubernetes networking, security, and observability

Answer: D) Providing Kubernetes networking, security, and observability

Explanation:

eBPF is widely used in cloud-native infrastructure to implement networking, security, and observability features. Platforms such as Cilium use eBPF to support Kubernetes connectivity, network policy enforcement, and visibility into service communication.

50. An eBPF-based monitoring program processes 80,000 network packets per second before optimization. After optimization, it processes 120,000 packets per second. What is the percentage increase in packet-processing throughput?

  1. 25%
  2. 40%
  3. 50%
  4. 75%

Answer: C) 50%

Explanation:

The percentage increase is calculated using the following formula:

Percentage Increase = ((New Value - Original Value) / Original Value) × 100

Substituting the given values:

= ((120,000 - 80,000) / 80,000) × 100

= (40,000 / 80,000) × 100

= 0.5 × 100

= 50%

Therefore, the eBPF-based monitoring program achieves a 50% increase in packet-processing throughput after optimization.

Comments and Discussions!

Load comments ↻



Copyright © 2026 www.includehelp.com. All rights reserved.