Author: Khushi

  • A $20 ESP32-S3 Scanner Turns Small Objects Into 3D Meshes—Here’s the Trick

    A $20 ESP32-S3 Scanner Turns Small Objects Into 3D Meshes—Here’s the Trick

    A maker has turned a tiny ESP32-S3 board into a handheld 3D-scanning proof of concept—using a camera, a tracking target and geometry algorithms rather than a conventional depth camera. The striking idea is not that a microcontroller has become a professional scanner; it is how carefully the project narrows the problem.

    CircuitDigest’s October 2026 coverage of the creator’s project describes a Seeed Studio XIAO ESP32-S3 paired with a round-screen expansion. The report says the hardware cost is roughly $20, but that figure is the project coverage’s estimate, not a verified shopping total for every region or bill of materials.

    How can a small MCU reconstruct a shape?

    The scanner uses fiducial markers on a tracking target to estimate the camera’s position as the operator moves around an object. Software then combines multiple views using space carving: a 3D voxel grid is tested against what each camera image could see, and inconsistent regions are removed. A marching-cubes lookup table converts the remaining voxel surface into a triangle mesh.

    That pipeline trades generality for a constrained setup. The camera must observe the markers reliably, the object needs enough views, and the reconstruction code has to fit the board’s memory and processing budget. The project reportedly uses a low-resolution live preview for the display while capturing higher-resolution frames for the heavier processing stage.

    What the project report says—and what it doesn’t prove

    The coverage reports approximately 1mm structural resolution and says the creator targets small objects such as trinkets or field specimens. Treat those as project-reported results: we have not independently tested the scanner, reproduced the build or verified that resolution across different objects.

    A small demo is also not a substitute for calibrated metrology. Shiny, transparent, featureless or moving surfaces can be difficult for camera-based reconstruction. Lighting, tracking accuracy, camera calibration, surface texture and the number of viewpoints all affect the result. A mesh that looks convincing on screen may still be unsuitable for dimension-critical parts.

    Why it is still a useful embedded-computing story

    The project illustrates a broader design lesson: embedded vision improves when the problem is divided into manageable stages. A low-cost board does not need to run a giant neural model to do useful computer vision. In this case, pose estimation and classical geometry do much of the work, while a display offers immediate feedback.

    For a student or maker who wants to reproduce the idea, start by studying the creator’s original post, bill of materials and source code before buying parts. Validate camera capture, marker tracking and memory use separately. Then test a simple object under controlled light, and record the measured dimensions against a known reference. Do not infer that every XIAO ESP32-S3 kit includes the same display, camera or software.

    Bottom line: The reported scanner is a clever low-cost proof of concept, not a ready-made replacement for photogrammetry apps or industrial scanners. Its real hook is the engineering: constrained capture, tracking markers and efficient 3D reconstruction on a very small computer.

    Sources: Original ESP32 object-scanner project shared by its creator; CircuitDigest project coverage; Seeed Studio XIAO ESP32-S3 documentation.

    Featured photo: Illustrative photo of a separate handheld 3D mapping scanner by CSIRO; it is not the ESP32-S3 DIY project pictured in the source. Photo via Wikimedia Commons, licensed under CC BY 3.0. The image was cropped and resized for this article.

  • Your ESP32 Deep-Sleep Battery Project May Be Wasting Power Here

    Your ESP32 Deep-Sleep Battery Project May Be Wasting Power Here

    Your ESP32 sketch may call deep sleep and still drain a battery far sooner than expected. The usual reason is that “the chip is asleep” and “the whole board is using almost no current” are not the same thing.

    In deep sleep, the ESP32 shuts down or clocks off parts of the chip, and wake-up sources can restart the application. But a development board also has a voltage regulator, USB-to-serial chip, power LED and sometimes sensors or displays. Any of those can draw current while the MCU sleeps. A sensor left powered or a network connection that takes longer than expected can dominate the average.

    Measure at the battery, not just in the datasheet

    Start by measuring current in series with the actual battery supply, with the exact board, regulator, sensors and firmware you intend to use. Capture both sleep current and the complete active cycle: boot, sensor warm-up, Wi-Fi association, transmission, retries and return to sleep. A multimeter that averages slowly can miss short current peaks; use an instrument or logger suited to the time scale and current range.

    Record the voltage and current over time. Then estimate average current using the full period, not just the low point between wake-ups. A current measurement taken directly at a bare module will not predict a finished product powered through a different regulator.

    A worked estimate—and its limits

    Suppose a project draws 100mA for two seconds once per minute and 10µA during the remaining 58 seconds. The simplified average is about 3.34mA: (100mA × 2/60) + (0.01mA × 58/60). A 2,000mAh battery divided by 3.34mA gives roughly 25 days in an ideal calculation.

    That is a planning estimate, not a runtime promise. It ignores regulator losses, battery capacity at the chosen load and temperature, self-discharge, Wi-Fi retries, startup variation and aging. Measure your own duty cycle and leave margin; battery chemistry and voltage conversion affect usable energy.

    Five places to look for hidden drain

    • Power LED: disable or remove it only if the board design permits and you understand the modification.
    • USB-to-serial interface: some dev boards keep this circuitry powered continuously.
    • Regulator quiescent current: a regulator can consume meaningful current even when the load is tiny; inspect its datasheet and measure the board.
    • Peripherals: switch sensors, displays and pull-up circuits off when appropriate, or choose parts with a real low-power mode.
    • Wake workload: reduce unnecessary scans and retries, send only the needed data, and verify that firmware actually enters sleep after every branch.

    Espressif’s ESP-IDF power-management documentation explains chip sleep modes and wake sources. The exact sleep current depends on chip configuration and board implementation, so do not apply a bare-chip value to a complete dev board without measurement.

    A practical test loop

    1. Measure baseline current with your board powered but the application idle.
    2. Measure deep-sleep current with the peripherals attached and then isolate them one by one.
    3. Log current through at least dozens of wake-and-send cycles, including weak Wi-Fi conditions.
    4. Estimate lifetime from average current and the battery’s usable capacity, then validate with a longer real-world run.

    Bottom line: Deep sleep is a firmware feature, not a battery-life guarantee. Measure the whole power path and the complete duty cycle before changing batteries or promising a service interval.

    Sources: ESP-IDF low-power mode overview; ESP-IDF sleep modes and wake-up sources.

    Featured photo: Illustrative wireless temperature-sensor prototype by Micah Elizabeth Scott. Photo via Wikimedia Commons, licensed under CC BY-SA 2.0. The image was cropped and resized for this article.

  • ESP32-C5 Adds 5GHz Wi-Fi 6—but Will It Fix Your IoT Connection?

    ESP32-C5 Adds 5GHz Wi-Fi 6—but Will It Fix Your IoT Connection?

    If your IoT device struggles on a crowded 2.4GHz network, the ESP32-C5 has an unusual feature for this family: dual-band Wi-Fi 6, including both 2.4GHz and 5GHz. But the extra band does not automatically mean better range, lower power or faster real-world data in every room.

    Espressif lists the ESP32-C5 as a single-core RISC-V MCU running up to 240MHz, with 2.4GHz and 5GHz Wi-Fi 6, Bluetooth LE and 802.15.4 connectivity for protocols such as Thread and Zigbee. The chip has been in mass production since May 2025; development boards and module implementations have since broadened the ways makers can evaluate it.

    When 5GHz can help

    Wi-Fi at 5GHz can avoid some interference and congestion in a busy 2.4GHz environment. It can be a useful choice for a powered device close to an access point that moves images, updates or other larger payloads. Wi-Fi 6 features such as OFDMA and Target Wake Time can also be useful in supported network and device configurations.

    Those capabilities are not a promise that every router will schedule every IoT endpoint more efficiently. Device, access point, firmware and traffic pattern all matter. An 802.11ax label alone does not guarantee a measurable improvement for a simple sensor sending a few bytes.

    The trade-off: 5GHz is not a range upgrade

    Higher-frequency 5GHz signals generally lose strength more quickly through distance and obstacles than 2.4GHz signals. A sensor at the edge of a home may stay connected more reliably on 2.4GHz, even if that band is more crowded. A tiny antenna, enclosure, board layout and installation location can matter as much as the chip name.

    Also check region-specific radio rules and the exact module’s antenna design. A chip’s capabilities do not override a finished product’s certification, antenna restrictions or local regulations.

    ESP32-C5 versus ESP32-C6: the simple difference

    The key networking distinction is that C5 adds 5GHz Wi-Fi; C6 is a 2.4GHz Wi-Fi 6 platform with 802.15.4 and Bluetooth LE. Both can be relevant to connected-device designs, so choose by actual radio environment and ecosystem requirements—not by assuming the larger model number is always the right buy.

    For a Matter-over-Thread endpoint, compare the board’s supported stack, antenna, power design and certification path. For a Wi-Fi camera or image uploader, check throughput and memory requirements. For a tiny battery sensor, measure energy per full wake-and-send cycle before prioritising peak Wi-Fi capability.

    Before you switch boards

    1. Map the real install location and test signal strength through the actual walls and enclosure.
    2. Measure packet loss and reconnect behaviour on both bands with the intended router.
    3. Compare application-level latency and energy per message, not a headline PHY rate.
    4. Confirm ESP-IDF, module, antenna and certification support for your production design.

    Bottom line: ESP32-C5 is a meaningful option when 5GHz compatibility solves a demonstrated network constraint. It will not cure poor antenna placement, weak router coverage or a device that needs a low-power protocol instead of Wi-Fi.

    Sources: Espressif ESP32-C5 specifications; Espressif mass-production announcement; ESP-IDF Wi-Fi driver guide.

    Featured photo: Illustrative ESP32 development board by Edwiyanto; this is not an ESP32-C5 board. Photo via Wikimedia Commons, licensed under CC BY-SA 4.0. The image was cropped and resized for this article.

  • Arduino UNO Q Has Two Brains—and That Changes What It Can Build

    Arduino UNO Q Has Two Brains—and That Changes What It Can Build

    Arduino’s UNO Q looks like a new board in the familiar UNO family, but its defining feature is that it combines two different kinds of processor: a Linux-capable Qualcomm Dragonwing QRB2210 microprocessor and an STM32U585 microcontroller for real-time control.

    That “two brains” design is more than a headline. It gives a project a place to run Linux applications, Python, networking and supported AI software, while a separate MCU handles direct hardware work such as reading sensors and controlling outputs. The two sides are designed to work together; they do not have identical timing or responsibilities.

    Why put a microcontroller beside Linux?

    A Linux computer is useful for tasks such as a web dashboard, image handling, file storage and network services. But a general-purpose OS can schedule other work at inconvenient times, so it is not the right place to assume hard, repeatable deadlines for every pin transition.

    The microcontroller side is designed for lower-level, time-sensitive I/O. In a practical machine-vision sorter, for example, the Linux processor might receive and analyse a camera frame, while the MCU controls a conveyor sensor and actuator sequence. The design still needs appropriate safety interlocks and timing validation; putting an MCU on the board does not make an unsafe mechanism safe by itself.

    What UNO Q brings, according to Arduino

    • Debian-capable Qualcomm Dragonwing QRB2210 MPU plus STM32U585 MCU
    • 2GB or 4GB RAM configurations and 16GB or 32GB eMMC storage, depending on model
    • Dual-band Wi-Fi 5 and Bluetooth 5.1
    • Arduino App Lab, with support for mixing sketches, Python and supported AI workflows
    • A USB-C connection, expansion headers and an LED matrix for local feedback

    Check the exact model’s storage and memory before ordering: the variants are not interchangeable merely because they share a board family name. Arduino’s official product page also documents power and accessory requirements.

    UNO Q versus a classic Arduino or a Raspberry Pi

    A classic UNO-class microcontroller board is simpler when the job is to read inputs, drive relays or LEDs, and run a compact control loop. It typically starts quickly and has no general-purpose Linux environment to maintain. A Raspberry Pi single-board computer is more natural when the project needs a full desktop or server-style Linux environment and abundant software packages. UNO Q is aimed at designs that need both styles of work in a single platform.

    That does not make UNO Q a drop-in replacement for every Pi or Arduino. Linux adds boot time, software updates and a larger power budget than a simple MCU project. The MCU and MPU also have different toolchains and memory spaces. Before committing, make a small proof of concept that covers the sensor interface, Linux-to-MCU communication, startup behaviour and failure recovery.

    Who should consider it?

    UNO Q is worth evaluating for edge-vision prototypes, connected instruments and interactive devices where Linux features and predictable low-level I/O belong together. For a battery sensor that wakes briefly, or a basic motor controller, the additional Linux system may be unnecessary. For a camera-only Linux project, a standard SBC may be simpler.

    Bottom line: UNO Q’s interesting proposition is not “Arduino but faster.” It is the separation of application-level computing from microcontroller-level control. Choose it when your project genuinely needs both, and test how the two processors share work before building the final product.

    Sources: Arduino UNO Q official product page; Arduino UNO Q documentation.

    Featured photo: Illustrative photo of a classic Arduino Uno board by JrawX; it is not the UNO Q. Photo via Wikimedia Commons, licensed under CC0. The image was cropped and resized for this article.

  • The Raspberry Pi 5 Can Run Local AI—but What 40 TOPS Actually Means

    The Raspberry Pi 5 Can Run Local AI—but What 40 TOPS Actually Means

    A Raspberry Pi 5 can now run selected generative-AI workloads locally with an add-on board—but the headline number, 40 TOPS, does not tell you how fast a chatbot will answer or whether every model will fit.

    Raspberry Pi’s AI HAT+ 2 pairs a Hailo-10H neural-network accelerator with 8GB of dedicated on-board memory and connects to Raspberry Pi 5 through PCIe. The manufacturer says it supports local generative-AI workloads, including selected language and vision-language models. That makes this a different kind of add-on from an accelerator aimed only at computer-vision pipelines.

    What does 40 TOPS mean?

    TOPS means trillions of operations per second. The 40 TOPS figure is specified for INT4 inference, a low-precision calculation format. It describes a peak accelerator capability under suitable conditions—not a promise of 40 trillion useful AI operations in every app, and not a direct measurement of tokens per second.

    Real performance depends on the model, quantisation, supported operators, memory movement, software runtime, input size and the rest of the system. A model that is not supported by the software stack cannot use the headline throughput. Likewise, the 8GB on the HAT is its own accelerator memory; it does not turn a 2GB Raspberry Pi 5 into an 10GB system for ordinary Linux applications.

    AI HAT+ versus AI HAT+ 2: check the workload

    The earlier AI HAT+ comes in 13-TOPS and 26-TOPS variants and is a strong fit for supported vision inference. AI HAT+ 2 is the model to investigate when your goal specifically includes generative workloads. Do not choose on TOPS alone: check the current Raspberry Pi documentation for supported models, setup steps and software versions, then confirm that the camera or other input device in your project is supported.

    That distinction matters for common maker projects. A camera that classifies a known set of objects is not the same workload as a local assistant that interprets a prompt and generates text. Both can involve neural networks, but they have different model, memory and software requirements.

    Before you spend money, ask these four questions

    • Is the exact model and runtime you want supported on the HAT+ 2 today?
    • Does your project need a local generative model, or would a smaller vision accelerator be enough?
    • Can the Pi 5, HAT, cooling and power supply fit your enclosure and thermal budget?
    • Have you compared on-device inference with a cloud service for privacy, network dependence, latency and total cost?

    Local inference can keep data on your device and continue when a network is unavailable, but it is not automatically more private or safer: applications still need secure updates, access controls and careful handling of prompts and stored data.

    The useful takeaway

    The AI HAT+ 2 is a specific accelerator for Raspberry Pi 5, not a magic upgrade that makes every AI model fast or compatible. The 40-TOPS figure is a useful hardware specification when compared on the same precision and workload; it is a poor substitute for checking supported models and application-level results.

    Sources: Raspberry Pi’s AI HAT+ 2 announcement; AI HAT+ 2 product information; Raspberry Pi AI HAT documentation.

    Featured photo: Photo of the Raspberry Pi AI HAT+ 2 packaging by Suyash Dwivedi. Photo via Wikimedia Commons, licensed under CC BY-SA 3.0. The image was cropped and resized for this article.

  • Raspberry Pi 4 and 5 2GB Prices Rose $12.50: What Builders Should Check

    Raspberry Pi 4 and 5 2GB Prices Rose $12.50: What Builders Should Check

    A Raspberry Pi that fit a project budget last month may now cost more. On October 1, 2026, Raspberry Pi raised the published US price of both 2GB Raspberry Pi 4 and 2GB Raspberry Pi 5 by $12.50. The bigger question for makers is not simply which board is cheaper—it is whether the project actually needs that memory, and what the full build will cost.

    Quick answer: The new published prices are $67.50 for the 2GB Pi 4 and $77.50 for the 2GB Pi 5. Raspberry Pi says the 1GB Pi 4 and Pi 5 and the 2GB Compute Module 4 and 5 are unchanged in this October announcement. These are manufacturer-published US prices; local reseller prices, tax, availability and shipping vary. For a new build, right-size RAM using measurements from your actual workload before choosing a lower-memory board.

    What changed on October 1?

    Board variantPublished US price after the changeOctober change
    Raspberry Pi 4, 2GB$67.50+$12.50
    Raspberry Pi 5, 2GB$77.50+$12.50
    Raspberry Pi 4, 1GBUnchanged in this announcementNo change
    Raspberry Pi 5, 1GBUnchanged in this announcementNo change
    Compute Module 4 and 5, 2GBUnchanged in this announcementNo change
    Figures reflect Raspberry Pi’s October 1, 2026 announcement, not a live quote from every shop or country.

    Raspberry Pi attributed the increase to rising memory costs and said it had previously held the 2GB board prices while raising prices on higher-memory products. The company also said these market conditions may ease in the future and that it hopes to reverse increases when they do. That is the manufacturer’s stated expectation, not a date or guarantee shoppers can plan around.

    The practical lesson: price RAM against your workload

    More RAM is not automatically better value, but a 1GB model is not a universal replacement for a 2GB one either. A headless sensor gateway with a small service set has different needs from a desktop, browser-based dashboard, camera pipeline, container stack or local AI workload. The right choice depends on the operating system, services, libraries, data buffers and peak load—not just the label on the board.

    Before changing a bill of materials, test the real application on the target configuration. Measure memory during startup and the busiest expected workload, including camera or network bursts. On Raspberry Pi OS, free -h and cat /proc/meminfo give a quick view of available and used memory; /usr/bin/time -v your-command can report peak resident memory for a process. These are diagnostic starting points, not substitutes for testing the complete system over time.

    • Include the OS, background services, logging, cache and peak application buffers in the test.
    • Watch for out-of-memory events, slowdowns and sustained swapping; a board that boots can still fail under a realistic workload.
    • Leave measured headroom for updates and foreseeable feature changes, but avoid paying for capacity the product cannot use.
    • Repeat tests after changing board revision, software stack or peripherals; the board-only memory number is not the whole system budget.

    When should a builder choose Pi 4, Pi 5 or a Compute Module?

    Do not switch from Pi 5 to Pi 4 solely to save the $10 difference between the announced 2GB prices. Compare the performance and interfaces your design actually depends on, then price the complete build: board, storage, power supply, cooling, enclosure, carrier board and shipping. A cheaper board can make the finished product more expensive if it needs adapters or extra engineering work.

    For an embedded product or classroom fleet, the price increase is also a prompt to recheck purchasing assumptions. Update quotations and per-unit BOMs, confirm the exact memory variant with your reseller, and retest any proposed substitute before ordering in volume. Compute Module products have different integration requirements; the fact that the 2GB CM4 and CM5 were unchanged in this particular notice does not mean every configuration or carrier costs the same.

    If your project only needs basic I/O or a compact controller, compare an MCU or Pico-class design as well as another Linux SBC. They are not drop-in Raspberry Pi replacements: operating system, networking, storage, application code and development effort differ. The right comparison is total project cost and capability, not just the cheapest board number.

    Buying advice for readers outside the US

    The $67.50 and $77.50 figures are the published US prices in Raspberry Pi’s announcement. They do not tell you the checkout total in India, Europe or elsewhere. Taxes, currency conversion, reseller pricing and stock can change the local price. Check an authorised Raspberry Pi reseller in your region, compare the exact memory variant and included accessories, and be cautious of listings with unusually high markups or unclear product descriptions.

    Bottom line: The October increase is real, but it does not automatically mean you should buy immediately, pay for more RAM, or abandon an existing design. Measure the workload, compare the complete system cost and validate any hardware change before committing.

    Useful next reads

    If you are setting up a new board, see our Raspberry Pi Imager guide. For a camera-and-sensor project, our Raspberry Pi object-detection project is a practical starting point.

    Sources and update note

    We checked the manufacturer announcements on October 23, 2026. Prices and availability can change; check the current local listing before purchasing.

    Featured image: Photo of a Raspberry Pi 5, “Raspberry Pi 5” by Simon Waldherr, via Wikimedia Commons, licensed under CC BY 4.0. Resized to a 1600 × 900 canvas with white padding. The photograph is illustrative and does not identify a specific 2GB retail variant.

  • DJI Neo 2 vs Lito X1 vs Flip: Which Beginner Drone Fits You?

    DJI Neo 2 vs Lito X1 vs Flip: Which Beginner Drone Fits You?

    A drone advertised for 36 minutes may give you much less time to film. DJI’s own typical-flight test for the Lito X1 lists 23 minutes, compared with its 36-minute maximum under controlled conditions. That gap is one reason a first-time buyer should compare more than a headline battery number.

    Quick answer: Pick the DJI Neo 2 for short selfie-style clips and the simplest launch routine, the DJI Lito X1 for the stronger camera-and-sensing mix on paper, or the DJI Flip if full propeller guards and a three-axis mechanical gimbal are your priorities. This is a specification-based comparison, not a hands-on review. We checked the manufacturers’ published specifications on October 23, 2026.

    The useful comparison: sensor, weight and advertised flight time

    DroneBest fitPublished weightCamera sensorMaximum flight time
    DJI Neo 2Close-up selfie clips151 g without digital transceiver; 160 g with it1/2-inchAbout 19 min (about 17 with guards)
    DJI Lito X1All-round camera useAbout 249 g standard takeoff weight1/1.3-inch36 min; DJI’s typical-flight test lists 23 min
    DJI FlipTravel video with guardsUnder 249 g1/1.3-inch31 min
    Manufacturer specifications checked October 23, 2026. Maximum flight times are controlled-test figures, not a promise of filming time.

    These numbers are not a complete camera-quality test: sensor size is only one factor, and flight-time methods differ between models. Weather, temperature, recording settings, battery choice and flying style affect real use. Treat maximum time as a comparison point, not the time you can safely plan to stay airborne.

    1. DJI Neo 2: easiest for short, personal clips

    The Neo 2 is the most direct fit if you want a small drone for quick selfie or follow-style footage. DJI lists palm takeoff and landing, subject tracking, full propeller guards, and a 1/2-inch sensor. Its listed weight is 151 g without the digital transceiver and 160 g with it.

    The trade-off is endurance: DJI lists about 19 minutes maximum flight time, dropping to about 17 minutes with the guards installed. Choose it for portability and a low-friction start—not for the longest aerial sessions or the largest sensor in this comparison. Confirm the camera modes and included controller in the official Neo 2 specifications.

    2. DJI Lito X1: the all-rounder on paper

    The Lito X1 combines a 1/1.3-inch CMOS camera, 48 effective megapixels, and obstacle-sensing features including forward-facing LiDAR. DJI lists a standard takeoff weight of about 249 g. Those sensors can support awareness, but they do not detect every hazard or replace a careful pilot.

    Here is the detail many quick roundups skip: DJI’s maximum flight-time figure is 36 minutes, while its published typical-flight test reports 23 minutes in a breezy scenario with 4K/60 recording. Neither number is a guarantee for your flight, but the second is a more useful reminder to allow for conditions and keep a return-and-landing reserve. The optional Plus battery weighs more than 249 g, so check the exact bundle and local rules. See the official Lito X1 specifications.

    Best fit: a beginner who wants a more capable travel or landscape camera and is comfortable learning conventional drone controls. This is the most balanced choice in this shortlist based on published specifications—not a claim that we tested it in flight.

    3. DJI Flip: a gimbal-and-guard choice for travel

    The Flip stands out for full-coverage propeller guards and a three-axis mechanical gimbal, which can help keep footage steady as the aircraft moves. DJI lists a 1/1.3-inch sensor, a takeoff weight below 249 g, and up to 31 minutes of flight time in its controlled test.

    Guards are not obstacle avoidance, and they do not make it safe to fly near people. As with the other models, the maximum battery figure is not a usable-filming-time promise. Compare the controller and battery included in your local bundle, and check the official DJI Flip specifications before buying.

    Which one should you choose?

    • Choose Neo 2 if compact selfie clips, palm launch and guarded propellers matter more than longer flight sessions.
    • Choose Lito X1 if you want the broader camera-and-sensing feature set and understand that advertised maximum time differs from DJI’s typical test.
    • Choose Flip if stabilized travel footage and full propeller guards are your deciding features.

    Before paying, check the exact kit: controller, battery count, charging hub, spare propellers, local warranty and app/controller compatibility can vary by region. There is no universal “best” drone independent of budget, use and local availability, so compare current local prices rather than relying on an old deal roundup.

    Buying it to learn drone programming? Read this first

    These are consumer camera drones, not interchangeable ArduPilot or PX4 development kits. Do not assume a product supports the SDK, telemetry access or control workflow you need. If writing autopilot software is the main goal, start with a flight controller and simulator explicitly supported by your chosen stack, then confirm current model-level SDK compatibility before buying hardware. EmbeddedPrep’s drone programming setup guide starts with simulation; our ArduPilot setup guide covers safe bench checks.

    Check local rules before your first flight

    A drone under 250 g is not automatically exempt from every rule worldwide. Registration, training, airspace, privacy and restrictions around people depend on your location and how you fly; battery and accessory choices can also change takeoff weight. In the United States, recreational flyers must complete TRUST and follow applicable safety rules. In the EU, requirements depend on drone class and operation category. Review the current FAA recreational-flyer guidance or EASA open-category guidance, then check your national aviation authority. Keep the drone in visual line of sight, avoid restricted airspace, and never treat obstacle sensing as permission to take risks.

    Sources and methodology

    This guide compares the manufacturers’ published specifications and official safety guidance; EmbeddedPrep did not flight-test these models. Product features, bundle contents, rules and availability can change. We checked these pages on October 23, 2026:

    Featured image: DJI Mini 4 Pro (illustrative). Photo by Jacek Halicki, via Wikimedia Commons, licensed under CC BY-SA 4.0. Cropped to 16:9 and resized to 1600 × 900; this adapted image is also shared under CC BY-SA 4.0. This is not one of the three drone models compared in this article.

  • Linux Device Driver Interview Questions Complete Roadmap

    1. Linux & Kernel Fundamentals

    Basic

    1. What is Linux?
    2. What is the Linux kernel?
    3. What is the difference between Linux and the Linux kernel?
    4. What is the kernel space and user space?
    5. Why is user space separated from kernel space?
    6. What happens when a user-space application calls a system call?
    7. What is a system call?
    8. What is the difference between system call and library call?
    9. What is a kernel module?
    10. What is a loadable kernel module (LKM)?
    11. Why do we use kernel modules?
    12. What is the difference between built-in driver and loadable driver?
    13. What is insmod?
    14. What is rmmod?
    15. What is modprobe?
    16. Difference between insmod and modprobe.
    17. What is lsmod?
    18. What is modinfo?
    19. What is /lib/modules?
    20. What is sysfs?
    21. What is procfs?
    22. Difference between /proc and /sys.

    2. Linux Device Driver Fundamentals

    1. What is a device driver?
    2. Why do we need device drivers?
    3. What are the different types of Linux drivers?
    4. What is a character driver?
    5. What is a block driver?
    6. What is a network driver?
    7. Difference between character and block drivers.
    8. What is a device?
    9. What is a device number?
    10. What is a major number?
    11. What is a minor number?
    12. Why are major and minor numbers required?
    13. What is dev_t?
    14. What is MAJOR()?
    15. What is MINOR()?
    16. What is MKDEV()?
    17. What is dynamic device number allocation?
    18. Difference between static and dynamic major number allocation.

    Important APIs

    alloc_chrdev_region()
    register_chrdev_region()
    unregister_chrdev_region()

    Know why, when and how each is used.

    3. Character Device Driver

    This is one of the highest-priority interview areas.

    Questions

    1. How do you write a basic character driver?
    2. What are the steps to create a character driver?
    3. What is struct file_operations?
    4. What is struct file?
    5. What is struct inode?
    6. What is struct cdev?
    7. Difference between inode and file.
    8. What is file_operations?
    9. Explain:
      • open()
      • read()
      • write()
      • close()
      • ioctl()
      • poll()
      • mmap()
      • llseek()
    10. How does a user-space read() reach the driver’s read() function?
    11. How does a user-space write() reach the driver’s write() function?
    12. What is private_data?
    13. How do you store driver-specific information in private_data?
    14. What is copy_to_user()?
    15. What is copy_from_user()?
    16. Why can’t we directly dereference a user-space pointer from kernel space?
    17. Difference between copy_to_user() and memcpy().
    18. What does copy_to_user() return?
    19. What does copy_from_user() return?
    20. What happens if user-space passes an invalid pointer?

    4. Device Driver Registration

    Know the complete sequence.

    Character driver

    alloc_chrdev_region()
            ↓
    cdev_init()
            ↓
    cdev_add()
            ↓
    class_create()
            ↓
    device_create()
            ↓
    /dev/mydevice

    Interview questions:

    1. Explain this entire flow.
    2. What does cdev_init() do?
    3. What does cdev_add() do?
    4. What is a Linux device class?
    5. What does class_create() do?
    6. What does device_create() do?
    7. Who creates /dev/mydevice?
    8. What is udev?
    9. Difference between device_create() and class_create().
    10. How do you remove a character device cleanly?

    5. Kernel Module Programming

    Prepare these very well.

    1. What is a kernel module?
    2. What is module_init()?
    3. What is module_exit()?
    4. What happens during module insertion?
    5. What happens during module removal?
    6. What is MODULE_LICENSE()?
    7. What is MODULE_AUTHOR()?
    8. What is MODULE_DESCRIPTION()?
    9. What is MODULE_DEVICE_TABLE()?
    10. What is EXPORT_SYMBOL()?
    11. Difference between:
    • EXPORT_SYMBOL
    • EXPORT_SYMBOL_GPL
    1. Can a kernel module call user-space functions?
    2. Can kernel code use printf()?
    3. Why do we use printk() / pr_info()?
    4. What is dmesg?
    5. How do you debug a module that fails to load?
    6. What does “Unknown symbol” mean?
    7. What is symbol resolution?

    6. Kernel Memory Management

    Very important for experienced Embedded Linux interviews.

    1. How does kernel memory allocation work?
    2. Difference between user-space malloc() and kernel kmalloc().
    3. What is kmalloc()?
    4. What is kzalloc()?
    5. What is kcalloc()?
    6. What is vmalloc()?
    7. Difference between kmalloc() and vmalloc().
    8. What is kfree()?
    9. What is vfree()?
    10. What are GFP flags?
    11. What is GFP_KERNEL?
    12. What is GFP_ATOMIC?
    13. Difference between GFP_KERNEL and GFP_ATOMIC.
    14. Why can’t you sleep in atomic context?
    15. What is physically contiguous memory?
    16. What is virtually contiguous memory?
    17. What is DMA?
    18. What is DMA-coherent memory?
    19. What is a memory leak?
    20. How can you detect kernel memory leaks?

    7. Kernel Virtual Memory

    1. What is virtual memory?
    2. Virtual address vs physical address.
    3. What is kernel virtual address?
    4. What is physical address?
    5. What is virt_to_phys()?
    6. What is phys_to_virt()?
    7. What is ioremap()?
    8. Why do we need ioremap()?
    9. Difference between normal RAM and I/O memory.
    10. What is readl()?
    11. What is writel()?
    12. Difference between:
    *ptr = value;

    and

    writel(value, ptr);

    8. Device Tree

    For modern Embedded Linux, this is extremely important.

    1. What is Device Tree?
    2. Why do we need Device Tree?
    3. What problem does Device Tree solve?
    4. What is DTS?
    5. What is DTSI?
    6. What is DTB?
    7. What is DTBO?
    8. How does Linux use Device Tree?
    9. What is a Device Tree node?
    10. What is a Device Tree property?
    11. What is compatible?
    12. What is reg?
    13. What is interrupts?
    14. What is clocks?
    15. What is gpio?
    16. What is gpios?
    17. What is status = "okay"?
    18. What does status = "disabled" mean?
    19. What is #address-cells?
    20. What is #size-cells?
    21. What are phandles?
    22. What is &label?
    23. What is Device Tree overlay?
    24. How does driver match with Device Tree?
    25. Explain of_match_table.
    26. What is MODULE_DEVICE_TABLE(of, ...)?
    27. What happens when compatible matches?
    28. How do you read a Device Tree property from a driver?
    29. What is of_property_read_u32()?
    30. What is of_get_named_gpio()?
    31. What is devm_*?

    Very common interview question

    How does a Device Tree node get connected to a driver?

    Know this flow:

    Device Tree
         ↓
    compatible
         ↓
    Driver of_match_table
         ↓
    Kernel matching
         ↓
    probe()
         ↓
    Device initialized

    9. Platform Driver

    Extremely important.

    1. What is a platform driver?
    2. What is a platform device?
    3. Why are platform drivers used?
    4. What is struct platform_driver?
    5. What is probe()?
    6. What is remove()?
    7. When is probe() called?
    8. When is remove() called?
    9. What is platform_device?
    10. Difference between platform driver and platform device.
    11. What is platform driver matching?
    12. How does Device Tree match with platform driver?
    13. What is platform_get_resource()?
    14. What is platform_get_irq()?
    15. What is devm_ioremap_resource()?
    16. What is devm_kzalloc()?
    17. Why are devm_* APIs useful?
    18. What happens automatically when a device is removed?

    10. Interrupts

    Very high priority.

    1. What is an interrupt?
    2. Hardware interrupt vs software interrupt.
    3. What is IRQ?
    4. What is ISR?
    5. What is interrupt context?
    6. What is request_irq()?
    7. What is free_irq()?
    8. Explain interrupt handler.
    9. What is irqreturn_t?
    10. What is IRQ_HANDLED?
    11. What is IRQ_NONE?
    12. What is shared IRQ?
    13. What is IRQF_SHARED?
    14. Why can’t you sleep inside an ISR?
    15. Can you call kmalloc(GFP_KERNEL) inside ISR?
    16. Why do we use GFP_ATOMIC in interrupt context?
    17. What is top half?
    18. What is bottom half?
    19. Why do we need bottom halves?
    20. What is a tasklet?
    21. What is a workqueue?
    22. Difference between tasklet and workqueue.
    23. What is threaded IRQ?
    24. Difference between hard IRQ and threaded IRQ.
    25. What is request_threaded_irq()?
    26. Which operations are allowed in interrupt context?
    27. How do you handle a long interrupt operation?

    11. Synchronization

    One of the most frequently tested areas.

    1. Why do we need synchronization?
    2. What is a race condition?
    3. What is a critical section?
    4. What is a mutex?
    5. What is a spinlock?
    6. Difference between mutex and spinlock.
    7. When should you use a mutex?
    8. When should you use a spinlock?
    9. Can you sleep while holding a spinlock?
    10. Can you sleep while holding a mutex?
    11. Can mutex be used inside ISR?
    12. Can spinlock be used inside ISR?
    13. What is semaphore?
    14. Mutex vs semaphore.
    15. What is completion?
    16. What is atomic operation?
    17. What is atomic_t?
    18. What is atomic_inc()?
    19. What is atomic_dec()?
    20. What is deadlock?
    21. What is priority inversion?
    22. What is lock ordering?
    23. What is recursive locking?
    24. What happens if the same spinlock is acquired twice?

    12. Wait Queues

    1. What is a wait queue?
    2. Why are wait queues used?
    3. What is wait_event()?
    4. What is wait_event_interruptible()?
    5. What is wake_up()?
    6. Difference between wake_up() and wake_up_interruptible().
    7. Why should a driver put a process to sleep?
    8. What is blocking I/O?
    9. What is non-blocking I/O?
    10. What does O_NONBLOCK mean?
    11. How do you implement blocking read()?
    12. How do you wake up a blocked process?

    Example concept:

    Application
         ↓
    read()
         ↓
    No data available
         ↓
    Process sleeps
         ↓
    Hardware interrupt
         ↓
    Data available
         ↓
    wake_up()
         ↓
    Process resumes

    13. Poll / Select / Epoll

    1. What is poll()?
    2. Why do drivers implement poll()?
    3. What is select()?
    4. What is epoll()?
    5. How does application know that device data is available?
    6. What is poll_wait()?
    7. Difference between blocking read() and poll().
    8. How do you implement poll() in a driver?

    14. I/O Control – ioctl

    Very common.

    1. What is ioctl()?
    2. Why do we use ioctl?
    3. When should you use read/write vs ioctl?
    4. How do you implement ioctl?
    5. What is _IO()?
    6. What is _IOR()?
    7. What is _IOW()?
    8. What is _IOWR()?
    9. Why are ioctl command numbers required?
    10. How do you pass a structure from user space to kernel?
    11. How do you safely copy ioctl data?
    12. What security problems can ioctl introduce?

    15. I2C Driver

    For embedded interviews, very important.

    1. What is I2C?
    2. How does I2C work?
    3. What are SDA and SCL?
    4. What is I2C slave address?
    5. What is ACK/NACK?
    6. What is repeated START?
    7. What is an I2C adapter?
    8. What is an I2C client?
    9. What is struct i2c_driver?
    10. What is struct i2c_client?
    11. What is struct i2c_adapter?
    12. What is probe() in an I2C driver?
    13. What is remove()?
    14. What is i2c_transfer()?
    15. What is i2c_master_send()?
    16. What is i2c_master_recv()?
    17. What is SMBus?
    18. I2C vs SMBus.
    19. How does Device Tree describe an I2C device?
    20. How does an I2C driver bind to a device?

    16. SPI Driver

    1. What is SPI?
    2. SPI signals:
      • MOSI
      • MISO
      • CLK
      • CS
    3. SPI master vs slave.
    4. What is SPI mode?
    5. What are CPOL and CPHA?
    6. What is struct spi_driver?
    7. What is struct spi_device?
    8. What is spi_transfer?
    9. What is spi_message?
    10. Difference between I2C and SPI.
    11. How does SPI driver communicate with hardware?
    12. How is SPI device represented in Device Tree?
    13. How does SPI driver matching happen?

    17. GPIO Driver

    1. What is GPIO?
    2. Input vs output GPIO.
    3. What is GPIO descriptor?
    4. What is the GPIO subsystem?
    5. How do you request a GPIO?
    6. How do you configure GPIO direction?
    7. How do you read GPIO?
    8. How do you write GPIO?
    9. What is gpiod_get()?
    10. What is gpiod_set_value()?
    11. What is gpiod_get_value()?
    12. Why is descriptor-based GPIO preferred over legacy GPIO APIs?
    13. How do you define GPIO in Device Tree?

    18. Pin Control

    1. What is pinctrl?
    2. Why is pinctrl required?
    3. What is pin multiplexing?
    4. What is pin configuration?
    5. What is pinctrl-0?
    6. What is pinctrl-names?
    7. What happens if pinmux is incorrectly configured?
    8. How does Device Tree configure pins?

    19. DMA

    Important for high-performance embedded systems.

    1. What is DMA?
    2. Why do we need DMA?
    3. CPU vs DMA data transfer.
    4. What is DMA buffer?
    5. What is DMA mapping?
    6. What is dma_map_single()?
    7. What is dma_unmap_single()?
    8. What is dma_alloc_coherent()?
    9. What is cache coherency?
    10. What is DMA streaming mapping?
    11. What is coherent DMA?
    12. What happens if CPU cache and DMA memory are inconsistent?
    13. What is DMA mask?
    14. What is dma_set_mask_and_coherent()?

    20. Device Model

    1. What is Linux device model?
    2. What is struct device?
    3. What is a bus?
    4. What is a driver?
    5. What is a device?
    6. What is a class?
    7. What is kobject?
    8. What is sysfs?
    9. What is bus-driver-device relationship?
    10. Explain:
    Bus
     ├── Device
     └── Driver
    1. What is device binding?
    2. What is driver binding?
    3. What is bind/unbind?

    21. Kernel Threads

    1. What is a kernel thread?
    2. Why do we need kernel threads?
    3. How do you create a kernel thread?
    4. What is kthread_run()?
    5. What is kthread_stop()?
    6. Difference between kernel thread and user-space thread.
    7. Can a kernel thread sleep?
    8. How do you stop a kernel thread safely?

    22. Workqueues

    1. What is a workqueue?
    2. Why use workqueues?
    3. What is deferred work?
    4. What is work_struct?
    5. What is INIT_WORK()?
    6. What is schedule_work()?
    7. What is flush_work()?
    8. Workqueue vs kernel thread.
    9. Workqueue vs tasklet.

    23. Timers

    1. What is a kernel timer?
    2. Why are timers used?
    3. What is struct timer_list?
    4. What is timer_setup()?
    5. What is mod_timer()?
    6. What is del_timer()?
    7. Can timer callback sleep?
    8. Timer vs delayed work.
    9. How do you implement periodic work?

    24. Power Management

    Important for automotive/embedded.

    1. What is Linux power management?
    2. What is suspend/resume?
    3. What is runtime PM?
    4. What is system suspend?
    5. What are:
      • suspend()
      • resume()
    6. What is runtime suspend?
    7. What is runtime resume?
    8. What is pm_runtime_get_sync()?
    9. What is pm_runtime_put()?
    10. Why is runtime PM important in embedded systems?
    11. How do you handle device state during suspend/resume?

    25. Error Handling

    1. How do you handle errors in kernel drivers?
    2. What are kernel error codes?
    3. Why do kernel functions return negative values?
    4. What is PTR_ERR()?
    5. What is IS_ERR()?
    6. What is ERR_PTR()?
    7. Difference between NULL pointer and ERR_PTR.
    8. What is dev_err()?
    9. What is dev_warn()?
    10. What is dev_info()?
    11. How do you clean up resources if probe fails halfway?

    Very important pattern

    Resource 1 acquired
            ↓
    Resource 2 acquired
            ↓
    Resource 3 fails
            ↓
    Release Resource 2
            ↓
    Release Resource 1
            ↓
    Return error

    26. Device-Managed Resources

    1. What is devm_kzalloc()?
    2. What is devm_ioremap_resource()?
    3. What is devm_request_irq()?
    4. Why use devm_* functions?
    5. When are managed resources automatically released?
    6. Difference between kzalloc() and devm_kzalloc().

    27. Memory-Mapped I/O

    1. What is MMIO?
    2. What is a memory-mapped register?
    3. How does CPU access hardware registers?
    4. What is ioremap()?
    5. What are readb/readw/readl?
    6. What are writeb/writew/writel?
    7. Why shouldn’t normal pointer dereferencing be used for MMIO?
    8. What is register polling?
    9. What is register masking?
    10. How do you set/clear a register bit safely?

    28. C Concepts for Driver Interviews

    Because Linux drivers are heavily based on C, prepare:

    1. Pointer
    2. Pointer to pointer
    3. Function pointer
    4. Callback function
    5. Structure
    6. Union
    7. Structure padding
    8. Bit fields
    9. Bit manipulation
    10. volatile
    11. const
    12. static
    13. extern
    14. inline
    15. typedef
    16. Macro
    17. Preprocessor
    18. Memory alignment
    19. Endianness
    20. Signed vs unsigned
    21. Race conditions
    22. Stack vs heap
    23. Function pointers
    24. Linked lists
    25. Circular buffers

    Especially know:

    volatile
    const
    static

    and:

    struct
    union
    enum
    typedef

    29. Linked Lists in Kernel

    1. Why does Linux use linked lists?
    2. What is struct list_head?
    3. What is an intrusive linked list?
    4. What is INIT_LIST_HEAD()?
    5. What is list_add()?
    6. What is list_del()?
    7. What is list_for_each()?
    8. What is container_of()?
    9. Why is container_of() important?
    10. Explain how Linux retrieves a parent structure from list_head.

    30. container_of()

    This is a favorite interview question.

    struct device_data {
        int value;
        struct list_head list;
    };

    Question:

    If you have a pointer to list, how do you get device_data?

    Answer:

    container_of()

    Know how offsetof() works as well.

    31. Concurrency & Race Conditions

    Prepare real scenarios:

    1. What is a race condition?
    2. How can two processes access the same driver?
    3. How can interrupt and process context race?
    4. How do you protect shared data?
    5. Mutex vs spinlock.
    6. Atomic variables.
    7. Memory barriers.
    8. What is smp_mb()?
    9. What is READ_ONCE()?
    10. What is WRITE_ONCE()?
    11. What is lock contention?
    12. What is deadlock?
    13. How do you debug deadlock?

    32. Atomic Context vs Process Context

    Very important.

    Process context

    Can generally:

    Sleep
    Schedule
    Acquire mutex
    kmalloc(GFP_KERNEL)
    Wait for resources

    Interrupt/atomic context

    Cannot sleep.

    Generally use:

    Spinlock
    GFP_ATOMIC
    Atomic operations

    Interview question:

    Why can’t an interrupt handler sleep?

    You should be able to explain this clearly.

    33. Debugging Linux Drivers

    1. How do you debug a kernel driver?
    2. What is dmesg?
    3. What is printk?
    4. What is dynamic debug?
    5. What is ftrace?
    6. What is tracepoint?
    7. What is debugfs?
    8. What is sysfs?
    9. How do you debug kernel panic?
    10. What is Oops?
    11. What is kernel panic?
    12. Difference between Oops and kernel panic.
    13. What is NULL pointer dereference?
    14. How do you find the source line of a crash?
    15. What is addr2line?
    16. What is gdb?
    17. What is KGDB?
    18. What is KASAN?
    19. What is lockdep?
    20. What is kmemleak?

    34. Kernel Crash Scenarios

    Interviewers may give scenarios.

    Example

    Driver crashes with NULL pointer dereference. What will you do?

    Expected approach:

    Check dmesg
       ↓
    Find faulting address
       ↓
    Find call stack
       ↓
    Identify source line
       ↓
    Check pointer initialization
       ↓
    Check probe/remove sequence
       ↓
    Fix and reproduce

    Other scenarios:

    1. Kernel panic during module insertion.
    2. Driver probe is never called.
    3. read() blocks forever.
    4. Interrupt never occurs.
    5. I2C device isn’t detected.
    6. SPI communication fails.
    7. /dev/mydevice isn’t created.
    8. Driver loads but doesn’t bind.
    9. DMA data is corrupted.
    10. System freezes when driver is unloaded.

    35. Sysfs

    1. What is sysfs?
    2. Why does sysfs exist?
    3. How does driver expose attributes?
    4. What is struct device_attribute?
    5. What are show() and store()?
    6. What is DEVICE_ATTR()?
    7. Difference between sysfs and procfs.
    8. When should you use sysfs?
    9. Why shouldn’t sysfs be used for large data transfers?

    36. Procfs

    1. What is /proc?
    2. What information does /proc provide?
    3. Can a driver create /proc entries?
    4. Difference between /proc and /sys.
    5. When would you use procfs?

    37. Debugfs

    1. What is debugfs?
    2. Why is debugfs used?
    3. Difference between sysfs and debugfs.
    4. Should production applications depend on debugfs?
    5. How can a driver expose debugging information through debugfs?

    38. User Space ↔ Kernel Space

    Very important.

    Know these mechanisms:

    System calls
         ↓
    ioctl
         ↓
    read/write
         ↓
    mmap
         ↓
    poll/select/epoll

    Questions:

    1. How does user space communicate with driver?
    2. Why can’t user space directly access kernel memory?
    3. What is a system call?
    4. What happens during read()?
    5. What happens during write()?
    6. What happens during ioctl()?
    7. What is mmap()?
    8. Why use mmap()?
    9. What is zero-copy?

    39. mmap in Device Drivers

    1. What is mmap()?
    2. Why map kernel/device memory to user space?
    3. How does driver implement mmap?
    4. What is zero-copy?
    5. What are the security risks of mmap?
    6. Difference between read/write and mmap.

    40. Block Drivers

    For advanced interviews:

    1. What is a block device?
    2. Character vs block device.
    3. What is a block layer?
    4. What is a request queue?
    5. What is bio?
    6. What is I/O scheduler?
    7. What is /dev/sda?
    8. What is /dev/mmcblk0?
    9. What is NVMe?
    10. Basic Linux storage stack.

    41. Network Drivers

    If the job requires networking:

    1. What is a network driver?
    2. What is struct net_device?
    3. What is NAPI?
    4. What is interrupt-driven packet reception?
    5. Why is NAPI used?
    6. What is sk_buff?
    7. What is TX/RX ring?
    8. What is DMA in network drivers?
    9. What happens when an Ethernet packet arrives?
    10. Explain Linux network stack.

    42. Boot Process + Driver

    Very common in Embedded Linux.

    Know:

    Power ON
       ↓
    Boot ROM
       ↓
    Bootloader
       ↓
    Kernel
       ↓
    Device Tree
       ↓
    Kernel initialization
       ↓
    Driver initialization
       ↓
    Root filesystem
       ↓
    init/systemd
       ↓
    User application

    Questions:

    1. What happens after power-on?
    2. What is BootROM?
    3. What is U-Boot?
    4. What does U-Boot do?
    5. How does U-Boot load Device Tree?
    6. How does kernel start?
    7. When are drivers initialized?
    8. What is initcall?
    9. What is root filesystem?
    10. What happens if the driver is built into the kernel?

    43. Kernel Build System

    1. What is Kconfig?
    2. What is Makefile in kernel?
    3. What is .config?
    4. What is menuconfig?
    5. What is defconfig?
    6. What is CONFIG_*?
    7. Built-in vs module:
    CONFIG_DRIVER=y
    CONFIG_DRIVER=m
    CONFIG_DRIVER=n
    1. Difference between y, m, and n.
    2. How do you enable a driver?
    3. How do you build an external module?

    44. Cross Compilation

    For Embedded Linux:

    1. What is cross compilation?
    2. Why do we cross compile?
    3. Host vs target.
    4. What is cross compiler?
    5. What is ARCH?
    6. What is CROSS_COMPILE?
    7. How do you build a kernel for ARM?
    8. How do you build an external driver for another architecture?
    9. What is kernel build directory?
    10. Why must module and kernel versions/configuration match?

    45. Linux Driver + Yocto

    Since Embedded Linux jobs often combine these skills:

    1. What is Yocto?
    2. What is BitBake?
    3. How do you add a kernel driver to Yocto?
    4. What is a recipe?
    5. What is a layer?
    6. What is SRC_URI?
    7. What is inherit module?
    8. How do you compile an external kernel module using Yocto?
    9. How do you add a Device Tree change?
    10. How do you enable a kernel configuration?
    11. What is KERNEL_MODULE_AUTOLOAD?
    12. What is IMAGE_INSTALL?
    13. Difference between built-in driver and module in Yocto.
    14. How do you debug a driver build failure in BitBake?

    46. Real-Time / Automotive Driver Questions

    For automotive Embedded Linux, prepare:

    1. What is PREEMPT?
    2. What is PREEMPT_RT?
    3. What is real-time Linux?
    4. What is interrupt latency?
    5. What is scheduling latency?
    6. What is priority inversion?
    7. What is CPU affinity?
    8. What is SCHED_FIFO?
    9. What is SCHED_RR?
    10. What is SCHED_OTHER?
    11. How do you reduce driver latency?
    12. How do you handle high-frequency interrupts?
    13. How do you handle DMA buffers?
    14. How do you debug intermittent audio/data loss?

    47. Most Important Scenario Questions

    These are particularly useful for interviews:

    Scenario 1

    Driver is loaded but probe() isn’t called. Why?

    Possible areas:

    compatible mismatch
    Device Tree disabled
    driver not registered
    wrong bus
    missing device
    module not loaded

    Scenario 2

    /dev/mydevice doesn’t exist. What do you check?

    Driver loaded?
           ↓
    Major/minor allocated?
           ↓
    cdev_add() successful?
           ↓
    class_create()?
           ↓
    device_create()?
           ↓
    udev?

    Scenario 3

    Interrupt isn’t coming.

    Check:

    Device Tree IRQ
          ↓
    IRQ number
          ↓
    request_irq()
          ↓
    Hardware interrupt enable
          ↓
    GPIO/pinmux
          ↓
    Interrupt controller
          ↓
    ISR

    Scenario 4

    I2C device doesn’t respond.

    Check:

    Power
     ↓
    SDA/SCL
     ↓
    Pull-ups
     ↓
    Pinmux
     ↓
    I2C address
     ↓
    Bus speed
     ↓
    Device Tree
     ↓
    I2C controller
     ↓
    Driver

    Scenario 5

    System freezes randomly.

    Think about:

    Deadlock
    Race condition
    Spinlock issue
    Interrupt storm
    Memory corruption
    Use-after-free
    NULL pointer
    DMA corruption

    48. Must-Know Kernel APIs

    Try to recognize these immediately:

    kmalloc()
    kzalloc()
    kfree()
    
    copy_to_user()
    copy_from_user()
    
    mutex_lock()
    mutex_unlock()
    
    spin_lock()
    spin_unlock()
    
    wait_event()
    wake_up()
    
    request_irq()
    free_irq()
    
    ioremap()
    iounmap()
    
    readl()
    writel()
    
    alloc_chrdev_region()
    cdev_init()
    cdev_add()
    
    class_create()
    device_create()
    
    platform_driver_register()
    platform_driver_unregister()
    
    devm_kzalloc()
    devm_request_irq()
    
    request_threaded_irq()
    
    schedule_work()
    
    kthread_run()
    kthread_stop()
    
    dma_alloc_coherent()
    dma_map_single()
    dma_unmap_single()

    49. Top 30 Questions You MUST Prepare

    If your interview is soon, prioritize these:

    1. What is a Linux device driver?
    2. Kernel space vs user space.
    3. Character vs block driver.
    4. Major/minor number.
    5. file_operations.
    6. inode vs file.
    7. cdev.
    8. alloc_chrdev_region().
    9. cdev_add().
    10. class_create() and device_create().
    11. copy_to_user() / copy_from_user().
    12. Kernel module lifecycle.
    13. Device Tree.
    14. compatible property.
    15. Device Tree → driver → probe().
    16. Platform driver.
    17. probe() and remove().
    18. Interrupt handling.
    19. Top half vs bottom half.
    20. Workqueue vs tasklet.
    21. Mutex vs spinlock.
    22. Process context vs interrupt context.
    23. Wait queue.
    24. kmalloc() vs vmalloc().
    25. GFP_KERNEL vs GFP_ATOMIC.
    26. MMIO and ioremap().
    27. I2C driver architecture.
    28. SPI driver architecture.
    29. DMA.
    30. Driver debugging using dmesg, ftrace, debugfs, etc.

    Recommended interview preparation order

    C fundamentals
          ↓
    Linux fundamentals
          ↓
    Kernel/User space
          ↓
    Kernel modules
          ↓
    Character drivers
          ↓
    Device model
          ↓
    Device Tree
          ↓
    Platform drivers
          ↓
    Interrupts
          ↓
    Synchronization
          ↓
    Wait queues
          ↓
    Memory management
          ↓
    I2C
          ↓
    SPI
          ↓
    GPIO
          ↓
    DMA
          ↓
    Power management
          ↓
    Debugging
          ↓
    Yocto + Driver
          ↓
    Real-world scenarios

    Linux Internals Interview Questions – Complete A-Z

    1. Linux Architecture

    1. What is Linux?
    2. What is the Linux kernel?
    3. Explain Linux architecture.
    4. What are the major components of Linux?
    5. What is kernel space?
    6. What is user space?
    7. Why are user space and kernel space separated?
    8. What happens when a user application starts?
    9. What happens when a Linux command is executed?
    10. What happens when you execute ./a.out?
    11. What is the role of the shell?
    12. What is the role of the kernel?
    13. What is GNU/Linux?
    14. What is monolithic kernel?
    15. Is Linux a monolithic kernel?
    16. What is a modular monolithic kernel?
    17. Monolithic vs microkernel.
    18. What are the advantages of Linux’s architecture?
    19. What are kernel subsystems?
    20. Explain the Linux kernel at a high level.

    Know this architecture

    User Applications
           ↓
    Libraries
           ↓
    System Calls
           ↓
    Linux Kernel
     ┌───────────────┐
     │ Process Mgmt  │
     │ Memory Mgmt   │
     │ VFS           │
     │ Networking    │
     │ IPC           │
     │ Drivers       │
     │ Scheduler     │
     └───────────────┘
           ↓
    Hardware

    2. Boot Process

    1. What happens when a Linux system powers ON?
    2. What is Boot ROM?
    3. What is firmware?
    4. What is a bootloader?
    5. What is U-Boot?
    6. What does U-Boot do?
    7. How does bootloader load the kernel?
    8. How does bootloader load Device Tree?
    9. What is Image?
    10. What is zImage?
    11. What is uImage?
    12. What is FIT image?
    13. What is initramfs?
    14. What is root filesystem?
    15. What is /sbin/init?
    16. What is systemd?
    17. What happens after kernel decompression?
    18. What is start_kernel()?
    19. What happens inside start_kernel()?
    20. How does Linux initialize devices?
    21. What are initcalls?
    22. What is early_initcall()?
    23. What is subsys_initcall()?
    24. What is module_init()?
    25. How does Linux finally start user space?

    Embedded Linux boot flow

    Power ON
       ↓
    Boot ROM
       ↓
    Bootloader
       ↓
    DRAM Initialization
       ↓
    Load Kernel
       ↓
    Load Device Tree
       ↓
    Kernel
       ↓
    start_kernel()
       ↓
    Kernel Initialization
       ↓
    Root Filesystem
       ↓
    init/systemd
       ↓
    User Applications

    3. Process Internals

    This is one of the most important Linux Internal topics.

    1. What is a process?
    2. What is a program?
    3. Program vs process.
    4. What happens when a process is created?
    5. What is PCB?
    6. What is task_struct?
    7. What information is stored in task_struct?
    8. What is PID?
    9. What is PPID?
    10. What is TGID?
    11. What is TID?
    12. What is a process ID namespace?
    13. What is process state?
    14. Explain:
    • Running
    • Runnable
    • Sleeping
    • Stopped
    • Zombie
    1. What is a zombie process?
    2. What is an orphan process?
    3. What happens to an orphan process?
    4. What is init/PID 1?
    5. What is fork()?
    6. What is vfork()?
    7. Difference between fork() and vfork().
    8. What is clone()?
    9. How does Linux create a process?
    10. What happens internally during fork()?
    11. What is exec()?
    12. Difference between fork() and exec().
    13. What is wait()?
    14. What is waitpid()?
    15. Why does a parent call wait()?
    16. What is process termination?
    17. What happens when exit() is called?
    18. What is _exit()?
    19. exit() vs _exit().
    20. What is process hierarchy?
    21. What is a process tree?
    22. What is pstree?
    23. What is process context?

    4. Threads

    1. What is a thread?
    2. Process vs thread.
    3. Why use threads?
    4. What resources are shared between threads?
    5. What resources are private to each thread?
    6. Do threads have separate address spaces?
    7. What is a kernel thread?
    8. User thread vs kernel thread.
    9. What is pthread_create()?
    10. What is pthread_join()?
    11. What is thread cancellation?
    12. What is thread-local storage?
    13. What is TLS?
    14. How does Linux implement threads?
    15. What is clone()?
    16. Why are Linux threads often described as tasks?
    17. What is a thread group?
    18. What is TGID?
    19. What is TID?

    5. CPU Scheduling

    Very frequently asked.

    1. What is process scheduling?
    2. Why do we need a scheduler?
    3. What is the Linux scheduler?
    4. What is context switching?
    5. What happens during a context switch?
    6. Process context vs interrupt context.
    7. What is preemptive scheduling?
    8. What is cooperative scheduling?
    9. What is scheduling latency?
    10. What is time slice?
    11. What is priority?
    12. What is nice value?
    13. What is nice?
    14. What is renice?
    15. What is CFS?
    16. What is the Completely Fair Scheduler?
    17. What is SCHED_NORMAL?
    18. What is SCHED_FIFO?
    19. What is SCHED_RR?
    20. What is SCHED_DEADLINE?
    21. FIFO vs Round Robin.
    22. Real-time scheduling vs normal scheduling.
    23. What is starvation?
    24. What is priority inversion?
    25. How is priority inversion handled?
    26. What is CPU affinity?
    27. What is taskset?
    28. What is CPU isolation?
    29. What is load balancing?
    30. How does Linux select the next task?
    31. What is a runqueue?
    32. What is scheduler tick?
    33. What is tickless Linux?
    34. What is CONFIG_NO_HZ?

    6. Context Switching

    1. What is context switching?
    2. Why does context switching happen?
    3. What is saved during context switch?
    4. What is restored?
    5. Process context switch vs thread context switch.
    6. What is register context?
    7. What is stack context?
    8. What is address-space switching?
    9. Why is context switching expensive?
    10. What happens to CPU cache during context switching?
    11. What is TLB?
    12. Does every context switch flush the TLB?
    13. How does ASID/PCID help?
    14. What is voluntary context switching?
    15. What is involuntary context switching?
    16. How can you measure context switches?

    7. System Calls

    One of the most important Linux internals topics.

    1. What is a system call?
    2. Why are system calls needed?
    3. User function vs system call.
    4. Library call vs system call.
    5. What happens internally when read() is called?
    6. What happens when write() is called?
    7. What happens when open() is called?
    8. What happens when fork() is called?
    9. What happens when execve() is called?
    10. What is system call number?
    11. How does kernel identify a system call?
    12. What is syscall entry?
    13. What is syscall return?
    14. What is trap instruction?
    15. What is privilege-level transition?
    16. What happens to CPU registers during syscall?
    17. How does user space return from kernel space?
    18. What is strace?
    19. How can strace help debug applications?
    20. Can user space directly call kernel functions?
    21. Why can’t user space access kernel memory directly?

    8. CPU Privilege Levels

    1. What is privilege?
    2. User mode vs kernel mode.
    3. What is ring 0?
    4. What is ring 3?
    5. Why does Linux use different privilege levels?
    6. What happens during user → kernel transition?
    7. What happens during kernel → user transition?
    8. What is a trap?
    9. What is an exception?
    10. What is an interrupt?
    11. Interrupt vs exception vs trap.

    9. Virtual Memory

    Extremely important.

    1. What is virtual memory?
    2. Why does Linux use virtual memory?
    3. Virtual address vs physical address.
    4. What is address space?
    5. What is process address space?
    6. What is virtual address space?
    7. What is page?
    8. What is page frame?
    9. What is page table?
    10. What is multi-level page table?
    11. Why are multi-level page tables used?
    12. What is MMU?
    13. What is TLB?
    14. Why do we need TLB?
    15. What is page fault?
    16. Minor vs major page fault.
    17. What happens during a page fault?
    18. What is demand paging?
    19. What is lazy allocation?
    20. What is copy-on-write?
    21. How does fork() use copy-on-write?
    22. What is memory mapping?
    23. What is mmap()?
    24. What is anonymous memory?
    25. What is file-backed memory?
    26. What is shared memory?
    27. What is private memory?
    28. What is memory overcommit?
    29. What is ASLR?
    30. What is memory protection?

    10. Process Address Space

    Know this diagram:

    High Address
    +------------------+
    | Kernel Space     |
    +------------------+
    | Stack            |
    |        ↓         |
    |                  |
    |        ↑         |
    | Heap             |
    +------------------+
    | BSS              |
    | Data             |
    | Text             |
    +------------------+
    Low Address

    Questions:

    1. What is text segment?
    2. What is data segment?
    3. What is BSS?
    4. What is heap?
    5. What is stack?
    6. Heap vs stack.
    7. Where are global variables stored?
    8. Where are static variables stored?
    9. Where are local variables stored?
    10. Where are string literals stored?
    11. What causes stack overflow?
    12. What is stack frame?
    13. What is function call stack?
    14. What is ASLR?
    15. How does shared library memory appear in process address space?

    11. Memory Allocation

    1. What is malloc()?
    2. What happens internally during malloc()?
    3. malloc() vs calloc().
    4. malloc() vs realloc().
    5. What is brk()?
    6. What is sbrk()?
    7. What is mmap() used for in memory allocation?
    8. How does glibc allocate memory?
    9. What is memory fragmentation?
    10. Internal vs external fragmentation.
    11. What is memory leak?
    12. How do you find memory leaks?
    13. What is valgrind?
    14. What is AddressSanitizer?
    15. What is double free?
    16. What is use-after-free?
    17. What is dangling pointer?

    12. Kernel Memory Management

    1. What is kmalloc()?
    2. What is kzalloc()?
    3. What is vmalloc()?
    4. kmalloc() vs vmalloc().
    5. What is GFP_KERNEL?
    6. What is GFP_ATOMIC?
    7. Why can’t GFP_KERNEL be used in interrupt context?
    8. What is the buddy allocator?
    9. What is SLAB?
    10. What is SLUB?
    11. What is SLOB?
    12. Why does Linux use slab allocation?
    13. What is an object cache?
    14. What is page allocator?
    15. What is high memory?
    16. What is low memory?
    17. What is physically contiguous memory?
    18. What is virtually contiguous memory?

    13. Buddy Allocator

    1. What is buddy system?
    2. Why is buddy allocator used?
    3. What is an order?
    4. What is an order-0 page?
    5. How does buddy splitting work?
    6. How does buddy merging work?
    7. What is external fragmentation?
    8. Why can’t large physically contiguous allocations always succeed?
    9. What is compaction?

    14. Slab / SLUB Allocator

    1. Why do we need slab allocator?
    2. What is a slab?
    3. What is a cache?
    4. What is an object?
    5. Slab vs page allocator.
    6. SLAB vs SLUB.
    7. Why is SLUB commonly used?
    8. What is kmem_cache_create()?
    9. What is kmem_cache_alloc()?
    10. What is kmem_cache_free()?

    15. Page Cache

    1. What is page cache?
    2. Why does Linux use page cache?
    3. How does read() interact with page cache?
    4. How does write() interact with page cache?
    5. What is buffered I/O?
    6. What is direct I/O?
    7. What is O_DIRECT?
    8. What is dirty page?
    9. What is writeback?
    10. What is fsync()?
    11. What is sync()?
    12. What is fdatasync()?
    13. What is writeback cache?
    14. What happens if RAM becomes full of cached data?

    16. File Descriptors

    1. What is a file descriptor?
    2. Why does Linux represent devices/files using file descriptors?
    3. What is FD 0?
    4. What is FD 1?
    5. What is FD 2?
    6. What happens when open() is called?
    7. What is a file descriptor table?
    8. What is an open file description?
    9. What is struct file?
    10. What is an inode?
    11. FD vs inode vs file.
    12. What happens when close() is called?
    13. What happens if two processes share an FD?
    14. What happens after fork()?
    15. What is dup()?
    16. What is dup2()?
    17. What is dup3()?
    18. What is FD inheritance?

    17. VFS – Virtual File System

    Very important for Linux internals.

    1. What is VFS?
    2. Why does Linux need VFS?
    3. What is a filesystem?
    4. What is an inode?
    5. What is a dentry?
    6. What is struct file?
    7. What is super_block?
    8. Explain:
    Process
       ↓
    System Call
       ↓
    VFS
       ↓
    Filesystem
       ↓
    Block Layer
       ↓
    Device Driver
       ↓
    Hardware
    1. What is inode cache?
    2. What is dentry cache?
    3. What is pathname lookup?
    4. What happens during open("/home/test.txt")?
    5. What is namei?
    6. What is mount?
    7. What is superblock?
    8. Hard link vs symbolic link.
    9. What happens when a file is deleted?
    10. Can a deleted file still be open?

    18. Filesystem Internals

    1. What is ext4?
    2. What is inode?
    3. What is directory entry?
    4. What is block?
    5. What is filesystem block size?
    6. What is journaling?
    7. Why is journaling needed?
    8. What happens after sudden power failure?
    9. What is fsck?
    10. What is mount?
    11. What is unmount?
    12. What is /etc/fstab?
    13. What is root filesystem?
    14. What is tmpfs?
    15. What is procfs?
    16. What is sysfs?
    17. What is devtmpfs?
    18. What is debugfs?
    19. What is overlayfs?
    20. What is NFS?

    19. IPC – Inter-Process Communication

    1. What is IPC?
    2. Why is IPC needed?
    3. What are the IPC mechanisms?
    4. Pipe
    5. FIFO
    6. Message queue
    7. Shared memory
    8. Semaphore
    9. Signal
    10. Socket
    11. Pipe vs FIFO.
    12. Message queue vs shared memory.
    13. Shared memory vs pipe.
    14. Which IPC mechanism is fastest?
    15. Why is shared memory fast?
    16. How do you synchronize shared memory?

    20. Pipes

    1. What is a pipe?
    2. How does pipe() work?
    3. Anonymous pipe vs named pipe.
    4. What is FIFO?
    5. What happens if pipe buffer is full?
    6. What happens if no reader exists?
    7. Is pipe unidirectional?
    8. How is pipe implemented inside kernel?

    21. Signals

    1. What is a signal?
    2. Why are signals used?
    3. What is SIGINT?
    4. SIGTERM vs SIGKILL.
    5. SIGSTOP vs SIGCONT.
    6. What is SIGSEGV?
    7. What is SIGCHLD?
    8. What happens when a signal is generated?
    9. What is signal handler?
    10. Can you catch SIGKILL?
    11. Can you catch SIGSTOP?
    12. Signal vs interrupt.
    13. What is signal masking?
    14. What is pending signal?
    15. What is blocked signal?
    16. What is sigaction()?
    17. Why is sigaction() preferred over old signal()?

    22. Shared Memory

    1. What is shared memory?
    2. Why is shared memory fast?
    3. What is mmap()?
    4. What is POSIX shared memory?
    5. What is System V shared memory?
    6. Shared memory synchronization.
    7. Can multiple processes write simultaneously?
    8. What happens without synchronization?
    9. Shared memory vs message queue.

    23. Synchronization

    1. What is synchronization?
    2. What is race condition?
    3. What is critical section?
    4. What is mutex?
    5. What is semaphore?
    6. What is spinlock?
    7. Mutex vs semaphore.
    8. Mutex vs spinlock.
    9. What is read-write lock?
    10. What is RCU?
    11. What is atomic operation?
    12. What is atomic_t?
    13. What is memory barrier?
    14. What is deadlock?
    15. What is livelock?
    16. What is starvation?
    17. What is priority inversion?
    18. How do you avoid deadlocks?
    19. What is lock ordering?
    20. Can a mutex be used in interrupt context?
    21. Can a spinlock be used in process context?
    22. Can you sleep while holding a spinlock?

    24. RCU

    For advanced interviews:

    1. What is RCU?
    2. Why was RCU introduced?
    3. Read-copy-update concept.
    4. Why is RCU useful for read-heavy workloads?
    5. What is an RCU read-side critical section?
    6. What is rcu_read_lock()?
    7. What is rcu_read_unlock()?
    8. What is synchronize_rcu()?
    9. RCU vs mutex.
    10. RCU vs spinlock.

    25. Deadlock

    1. What is deadlock?
    2. Four conditions for deadlock.
    3. Mutual exclusion.
    4. Hold and wait.
    5. No preemption.
    6. Circular wait.
    7. How do you prevent deadlock?
    8. How do you debug deadlock?
    9. What is lockdep?
    10. Give an example of kernel deadlock.

    26. Interrupts

    1. What is an interrupt?
    2. Hardware vs software interrupt.
    3. What is IRQ?
    4. What is ISR?
    5. Interrupt context.
    6. What happens when an interrupt occurs?
    7. What is interrupt controller?
    8. What is IRQ number?
    9. Shared IRQ.
    10. Edge-triggered vs level-triggered.
    11. What is interrupt affinity?
    12. What is interrupt storm?
    13. What is interrupt latency?
    14. What is top half?
    15. What is bottom half?
    16. What is threaded IRQ?
    17. What is tasklet?
    18. What is workqueue?
    19. Why can’t ISR sleep?
    20. What is request_irq()?
    21. What is free_irq()?

    27. Kernel Timers

    1. What is kernel timer?
    2. Why use kernel timers?
    3. What is timer callback?
    4. Can timer callback sleep?
    5. Timer vs workqueue.
    6. Timer vs delayed work.
    7. What happens if timer callback takes too long?
    8. How do you create a kernel timer?

    28. Workqueues

    1. What is workqueue?
    2. Why defer work?
    3. What is work_struct?
    4. What is schedule_work()?
    5. Can workqueue sleep?
    6. Workqueue vs tasklet.
    7. Workqueue vs kernel thread.
    8. What is ordered workqueue?
    9. What is dedicated workqueue?

    29. Kernel Threads

    1. What is a kernel thread?
    2. How is it different from a user thread?
    3. What is kthread_run()?
    4. What is kthread_stop()?
    5. Can kernel threads sleep?
    6. How does a kernel thread terminate?
    7. Why would a driver use a kernel thread?

    30. Networking Internals

    For Embedded Linux, prepare the basics.

    1. Explain Linux networking architecture.
    2. What happens when you run:
    ping 8.8.8.8
    1. What happens when an Ethernet frame arrives?
    2. What is NIC?
    3. What is network driver?
    4. What is net_device?
    5. What is socket?
    6. What is socket buffer (sk_buff)?
    7. What is TCP/IP stack?
    8. What is ARP?
    9. What is routing?
    10. What is IP address?
    11. MAC address vs IP address.
    12. TCP vs UDP.
    13. What is port?
    14. What is network namespace?
    15. What is NAPI?
    16. Why is NAPI required?
    17. Interrupt-driven RX vs polling.
    18. What is checksum offload?
    19. What is TSO?
    20. What is GRO?
    21. What is RSS?
    22. What is DMA in network drivers?

    31. Socket Internals

    1. What is a socket?
    2. What happens during socket()?
    3. What happens during bind()?
    4. What happens during listen()?
    5. What happens during accept()?
    6. What happens during connect()?
    7. What happens during send()?
    8. What happens during recv()?
    9. What is socket buffer?
    10. Blocking vs non-blocking socket.
    11. What is select()?
    12. What is poll()?
    13. What is epoll()?
    14. Why is epoll() efficient?
    15. Level-triggered vs edge-triggered.

    32. DMA

    1. What is DMA?
    2. Why use DMA?
    3. CPU copy vs DMA.
    4. What is DMA buffer?
    5. What is DMA mapping?
    6. What is DMA coherent memory?
    7. What is cache coherency?
    8. dma_map_single().
    9. dma_unmap_single().
    10. dma_alloc_coherent().
    11. Streaming DMA vs coherent DMA.
    12. What is DMA mask?
    13. What is IOMMU?
    14. CPU cache vs DMA.
    15. What happens if cache isn’t synchronized?

    33. Device Model

    1. What is Linux device model?
    2. What is a device?
    3. What is a driver?
    4. What is a bus?
    5. What is a class?
    6. What is kobject?
    7. What is sysfs?
    8. What is device binding?
    9. What is driver binding?
    10. Explain:
    Bus
     ├── Device
     └── Driver
    1. What is struct device?
    2. What is reference counting?
    3. What is kref?
    4. What is hotplug?
    5. What is uevent?
    6. What is udev?

    34. Device Tree

    1. What is Device Tree?
    2. Why do we need Device Tree?
    3. DTS vs DTSI.
    4. DTS vs DTB.
    5. What is DTBO?
    6. What is a node?
    7. What is a property?
    8. What is compatible?
    9. What is reg?
    10. What is interrupts?
    11. What is clocks?
    12. What is gpios?
    13. What is status?
    14. What is phandle?
    15. What is Device Tree overlay?
    16. How does Device Tree bind to a driver?
    17. What is of_match_table?
    18. What is of_device_id?
    19. What is probe()?
    20. How does the kernel discover hardware from Device Tree?

    35. Kernel Modules

    1. What is kernel module?
    2. Why use modules?
    3. Built-in vs module.
    4. What is .ko?
    5. What is insmod?
    6. What is modprobe?
    7. What is rmmod?
    8. What is lsmod?
    9. What is modinfo?
    10. What is module dependency?
    11. What is symbol export?
    12. What is EXPORT_SYMBOL()?
    13. What is EXPORT_SYMBOL_GPL()?
    14. What happens during module loading?
    15. What happens during unloading?
    16. Why can a module fail to unload?
    17. What is module reference count?

    36. Sysfs / Procfs / Debugfs

    1. What is sysfs?
    2. What is procfs?
    3. What is debugfs?
    4. Difference between them.
    5. What information is exposed through /proc?
    6. What information is exposed through /sys?
    7. Why shouldn’t debugfs be used as a stable application interface?
    8. How does a driver create a sysfs attribute?
    9. What are show() and store()?
    10. What is DEVICE_ATTR()?

    37. Kernel Synchronization Context

    Interviewers love scenario questions:

    Q: Can you sleep here?

    Prepare answers for:

    ContextCan Sleep?
    User processYes
    Kernel process contextYes
    Kernel threadYes
    Interrupt handlerNo
    Timer callbackNo
    Spinlock-held contextNo
    Atomic contextNo

    Then expect:

    Why?

    What API can you use instead?

    Which GFP flag should you use?

    38. ELF & Program Loading

    1. What is ELF?
    2. What is an ELF executable?
    3. What is an ELF header?
    4. What is a program header?
    5. What is a section header?
    6. What is .text?
    7. What is .data?
    8. What is .bss?
    9. What is symbol table?
    10. What is relocation?
    11. What is dynamic linking?
    12. What is static linking?
    13. Static vs dynamic linking.
    14. What is a shared library?
    15. What is .so?
    16. What is the dynamic linker?
    17. What is ld.so?
    18. What happens when you execute an ELF binary?
    19. What is ASLR?
    20. What is PIE?

    39. Dynamic Linking

    1. Static vs dynamic library.
    2. What is .so?
    3. What is LD_LIBRARY_PATH?
    4. What is ldconfig?
    5. What is dynamic linker?
    6. What is symbol resolution?
    7. What is PLT?
    8. What is GOT?
    9. What is lazy binding?
    10. What is LD_PRELOAD?

    40. IPC + Synchronization Scenarios

    Prepare scenarios like:

    Two processes access the same shared buffer. How will you synchronize?

    Producer produces data faster than consumer. What happens?

    Consumer waits until data arrives. What IPC/synchronization mechanism would you use?

    Multiple threads update the same variable. What can go wrong?

    An interrupt updates a buffer while a process reads it. How will you protect it?

    41. Blocking & Non-Blocking I/O

    1. What is blocking I/O?
    2. What is non-blocking I/O?
    3. What is O_NONBLOCK?
    4. What happens when read() has no data?
    5. What is EAGAIN?
    6. What is EWOULDBLOCK?
    7. How does poll() work?
    8. How does select() work?
    9. How does epoll() work?
    10. Blocking vs polling.
    11. Blocking read vs interrupt-driven design.

    42. select() / poll() / epoll()

    1. Why do we need I/O multiplexing?
    2. What is select()?
    3. What is poll()?
    4. What is epoll()?
    5. select() vs poll().
    6. poll() vs epoll().
    7. Why is epoll() more scalable?
    8. Level-triggered vs edge-triggered.
    9. What is EPOLLIN?
    10. What is EPOLLOUT?
    11. What is EPOLLERR?
    12. How does a device driver implement poll()?

    43. Signals vs Interrupts

    Very common conceptual question.

    InterruptSignal
    Hardware/kernel eventProcess notification
    Usually handled by kernel/ISRDelivered to process
    CPU/hardware relatedProcess related
    Example GPIO interruptSIGTERM

    Questions:

    1. Difference between interrupt and signal.
    2. Can a process generate a signal?
    3. Can kernel generate a signal?
    4. What is hardware interrupt?
    5. What is software interrupt?

    44. Time Management

    1. What is system clock?
    2. What is clock tick?
    3. What is jiffies?
    4. What is HZ?
    5. What is monotonic clock?
    6. What is realtime clock?
    7. Difference between CLOCK_REALTIME and CLOCK_MONOTONIC.
    8. What is high-resolution timer?
    9. What is timer interrupt?
    10. What is nanosleep()?
    11. What is clock_nanosleep()?
    12. Why is CLOCK_MONOTONIC preferred for measuring elapsed time?

    45. SMP / Multicore Linux

    1. What is SMP?
    2. What is multicore?
    3. How does Linux handle multiple CPUs?
    4. What is CPU affinity?
    5. What is per-CPU data?
    6. Why use per-CPU variables?
    7. What is cache coherence?
    8. What is cache line?
    9. What is false sharing?
    10. What is CPU migration?
    11. What is load balancing?
    12. What is NUMA?
    13. What is memory barrier?
    14. Why are locks more important on SMP?

    46. Cache & Memory Ordering

    For senior Embedded Linux roles:

    1. What is CPU cache?
    2. L1/L2/L3 cache.
    3. What is cache line?
    4. What is cache coherence?
    5. What is memory ordering?
    6. What is memory barrier?
    7. Why is compiler reordering different from CPU reordering?
    8. What is READ_ONCE()?
    9. What is WRITE_ONCE()?
    10. What is smp_mb()?
    11. What is smp_rmb()?
    12. What is smp_wmb()?
    13. How can missing barriers cause race conditions?
    14. What is false sharing?

    47. OOM – Out Of Memory

    1. What happens when Linux runs out of memory?
    2. What is OOM?
    3. What is OOM Killer?
    4. Why does Linux kill a process?
    5. How does Linux select a process?
    6. What is oom_score?
    7. What is oom_score_adj?
    8. How do you debug OOM?
    9. What is swap?
    10. Why might an embedded system disable swap?

    48. Swap

    1. What is swap?
    2. Why is swap used?
    3. What is swap partition?
    4. What is swap file?
    5. What happens during swapping?
    6. What is swap-in?
    7. What is swap-out?
    8. What is thrashing?
    9. Why is swap usually avoided in some embedded systems?

    49. Kernel Panic / Oops

    1. What is kernel panic?
    2. What is kernel Oops?
    3. Oops vs panic.
    4. What is NULL pointer dereference?
    5. What is use-after-free?
    6. What is stack overflow?
    7. What is kernel BUG?
    8. How do you debug a kernel crash?
    9. What is call trace?
    10. What is dmesg?
    11. What is addr2line?
    12. What is vmlinux?
    13. Why is debug information important?
    14. What is CONFIG_DEBUG_INFO?

    50. Linux Debugging

    1. How do you debug a Linux application?
    2. How do you debug a kernel?
    3. What is gdb?
    4. What is strace?
    5. What is ltrace?
    6. What is dmesg?
    7. What is ftrace?
    8. What is perf?
    9. What is top?
    10. What is htop?
    11. What is vmstat?
    12. What is iostat?
    13. What is sar?
    14. What is free?
    15. What is /proc/meminfo?
    16. What is /proc/cpuinfo?
    17. What is /proc/interrupts?
    18. What is /proc/<pid>/maps?
    19. What is /proc/<pid>/status?
    20. What is /proc/<pid>/fd/?

    51. Performance Debugging

    1. CPU usage is 100%. How do you debug?
    2. System is slow. What do you check?
    3. Memory usage is increasing continuously. What do you check?
    4. Process is blocked. How do you debug?
    5. High interrupt usage — what could cause it?
    6. High context switches — what could cause it?
    7. High CPU but low application workload — why?
    8. High I/O wait — what does it mean?
    9. What is perf?
    10. What is profiling?
    11. What is flame graph?
    12. What is tracing?
    13. Profiling vs tracing.

    52. Kernel Tracing

    1. What is ftrace?
    2. What is tracepoint?
    3. What is kprobe?
    4. What is kretprobe?
    5. What is eBPF?
    6. What is perf?
    7. What is function tracing?
    8. What is event tracing?
    9. How can you trace system calls?
    10. How can you trace scheduler events?

    53. eBPF

    For modern Linux interviews:

    1. What is eBPF?
    2. Why is eBPF useful?
    3. What can eBPF observe?
    4. eBPF vs kernel module.
    5. What is a BPF program?
    6. What is BPF map?
    7. What is verifier?
    8. How can eBPF help debugging?
    9. What is bpftrace?
    10. What is bpftool?

    54. Namespaces

    1. What are Linux namespaces?
    2. Why are namespaces used?
    3. What is PID namespace?
    4. Network namespace?
    5. Mount namespace?
    6. IPC namespace?
    7. UTS namespace?
    8. User namespace?
    9. Cgroup namespace?
    10. How do namespaces help containers?

    55. Cgroups

    1. What are cgroups?
    2. Why are cgroups used?
    3. CPU cgroup.
    4. Memory cgroup.
    5. I/O cgroup.
    6. What is resource limiting?
    7. What is resource accounting?
    8. Namespace vs cgroup.
    9. How do containers use namespaces and cgroups?

    56. Containers / Docker Internals

    1. What is a container?
    2. Container vs virtual machine.
    3. How does Linux support containers?
    4. Namespaces.
    5. Cgroups.
    6. Overlay filesystem.
    7. Capabilities.
    8. What is container isolation?
    9. What is PID namespace?
    10. What happens when a container starts?

    57. Linux Security Internals

    1. What is permission?
    2. What is UID?
    3. What is GID?
    4. Real UID vs effective UID.
    5. What is setuid?
    6. What are Linux capabilities?
    7. What is CAP_NET_ADMIN?
    8. What is CAP_SYS_ADMIN?
    9. What is DAC?
    10. What is MAC?
    11. What is SELinux?
    12. What is AppArmor?
    13. What is seccomp?
    14. What is ASLR?
    15. What is NX/DEP?

    58. Kernel Synchronization + Interrupt Scenario Questions

    Be ready for questions like:

    Q1

    ISR updates a variable and user thread reads it. What problem can occur?

    Q2

    Can you use mutex inside ISR?

    Q3

    Why use spinlock in interrupt context?

    Q4

    What happens if you call schedule() while holding a spinlock?

    Q5

    Why use a workqueue after an interrupt?

    Q6

    What happens if two CPUs access the same variable simultaneously?

    Q7

    How do memory barriers solve ordering problems?

    59. Linux Power Management

    Important for embedded systems.

    1. What is suspend?
    2. What is resume?
    3. What is system sleep?
    4. What is runtime PM?
    5. What is runtime suspend?
    6. What is runtime resume?
    7. What is wakeup source?
    8. What is autosuspend?
    9. What is CPU idle?
    10. What is CPU frequency scaling?
    11. What is cpufreq?
    12. What is cpuidle?
    13. How does a driver participate in suspend/resume?

    60. Embedded Linux Internals

    For your target profile, definitely prepare:

    1. Bootloader → kernel flow.
    2. Kernel → Device Tree.
    3. Device Tree → driver.
    4. Driver → hardware.
    5. Interrupt → driver.
    6. DMA → memory.
    7. User application → driver.
    8. Driver → sysfs.
    9. Driver → /dev.
    10. ALSA architecture.
    11. Linux audio pipeline.
    12. I2C/SPI/GPIO.
    13. Kernel configuration.
    14. Cross compilation.
    15. Root filesystem.
    16. Init/systemd.
    17. Yocto integration.
    18. Kernel module integration.
    19. Debugging boot failures.
    20. Debugging driver probe failures.

    61. ALSA / Audio Internals

    Since Automotive Linux/audio roles can ask this:

    1. What is ALSA?
    2. ALSA architecture.
    3. What is ALSA kernel layer?
    4. What is ALSA userspace library?
    5. What is PCM?
    6. What is PCM device?
    7. What is PCM playback?
    8. What is PCM capture?
    9. What is PCM buffer?
    10. What is period?
    11. What is period size?
    12. What is buffer size?
    13. What is sample rate?
    14. What is bit depth?
    15. What is channel count?
    16. What is ALSA driver?
    17. What is ASoC?
    18. What is codec driver?
    19. What is CPU DAI?
    20. What is codec DAI?
    21. What is DAPM?
    22. What is machine driver?
    23. What is audio routing?
    24. How does an ALSA application reach hardware?

    62. Linux Audio Stack

    Know this flow:

    Application
         ↓
    ALSA / PulseAudio / PipeWire
         ↓
    ALSA Kernel
         ↓
    ASoC
         ↓
    Machine Driver
         ↓
    CPU DAI
         ↓
    Codec / DSP
         ↓
    I2S / TDM
         ↓
    Audio Hardware

    Possible questions:

    Explain Linux audio architecture.

    What happens when an application plays audio?

    ALSA vs PulseAudio?

    What is ASoC?

    What is DAI?

    What is PCM?

    63. Driver + Linux Internals Scenario Questions

    These are extremely important for experienced interviews.

    Scenario 1

    Application calls read(). Explain everything that happens internally.

    Expected chain:

    Application
     ↓
    libc
     ↓
    system call
     ↓
    Kernel
     ↓
    VFS
     ↓
    file_operations
     ↓
    Driver read()
     ↓
    Hardware/buffer
     ↓
    copy_to_user()
     ↓
    Application

    Scenario 2

    Hardware generates an interrupt. Explain what happens.

    Hardware
     ↓
    Interrupt Controller
     ↓
    CPU
     ↓
    IRQ Entry
     ↓
    ISR
     ↓
    Schedule Deferred Work
     ↓
    Driver
     ↓
    Wake Waiting Process
     ↓
    Application

    Scenario 3

    Application writes to /dev/mydevice.

    Explain:

    open()
     ↓
    VFS
     ↓
    driver open()
    
    write()
     ↓
    VFS
     ↓
    driver write()
     ↓
    copy_from_user()
     ↓
    hardware

    Scenario 4

    Driver’s probe() isn’t getting called.

    Check:

    Device exists?
     ↓
    Correct bus?
     ↓
    Device Tree?
     ↓
    compatible?
     ↓
    Driver registered?
     ↓
    match table?
     ↓
    Kernel configuration?
     ↓
    probe()

    Scenario 5

    System randomly crashes after several hours.

    Think:

    Memory leak
     ↓
    Use-after-free
     ↓
    Race condition
     ↓
    Buffer overflow
     ↓
    DMA corruption
     ↓
    Stack overflow
     ↓
    Deadlock

    64. Top 50 Linux Internals Questions

    If you have limited interview preparation time, master these first:

    1. Linux architecture.
    2. Kernel space vs user space.
    3. Linux boot process.
    4. start_kernel().
    5. Process vs program.
    6. task_struct.
    7. fork().
    8. exec().
    9. clone().
    10. wait().
    11. Zombie vs orphan.
    12. Threads vs processes.
    13. Context switching.
    14. Scheduler.
    15. CFS.
    16. Real-time scheduling.
    17. System calls.
    18. User → kernel transition.
    19. Virtual memory.
    20. Page tables.
    21. MMU.
    22. TLB.
    23. Page fault.
    24. Copy-on-write.
    25. mmap().
    26. malloc() internals.
    27. Kernel memory allocation.
    28. Buddy allocator.
    29. SLAB/SLUB.
    30. Page cache.
    31. File descriptors.
    32. VFS.
    33. inode.
    34. dentry.
    35. superblock.
    36. open() internals.
    37. IPC.
    38. Signals.
    39. Shared memory.
    40. Mutex vs spinlock.
    41. Deadlock.
    42. Interrupt handling.
    43. Top half/bottom half.
    44. Workqueue.
    45. Device Tree.
    46. Device model.
    47. DMA.
    48. Kernel debugging.
    49. Kernel panic/Oops.
    50. Linux networking internals.

    65.What Interviewers Usually Do

    For an experienced Embedded Linux candidate, don’t expect only:

    “What is a mutex?”

    They may ask:

    “Suppose an ISR receives data into a ring buffer and a userspace application reads that data. Explain the complete design.”

    You should be able to discuss:

    Hardware
       ↓
    DMA
       ↓
    Ring Buffer
       ↓
    Interrupt
       ↓
    ISR / Threaded IRQ
       ↓
    Synchronization
       ↓
    Wait Queue
       ↓
    Driver read()
       ↓
    copy_to_user()
       ↓
    Application

    Then they may go deeper:

    Why DMA?
    Why ring buffer?
    Why spinlock?
    Can ISR sleep?
    Why wait queue?
    What happens if buffer is full?
    What happens if application is slow?
    How do you prevent race conditions?
    How do you handle cache coherency?
    How would you debug data corruption?

    That’s the level you should prepare for.

    Best preparation sequence

    For your Embedded Linux / Automotive Audio background, I’d study Linux internals in this order:

    1. Linux Architecture
           ↓
    2. Boot Process
           ↓
    3. Processes & Threads
           ↓
    4. Scheduling
           ↓
    5. System Calls
           ↓
    6. Virtual Memory
           ↓
    7. Memory Management
           ↓
    8. VFS & File Systems
           ↓
    9. File Descriptors
           ↓
    10. IPC
           ↓
    11. Signals
           ↓
    12. Synchronization
           ↓
    13. Interrupts
           ↓
    14. Workqueues / Kernel Threads
           ↓
    15. Device Model
           ↓
    16. Device Tree
           ↓
    17. Drivers
           ↓
    18. DMA
           ↓
    19. Networking
           ↓
    20. Power Management
           ↓
    21. Kernel Debugging
           ↓
    22. Performance / Tracing
           ↓
    23. ALSA / ASoC
           ↓
    24. Yocto + Kernel
           ↓
    25. Real-world Scenarios

    Linux Internals Interview Questions – Complete A–Z

    1. Linux Architecture

    1. What is Linux?
    2. What is the Linux kernel?
    3. Explain Linux architecture.
    4. What are the major components of Linux?
    5. What is kernel space?
    6. What is user space?
    7. Why are user space and kernel space separated?
    8. What happens when a user application starts?
    9. What happens when a Linux command is executed?
    10. What happens when you execute ./a.out?
    11. What is the role of the shell?
    12. What is the role of the kernel?
    13. What is GNU/Linux?
    14. What is monolithic kernel?
    15. Is Linux a monolithic kernel?
    16. What is a modular monolithic kernel?
    17. Monolithic vs microkernel.
    18. What are the advantages of Linux’s architecture?
    19. What are kernel subsystems?
    20. Explain the Linux kernel at a high level.

    Know this architecture

    User Applications
           ↓
    Libraries
           ↓
    System Calls
           ↓
    Linux Kernel
     ┌───────────────┐
     │ Process Mgmt  │
     │ Memory Mgmt   │
     │ VFS           │
     │ Networking    │
     │ IPC           │
     │ Drivers       │
     │ Scheduler     │
     └───────────────┘
           ↓
    Hardware

    2. Boot Process

    1. What happens when a Linux system powers ON?
    2. What is Boot ROM?
    3. What is firmware?
    4. What is a bootloader?
    5. What is U-Boot?
    6. What does U-Boot do?
    7. How does bootloader load the kernel?
    8. How does bootloader load Device Tree?
    9. What is Image?
    10. What is zImage?
    11. What is uImage?
    12. What is FIT image?
    13. What is initramfs?
    14. What is root filesystem?
    15. What is /sbin/init?
    16. What is systemd?
    17. What happens after kernel decompression?
    18. What is start_kernel()?
    19. What happens inside start_kernel()?
    20. How does Linux initialize devices?
    21. What are initcalls?
    22. What is early_initcall()?
    23. What is subsys_initcall()?
    24. What is module_init()?
    25. How does Linux finally start user space?

    Embedded Linux boot flow

    Power ON
       ↓
    Boot ROM
       ↓
    Bootloader
       ↓
    DRAM Initialization
       ↓
    Load Kernel
       ↓
    Load Device Tree
       ↓
    Kernel
       ↓
    start_kernel()
       ↓
    Kernel Initialization
       ↓
    Root Filesystem
       ↓
    init/systemd
       ↓
    User Applications

    3. Process Internals

    This is one of the most important Linux Internal topics.

    1. What is a process?
    2. What is a program?
    3. Program vs process.
    4. What happens when a process is created?
    5. What is PCB?
    6. What is task_struct?
    7. What information is stored in task_struct?
    8. What is PID?
    9. What is PPID?
    10. What is TGID?
    11. What is TID?
    12. What is a process ID namespace?
    13. What is process state?
    14. Explain:
    • Running
    • Runnable
    • Sleeping
    • Stopped
    • Zombie
    1. What is a zombie process?
    2. What is an orphan process?
    3. What happens to an orphan process?
    4. What is init/PID 1?
    5. What is fork()?
    6. What is vfork()?
    7. Difference between fork() and vfork().
    8. What is clone()?
    9. How does Linux create a process?
    10. What happens internally during fork()?
    11. What is exec()?
    12. Difference between fork() and exec().
    13. What is wait()?
    14. What is waitpid()?
    15. Why does a parent call wait()?
    16. What is process termination?
    17. What happens when exit() is called?
    18. What is _exit()?
    19. exit() vs _exit().
    20. What is process hierarchy?
    21. What is a process tree?
    22. What is pstree?
    23. What is process context?

    4. Threads

    1. What is a thread?
    2. Process vs thread.
    3. Why use threads?
    4. What resources are shared between threads?
    5. What resources are private to each thread?
    6. Do threads have separate address spaces?
    7. What is a kernel thread?
    8. User thread vs kernel thread.
    9. What is pthread_create()?
    10. What is pthread_join()?
    11. What is thread cancellation?
    12. What is thread-local storage?
    13. What is TLS?
    14. How does Linux implement threads?
    15. What is clone()?
    16. Why are Linux threads often described as tasks?
    17. What is a thread group?
    18. What is TGID?
    19. What is TID?

    5. CPU Scheduling

    Very frequently asked.

    1. What is process scheduling?
    2. Why do we need a scheduler?
    3. What is the Linux scheduler?
    4. What is context switching?
    5. What happens during a context switch?
    6. Process context vs interrupt context.
    7. What is preemptive scheduling?
    8. What is cooperative scheduling?
    9. What is scheduling latency?
    10. What is time slice?
    11. What is priority?
    12. What is nice value?
    13. What is nice?
    14. What is renice?
    15. What is CFS?
    16. What is the Completely Fair Scheduler?
    17. What is SCHED_NORMAL?
    18. What is SCHED_FIFO?
    19. What is SCHED_RR?
    20. What is SCHED_DEADLINE?
    21. FIFO vs Round Robin.
    22. Real-time scheduling vs normal scheduling.
    23. What is starvation?
    24. What is priority inversion?
    25. How is priority inversion handled?
    26. What is CPU affinity?
    27. What is taskset?
    28. What is CPU isolation?
    29. What is load balancing?
    30. How does Linux select the next task?
    31. What is a runqueue?
    32. What is scheduler tick?
    33. What is tickless Linux?
    34. What is CONFIG_NO_HZ?

    6. Context Switching

    1. What is context switching?
    2. Why does context switching happen?
    3. What is saved during context switch?
    4. What is restored?
    5. Process context switch vs thread context switch.
    6. What is register context?
    7. What is stack context?
    8. What is address-space switching?
    9. Why is context switching expensive?
    10. What happens to CPU cache during context switching?
    11. What is TLB?
    12. Does every context switch flush the TLB?
    13. How does ASID/PCID help?
    14. What is voluntary context switching?
    15. What is involuntary context switching?
    16. How can you measure context switches?

    7. System Calls

    One of the most important Linux internals topics.

    1. What is a system call?
    2. Why are system calls needed?
    3. User function vs system call.
    4. Library call vs system call.
    5. What happens internally when read() is called?
    6. What happens when write() is called?
    7. What happens when open() is called?
    8. What happens when fork() is called?
    9. What happens when execve() is called?
    10. What is system call number?
    11. How does kernel identify a system call?
    12. What is syscall entry?
    13. What is syscall return?
    14. What is trap instruction?
    15. What is privilege-level transition?
    16. What happens to CPU registers during syscall?
    17. How does user space return from kernel space?
    18. What is strace?
    19. How can strace help debug applications?
    20. Can user space directly call kernel functions?
    21. Why can’t user space access kernel memory directly?

    8. CPU Privilege Levels

    1. What is privilege?
    2. User mode vs kernel mode.
    3. What is ring 0?
    4. What is ring 3?
    5. Why does Linux use different privilege levels?
    6. What happens during user → kernel transition?
    7. What happens during kernel → user transition?
    8. What is a trap?
    9. What is an exception?
    10. What is an interrupt?
    11. Interrupt vs exception vs trap.

    9. Virtual Memory

    Extremely important.

    1. What is virtual memory?
    2. Why does Linux use virtual memory?
    3. Virtual address vs physical address.
    4. What is address space?
    5. What is process address space?
    6. What is virtual address space?
    7. What is page?
    8. What is page frame?
    9. What is page table?
    10. What is multi-level page table?
    11. Why are multi-level page tables used?
    12. What is MMU?
    13. What is TLB?
    14. Why do we need TLB?
    15. What is page fault?
    16. Minor vs major page fault.
    17. What happens during a page fault?
    18. What is demand paging?
    19. What is lazy allocation?
    20. What is copy-on-write?
    21. How does fork() use copy-on-write?
    22. What is memory mapping?
    23. What is mmap()?
    24. What is anonymous memory?
    25. What is file-backed memory?
    26. What is shared memory?
    27. What is private memory?
    28. What is memory overcommit?
    29. What is ASLR?
    30. What is memory protection?

    10. Process Address Space

    Know this diagram:

    High Address
    +------------------+
    | Kernel Space     |
    +------------------+
    | Stack            |
    |        ↓         |
    |                  |
    |        ↑         |
    | Heap             |
    +------------------+
    | BSS              |
    | Data             |
    | Text             |
    +------------------+
    Low Address

    Questions:

    1. What is text segment?
    2. What is data segment?
    3. What is BSS?
    4. What is heap?
    5. What is stack?
    6. Heap vs stack.
    7. Where are global variables stored?
    8. Where are static variables stored?
    9. Where are local variables stored?
    10. Where are string literals stored?
    11. What causes stack overflow?
    12. What is stack frame?
    13. What is function call stack?
    14. What is ASLR?
    15. How does shared library memory appear in process address space?

    11. Memory Allocation

    1. What is malloc()?
    2. What happens internally during malloc()?
    3. malloc() vs calloc().
    4. malloc() vs realloc().
    5. What is brk()?
    6. What is sbrk()?
    7. What is mmap() used for in memory allocation?
    8. How does glibc allocate memory?
    9. What is memory fragmentation?
    10. Internal vs external fragmentation.
    11. What is memory leak?
    12. How do you find memory leaks?
    13. What is valgrind?
    14. What is AddressSanitizer?
    15. What is double free?
    16. What is use-after-free?
    17. What is dangling pointer?

    12. Kernel Memory Management

    1. What is kmalloc()?
    2. What is kzalloc()?
    3. What is vmalloc()?
    4. kmalloc() vs vmalloc().
    5. What is GFP_KERNEL?
    6. What is GFP_ATOMIC?
    7. Why can’t GFP_KERNEL be used in interrupt context?
    8. What is the buddy allocator?
    9. What is SLAB?
    10. What is SLUB?
    11. What is SLOB?
    12. Why does Linux use slab allocation?
    13. What is an object cache?
    14. What is page allocator?
    15. What is high memory?
    16. What is low memory?
    17. What is physically contiguous memory?
    18. What is virtually contiguous memory?

    13. Buddy Allocator

    1. What is buddy system?
    2. Why is buddy allocator used?
    3. What is an order?
    4. What is an order-0 page?
    5. How does buddy splitting work?
    6. How does buddy merging work?
    7. What is external fragmentation?
    8. Why can’t large physically contiguous allocations always succeed?
    9. What is compaction?

    14. Slab / SLUB Allocator

    1. Why do we need slab allocator?
    2. What is a slab?
    3. What is a cache?
    4. What is an object?
    5. Slab vs page allocator.
    6. SLAB vs SLUB.
    7. Why is SLUB commonly used?
    8. What is kmem_cache_create()?
    9. What is kmem_cache_alloc()?
    10. What is kmem_cache_free()?

    15. Page Cache

    1. What is page cache?
    2. Why does Linux use page cache?
    3. How does read() interact with page cache?
    4. How does write() interact with page cache?
    5. What is buffered I/O?
    6. What is direct I/O?
    7. What is O_DIRECT?
    8. What is dirty page?
    9. What is writeback?
    10. What is fsync()?
    11. What is sync()?
    12. What is fdatasync()?
    13. What is writeback cache?
    14. What happens if RAM becomes full of cached data?

    16. File Descriptors

    1. What is a file descriptor?
    2. Why does Linux represent devices/files using file descriptors?
    3. What is FD 0?
    4. What is FD 1?
    5. What is FD 2?
    6. What happens when open() is called?
    7. What is a file descriptor table?
    8. What is an open file description?
    9. What is struct file?
    10. What is an inode?
    11. FD vs inode vs file.
    12. What happens when close() is called?
    13. What happens if two processes share an FD?
    14. What happens after fork()?
    15. What is dup()?
    16. What is dup2()?
    17. What is dup3()?
    18. What is FD inheritance?

    17. VFS – Virtual File System

    Very important for Linux internals.

    1. What is VFS?
    2. Why does Linux need VFS?
    3. What is a filesystem?
    4. What is an inode?
    5. What is a dentry?
    6. What is struct file?
    7. What is super_block?
    8. Explain:
    Process
       ↓
    System Call
       ↓
    VFS
       ↓
    Filesystem
       ↓
    Block Layer
       ↓
    Device Driver
       ↓
    Hardware
    1. What is inode cache?
    2. What is dentry cache?
    3. What is pathname lookup?
    4. What happens during open("/home/test.txt")?
    5. What is namei?
    6. What is mount?
    7. What is superblock?
    8. Hard link vs symbolic link.
    9. What happens when a file is deleted?
    10. Can a deleted file still be open?

    18. Filesystem Internals

    1. What is ext4?
    2. What is inode?
    3. What is directory entry?
    4. What is block?
    5. What is filesystem block size?
    6. What is journaling?
    7. Why is journaling needed?
    8. What happens after sudden power failure?
    9. What is fsck?
    10. What is mount?
    11. What is unmount?
    12. What is /etc/fstab?
    13. What is root filesystem?
    14. What is tmpfs?
    15. What is procfs?
    16. What is sysfs?
    17. What is devtmpfs?
    18. What is debugfs?
    19. What is overlayfs?
    20. What is NFS?

    19. IPC – Inter-Process Communication

    1. What is IPC?
    2. Why is IPC needed?
    3. What are the IPC mechanisms?
    4. Pipe
    5. FIFO
    6. Message queue
    7. Shared memory
    8. Semaphore
    9. Signal
    10. Socket
    11. Pipe vs FIFO.
    12. Message queue vs shared memory.
    13. Shared memory vs pipe.
    14. Which IPC mechanism is fastest?
    15. Why is shared memory fast?
    16. How do you synchronize shared memory?

    20. Pipes

    1. What is a pipe?
    2. How does pipe() work?
    3. Anonymous pipe vs named pipe.
    4. What is FIFO?
    5. What happens if pipe buffer is full?
    6. What happens if no reader exists?
    7. Is pipe unidirectional?
    8. How is pipe implemented inside kernel?

    21. Signals

    1. What is a signal?
    2. Why are signals used?
    3. What is SIGINT?
    4. SIGTERM vs SIGKILL.
    5. SIGSTOP vs SIGCONT.
    6. What is SIGSEGV?
    7. What is SIGCHLD?
    8. What happens when a signal is generated?
    9. What is signal handler?
    10. Can you catch SIGKILL?
    11. Can you catch SIGSTOP?
    12. Signal vs interrupt.
    13. What is signal masking?
    14. What is pending signal?
    15. What is blocked signal?
    16. What is sigaction()?
    17. Why is sigaction() preferred over old signal()?

    22. Shared Memory

    1. What is shared memory?
    2. Why is shared memory fast?
    3. What is mmap()?
    4. What is POSIX shared memory?
    5. What is System V shared memory?
    6. Shared memory synchronization.
    7. Can multiple processes write simultaneously?
    8. What happens without synchronization?
    9. Shared memory vs message queue.

    23. Synchronization

    1. What is synchronization?
    2. What is race condition?
    3. What is critical section?
    4. What is mutex?
    5. What is semaphore?
    6. What is spinlock?
    7. Mutex vs semaphore.
    8. Mutex vs spinlock.
    9. What is read-write lock?
    10. What is RCU?
    11. What is atomic operation?
    12. What is atomic_t?
    13. What is memory barrier?
    14. What is deadlock?
    15. What is livelock?
    16. What is starvation?
    17. What is priority inversion?
    18. How do you avoid deadlocks?
    19. What is lock ordering?
    20. Can a mutex be used in interrupt context?
    21. Can a spinlock be used in process context?
    22. Can you sleep while holding a spinlock?

    24. RCU

    For advanced interviews:

    1. What is RCU?
    2. Why was RCU introduced?
    3. Read-copy-update concept.
    4. Why is RCU useful for read-heavy workloads?
    5. What is an RCU read-side critical section?
    6. What is rcu_read_lock()?
    7. What is rcu_read_unlock()?
    8. What is synchronize_rcu()?
    9. RCU vs mutex.
    10. RCU vs spinlock.

    25. Deadlock

    1. What is deadlock?
    2. Four conditions for deadlock.
    3. Mutual exclusion.
    4. Hold and wait.
    5. No preemption.
    6. Circular wait.
    7. How do you prevent deadlock?
    8. How do you debug deadlock?
    9. What is lockdep?
    10. Give an example of kernel deadlock.

    26. Interrupts

    1. What is an interrupt?
    2. Hardware vs software interrupt.
    3. What is IRQ?
    4. What is ISR?
    5. Interrupt context.
    6. What happens when an interrupt occurs?
    7. What is interrupt controller?
    8. What is IRQ number?
    9. Shared IRQ.
    10. Edge-triggered vs level-triggered.
    11. What is interrupt affinity?
    12. What is interrupt storm?
    13. What is interrupt latency?
    14. What is top half?
    15. What is bottom half?
    16. What is threaded IRQ?
    17. What is tasklet?
    18. What is workqueue?
    19. Why can’t ISR sleep?
    20. What is request_irq()?
    21. What is free_irq()?

    27. Kernel Timers

    1. What is kernel timer?
    2. Why use kernel timers?
    3. What is timer callback?
    4. Can timer callback sleep?
    5. Timer vs workqueue.
    6. Timer vs delayed work.
    7. What happens if timer callback takes too long?
    8. How do you create a kernel timer?

    28. Workqueues

    1. What is workqueue?
    2. Why defer work?
    3. What is work_struct?
    4. What is schedule_work()?
    5. Can workqueue sleep?
    6. Workqueue vs tasklet.
    7. Workqueue vs kernel thread.
    8. What is ordered workqueue?
    9. What is dedicated workqueue?

    29. Kernel Threads

    1. What is a kernel thread?
    2. How is it different from a user thread?
    3. What is kthread_run()?
    4. What is kthread_stop()?
    5. Can kernel threads sleep?
    6. How does a kernel thread terminate?
    7. Why would a driver use a kernel thread?

    30. Networking Internals

    For Embedded Linux, prepare the basics.

    1. Explain Linux networking architecture.
    2. What happens when you run:
    ping 8.8.8.8
    1. What happens when an Ethernet frame arrives?
    2. What is NIC?
    3. What is network driver?
    4. What is net_device?
    5. What is socket?
    6. What is socket buffer (sk_buff)?
    7. What is TCP/IP stack?
    8. What is ARP?
    9. What is routing?
    10. What is IP address?
    11. MAC address vs IP address.
    12. TCP vs UDP.
    13. What is port?
    14. What is network namespace?
    15. What is NAPI?
    16. Why is NAPI required?
    17. Interrupt-driven RX vs polling.
    18. What is checksum offload?
    19. What is TSO?
    20. What is GRO?
    21. What is RSS?
    22. What is DMA in network drivers?

    31. Socket Internals

    1. What is a socket?
    2. What happens during socket()?
    3. What happens during bind()?
    4. What happens during listen()?
    5. What happens during accept()?
    6. What happens during connect()?
    7. What happens during send()?
    8. What happens during recv()?
    9. What is socket buffer?
    10. Blocking vs non-blocking socket.
    11. What is select()?
    12. What is poll()?
    13. What is epoll()?
    14. Why is epoll() efficient?
    15. Level-triggered vs edge-triggered.

    32. DMA

    1. What is DMA?
    2. Why use DMA?
    3. CPU copy vs DMA.
    4. What is DMA buffer?
    5. What is DMA mapping?
    6. What is DMA coherent memory?
    7. What is cache coherency?
    8. dma_map_single().
    9. dma_unmap_single().
    10. dma_alloc_coherent().
    11. Streaming DMA vs coherent DMA.
    12. What is DMA mask?
    13. What is IOMMU?
    14. CPU cache vs DMA.
    15. What happens if cache isn’t synchronized?

    33. Device Model

    1. What is Linux device model?
    2. What is a device?
    3. What is a driver?
    4. What is a bus?
    5. What is a class?
    6. What is kobject?
    7. What is sysfs?
    8. What is device binding?
    9. What is driver binding?
    10. Explain:
    Bus
     ├── Device
     └── Driver
    1. What is struct device?
    2. What is reference counting?
    3. What is kref?
    4. What is hotplug?
    5. What is uevent?
    6. What is udev?

    34. Device Tree

    1. What is Device Tree?
    2. Why do we need Device Tree?
    3. DTS vs DTSI.
    4. DTS vs DTB.
    5. What is DTBO?
    6. What is a node?
    7. What is a property?
    8. What is compatible?
    9. What is reg?
    10. What is interrupts?
    11. What is clocks?
    12. What is gpios?
    13. What is status?
    14. What is phandle?
    15. What is Device Tree overlay?
    16. How does Device Tree bind to a driver?
    17. What is of_match_table?
    18. What is of_device_id?
    19. What is probe()?
    20. How does the kernel discover hardware from Device Tree?

    35. Kernel Modules

    1. What is kernel module?
    2. Why use modules?
    3. Built-in vs module.
    4. What is .ko?
    5. What is insmod?
    6. What is modprobe?
    7. What is rmmod?
    8. What is lsmod?
    9. What is modinfo?
    10. What is module dependency?
    11. What is symbol export?
    12. What is EXPORT_SYMBOL()?
    13. What is EXPORT_SYMBOL_GPL()?
    14. What happens during module loading?
    15. What happens during unloading?
    16. Why can a module fail to unload?
    17. What is module reference count?

    36. Sysfs / Procfs / Debugfs

    1. What is sysfs?
    2. What is procfs?
    3. What is debugfs?
    4. Difference between them.
    5. What information is exposed through /proc?
    6. What information is exposed through /sys?
    7. Why shouldn’t debugfs be used as a stable application interface?
    8. How does a driver create a sysfs attribute?
    9. What are show() and store()?
    10. What is DEVICE_ATTR()?

    37. Kernel Synchronization Context

    Interviewers love scenario questions:

    Q: Can you sleep here?

    Prepare answers for:

    ContextCan Sleep?
    User processYes
    Kernel process contextYes
    Kernel threadYes
    Interrupt handlerNo
    Timer callbackNo
    Spinlock-held contextNo
    Atomic contextNo

    Then expect:

    Why?

    What API can you use instead?

    Which GFP flag should you use?

    38. ELF & Program Loading

    1. What is ELF?
    2. What is an ELF executable?
    3. What is an ELF header?
    4. What is a program header?
    5. What is a section header?
    6. What is .text?
    7. What is .data?
    8. What is .bss?
    9. What is symbol table?
    10. What is relocation?
    11. What is dynamic linking?
    12. What is static linking?
    13. Static vs dynamic linking.
    14. What is a shared library?
    15. What is .so?
    16. What is the dynamic linker?
    17. What is ld.so?
    18. What happens when you execute an ELF binary?
    19. What is ASLR?
    20. What is PIE?

    39. Dynamic Linking

    1. Static vs dynamic library.
    2. What is .so?
    3. What is LD_LIBRARY_PATH?
    4. What is ldconfig?
    5. What is dynamic linker?
    6. What is symbol resolution?
    7. What is PLT?
    8. What is GOT?
    9. What is lazy binding?
    10. What is LD_PRELOAD?

    40. IPC + Synchronization Scenarios

    Prepare scenarios like:

    Two processes access the same shared buffer. How will you synchronize?

    Producer produces data faster than consumer. What happens?

    Consumer waits until data arrives. What IPC/synchronization mechanism would you use?

    Multiple threads update the same variable. What can go wrong?

    An interrupt updates a buffer while a process reads it. How will you protect it?

    41. Blocking & Non-Blocking I/O

    1. What is blocking I/O?
    2. What is non-blocking I/O?
    3. What is O_NONBLOCK?
    4. What happens when read() has no data?
    5. What is EAGAIN?
    6. What is EWOULDBLOCK?
    7. How does poll() work?
    8. How does select() work?
    9. How does epoll() work?
    10. Blocking vs polling.
    11. Blocking read vs interrupt-driven design.

    42. select() / poll() / epoll()

    1. Why do we need I/O multiplexing?
    2. What is select()?
    3. What is poll()?
    4. What is epoll()?
    5. select() vs poll().
    6. poll() vs epoll().
    7. Why is epoll() more scalable?
    8. Level-triggered vs edge-triggered.
    9. What is EPOLLIN?
    10. What is EPOLLOUT?
    11. What is EPOLLERR?
    12. How does a device driver implement poll()?

    43. Signals vs Interrupts

    Very common conceptual question.

    InterruptSignal
    Hardware/kernel eventProcess notification
    Usually handled by kernel/ISRDelivered to process
    CPU/hardware relatedProcess related
    Example GPIO interruptSIGTERM

    Questions:

    1. Difference between interrupt and signal.
    2. Can a process generate a signal?
    3. Can kernel generate a signal?
    4. What is hardware interrupt?
    5. What is software interrupt?

    44. Time Management

    1. What is system clock?
    2. What is clock tick?
    3. What is jiffies?
    4. What is HZ?
    5. What is monotonic clock?
    6. What is realtime clock?
    7. Difference between CLOCK_REALTIME and CLOCK_MONOTONIC.
    8. What is high-resolution timer?
    9. What is timer interrupt?
    10. What is nanosleep()?
    11. What is clock_nanosleep()?
    12. Why is CLOCK_MONOTONIC preferred for measuring elapsed time?

    45. SMP / Multicore Linux

    1. What is SMP?
    2. What is multicore?
    3. How does Linux handle multiple CPUs?
    4. What is CPU affinity?
    5. What is per-CPU data?
    6. Why use per-CPU variables?
    7. What is cache coherence?
    8. What is cache line?
    9. What is false sharing?
    10. What is CPU migration?
    11. What is load balancing?
    12. What is NUMA?
    13. What is memory barrier?
    14. Why are locks more important on SMP?

    46. Cache & Memory Ordering

    For senior Embedded Linux roles:

    1. What is CPU cache?
    2. L1/L2/L3 cache.
    3. What is cache line?
    4. What is cache coherence?
    5. What is memory ordering?
    6. What is memory barrier?
    7. Why is compiler reordering different from CPU reordering?
    8. What is READ_ONCE()?
    9. What is WRITE_ONCE()?
    10. What is smp_mb()?
    11. What is smp_rmb()?
    12. What is smp_wmb()?
    13. How can missing barriers cause race conditions?
    14. What is false sharing?

    47. OOM – Out Of Memory

    1. What happens when Linux runs out of memory?
    2. What is OOM?
    3. What is OOM Killer?
    4. Why does Linux kill a process?
    5. How does Linux select a process?
    6. What is oom_score?
    7. What is oom_score_adj?
    8. How do you debug OOM?
    9. What is swap?
    10. Why might an embedded system disable swap?

    48. Swap

    1. What is swap?
    2. Why is swap used?
    3. What is swap partition?
    4. What is swap file?
    5. What happens during swapping?
    6. What is swap-in?
    7. What is swap-out?
    8. What is thrashing?
    9. Why is swap usually avoided in some embedded systems?

    49. Kernel Panic / Oops

    1. What is kernel panic?
    2. What is kernel Oops?
    3. Oops vs panic.
    4. What is NULL pointer dereference?
    5. What is use-after-free?
    6. What is stack overflow?
    7. What is kernel BUG?
    8. How do you debug a kernel crash?
    9. What is call trace?
    10. What is dmesg?
    11. What is addr2line?
    12. What is vmlinux?
    13. Why is debug information important?
    14. What is CONFIG_DEBUG_INFO?

    50. Linux Debugging

    1. How do you debug a Linux application?
    2. How do you debug a kernel?
    3. What is gdb?
    4. What is strace?
    5. What is ltrace?
    6. What is dmesg?
    7. What is ftrace?
    8. What is perf?
    9. What is top?
    10. What is htop?
    11. What is vmstat?
    12. What is iostat?
    13. What is sar?
    14. What is free?
    15. What is /proc/meminfo?
    16. What is /proc/cpuinfo?
    17. What is /proc/interrupts?
    18. What is /proc/<pid>/maps?
    19. What is /proc/<pid>/status?
    20. What is /proc/<pid>/fd/?

    51. Performance Debugging

    1. CPU usage is 100%. How do you debug?
    2. System is slow. What do you check?
    3. Memory usage is increasing continuously. What do you check?
    4. Process is blocked. How do you debug?
    5. High interrupt usage — what could cause it?
    6. High context switches — what could cause it?
    7. High CPU but low application workload — why?
    8. High I/O wait — what does it mean?
    9. What is perf?
    10. What is profiling?
    11. What is flame graph?
    12. What is tracing?
    13. Profiling vs tracing.

    52. Kernel Tracing

    1. What is ftrace?
    2. What is tracepoint?
    3. What is kprobe?
    4. What is kretprobe?
    5. What is eBPF?
    6. What is perf?
    7. What is function tracing?
    8. What is event tracing?
    9. How can you trace system calls?
    10. How can you trace scheduler events?

    53. eBPF

    For modern Linux interviews:

    1. What is eBPF?
    2. Why is eBPF useful?
    3. What can eBPF observe?
    4. eBPF vs kernel module.
    5. What is a BPF program?
    6. What is BPF map?
    7. What is verifier?
    8. How can eBPF help debugging?
    9. What is bpftrace?
    10. What is bpftool?

    54. Namespaces

    1. What are Linux namespaces?
    2. Why are namespaces used?
    3. What is PID namespace?
    4. Network namespace?
    5. Mount namespace?
    6. IPC namespace?
    7. UTS namespace?
    8. User namespace?
    9. Cgroup namespace?
    10. How do namespaces help containers?

    55. Cgroups

    1. What are cgroups?
    2. Why are cgroups used?
    3. CPU cgroup.
    4. Memory cgroup.
    5. I/O cgroup.
    6. What is resource limiting?
    7. What is resource accounting?
    8. Namespace vs cgroup.
    9. How do containers use namespaces and cgroups?

    56. Containers / Docker Internals

    1. What is a container?
    2. Container vs virtual machine.
    3. How does Linux support containers?
    4. Namespaces.
    5. Cgroups.
    6. Overlay filesystem.
    7. Capabilities.
    8. What is container isolation?
    9. What is PID namespace?
    10. What happens when a container starts?

    57. Linux Security Internals

    1. What is permission?
    2. What is UID?
    3. What is GID?
    4. Real UID vs effective UID.
    5. What is setuid?
    6. What are Linux capabilities?
    7. What is CAP_NET_ADMIN?
    8. What is CAP_SYS_ADMIN?
    9. What is DAC?
    10. What is MAC?
    11. What is SELinux?
    12. What is AppArmor?
    13. What is seccomp?
    14. What is ASLR?
    15. What is NX/DEP?

    58. Kernel Synchronization + Interrupt Scenario Questions

    Be ready for questions like:

    Q1

    ISR updates a variable and user thread reads it. What problem can occur?

    Q2

    Can you use mutex inside ISR?

    Q3

    Why use spinlock in interrupt context?

    Q4

    What happens if you call schedule() while holding a spinlock?

    Q5

    Why use a workqueue after an interrupt?

    Q6

    What happens if two CPUs access the same variable simultaneously?

    Q7

    How do memory barriers solve ordering problems?

    59. Linux Power Management

    Important for embedded systems.

    1. What is suspend?
    2. What is resume?
    3. What is system sleep?
    4. What is runtime PM?
    5. What is runtime suspend?
    6. What is runtime resume?
    7. What is wakeup source?
    8. What is autosuspend?
    9. What is CPU idle?
    10. What is CPU frequency scaling?
    11. What is cpufreq?
    12. What is cpuidle?
    13. How does a driver participate in suspend/resume?

    60. Embedded Linux Internals

    For your target profile, definitely prepare:

    1. Bootloader → kernel flow.
    2. Kernel → Device Tree.
    3. Device Tree → driver.
    4. Driver → hardware.
    5. Interrupt → driver.
    6. DMA → memory.
    7. User application → driver.
    8. Driver → sysfs.
    9. Driver → /dev.
    10. ALSA architecture.
    11. Linux audio pipeline.
    12. I2C/SPI/GPIO.
    13. Kernel configuration.
    14. Cross compilation.
    15. Root filesystem.
    16. Init/systemd.
    17. Yocto integration.
    18. Kernel module integration.
    19. Debugging boot failures.
    20. Debugging driver probe failures.

    61. ALSA / Audio Internals

    Since Automotive Linux/audio roles can ask this:

    1. What is ALSA?
    2. ALSA architecture.
    3. What is ALSA kernel layer?
    4. What is ALSA userspace library?
    5. What is PCM?
    6. What is PCM device?
    7. What is PCM playback?
    8. What is PCM capture?
    9. What is PCM buffer?
    10. What is period?
    11. What is period size?
    12. What is buffer size?
    13. What is sample rate?
    14. What is bit depth?
    15. What is channel count?
    16. What is ALSA driver?
    17. What is ASoC?
    18. What is codec driver?
    19. What is CPU DAI?
    20. What is codec DAI?
    21. What is DAPM?
    22. What is machine driver?
    23. What is audio routing?
    24. How does an ALSA application reach hardware?

    62. Linux Audio Stack

    Know this flow:

    Application
         ↓
    ALSA / PulseAudio / PipeWire
         ↓
    ALSA Kernel
         ↓
    ASoC
         ↓
    Machine Driver
         ↓
    CPU DAI
         ↓
    Codec / DSP
         ↓
    I2S / TDM
         ↓
    Audio Hardware

    Possible questions:

    Explain Linux audio architecture.

    What happens when an application plays audio?

    ALSA vs PulseAudio?

    What is ASoC?

    What is DAI?

    What is PCM?

    63. Driver + Linux Internals Scenario Questions

    These are extremely important for experienced interviews.

    Scenario 1

    Application calls read(). Explain everything that happens internally.

    Expected chain:

    Application
     ↓
    libc
     ↓
    system call
     ↓
    Kernel
     ↓
    VFS
     ↓
    file_operations
     ↓
    Driver read()
     ↓
    Hardware/buffer
     ↓
    copy_to_user()
     ↓
    Application

    Scenario 2

    Hardware generates an interrupt. Explain what happens.

    Hardware
     ↓
    Interrupt Controller
     ↓
    CPU
     ↓
    IRQ Entry
     ↓
    ISR
     ↓
    Schedule Deferred Work
     ↓
    Driver
     ↓
    Wake Waiting Process
     ↓
    Application

    Scenario 3

    Application writes to /dev/mydevice.

    Explain:

    open()
     ↓
    VFS
     ↓
    driver open()
    
    write()
     ↓
    VFS
     ↓
    driver write()
     ↓
    copy_from_user()
     ↓
    hardware

    Scenario 4

    Driver’s probe() isn’t getting called.

    Check:

    Device exists?
     ↓
    Correct bus?
     ↓
    Device Tree?
     ↓
    compatible?
     ↓
    Driver registered?
     ↓
    match table?
     ↓
    Kernel configuration?
     ↓
    probe()

    Scenario 5

    System randomly crashes after several hours.

    Think:

    Memory leak
     ↓
    Use-after-free
     ↓
    Race condition
     ↓
    Buffer overflow
     ↓
    DMA corruption
     ↓
    Stack overflow
     ↓
    Deadlock

    64. Top 50 Linux Internals Questions

    If you have limited interview preparation time, master these first:

    1. Linux architecture.
    2. Kernel space vs user space.
    3. Linux boot process.
    4. start_kernel().
    5. Process vs program.
    6. task_struct.
    7. fork().
    8. exec().
    9. clone().
    10. wait().
    11. Zombie vs orphan.
    12. Threads vs processes.
    13. Context switching.
    14. Scheduler.
    15. CFS.
    16. Real-time scheduling.
    17. System calls.
    18. User → kernel transition.
    19. Virtual memory.
    20. Page tables.
    21. MMU.
    22. TLB.
    23. Page fault.
    24. Copy-on-write.
    25. mmap().
    26. malloc() internals.
    27. Kernel memory allocation.
    28. Buddy allocator.
    29. SLAB/SLUB.
    30. Page cache.
    31. File descriptors.
    32. VFS.
    33. inode.
    34. dentry.
    35. superblock.
    36. open() internals.
    37. IPC.
    38. Signals.
    39. Shared memory.
    40. Mutex vs spinlock.
    41. Deadlock.
    42. Interrupt handling.
    43. Top half/bottom half.
    44. Workqueue.
    45. Device Tree.
    46. Device model.
    47. DMA.
    48. Kernel debugging.
    49. Kernel panic/Oops.
    50. Linux networking internals.

    65.What Interviewers Usually Do

    For an experienced Embedded Linux candidate, don’t expect only:

    “What is a mutex?”

    They may ask:

    “Suppose an ISR receives data into a ring buffer and a userspace application reads that data. Explain the complete design.”

    You should be able to discuss:

    Hardware
       ↓
    DMA
       ↓
    Ring Buffer
       ↓
    Interrupt
       ↓
    ISR / Threaded IRQ
       ↓
    Synchronization
       ↓
    Wait Queue
       ↓
    Driver read()
       ↓
    copy_to_user()
       ↓
    Application

    Then they may go deeper:

    Why DMA?
    Why ring buffer?
    Why spinlock?
    Can ISR sleep?
    Why wait queue?
    What happens if buffer is full?
    What happens if application is slow?
    How do you prevent race conditions?
    How do you handle cache coherency?
    How would you debug data corruption?

    That’s the level you should prepare for.

    Best preparation sequence

    For your Embedded Linux / Automotive Audio background, I’d study Linux internals in this order:

    1. Linux Architecture
           ↓
    2. Boot Process
           ↓
    3. Processes & Threads
           ↓
    4. Scheduling
           ↓
    5. System Calls
           ↓
    6. Virtual Memory
           ↓
    7. Memory Management
           ↓
    8. VFS & File Systems
           ↓
    9. File Descriptors
           ↓
    10. IPC
           ↓
    11. Signals
           ↓
    12. Synchronization
           ↓
    13. Interrupts
           ↓
    14. Workqueues / Kernel Threads
           ↓
    15. Device Model
           ↓
    16. Device Tree
           ↓
    17. Drivers
           ↓
    18. DMA
           ↓
    19. Networking
           ↓
    20. Power Management
           ↓
    21. Kernel Debugging
           ↓
    22. Performance / Tracing
           ↓
    23. ALSA / ASoC
           ↓
    24. Yocto + Kernel
           ↓
    25. Real-world Scenarios

    Linux Kernel Programming – Complete Interview Question Bank

    1. Linux Kernel Programming Basics

    1. What is Linux kernel programming?
    2. How is kernel programming different from normal C programming?
    3. What is kernel space?
    4. What is user space?
    5. Why can’t kernel code use normal user-space APIs?
    6. Can kernel code use printf()?
    7. What is printk()?
    8. What are pr_info(), pr_err(), pr_warn(), and pr_debug()?
    9. What is a kernel module?
    10. What is an LKM?
    11. Why are kernel modules used?
    12. Built-in code vs loadable module.
    13. What is a .ko file?
    14. What happens when a .ko file is loaded?
    15. What happens when a module is unloaded?
    16. What is insmod?
    17. What is rmmod?
    18. What is modprobe?
    19. Difference between insmod and modprobe.
    20. What is lsmod?
    21. What is modinfo?
    22. What is module dependency?
    23. What is module reference counting?
    24. Why can a module fail to unload?

    2. Kernel Module Programming

    Questions

    1. What is module_init()?
    2. What is module_exit()?
    3. What happens inside module initialization?
    4. What happens inside module cleanup?
    5. Can a kernel module have multiple module_init() functions?
    6. What is MODULE_LICENSE()?
    7. Why is module licensing important?
    8. What is MODULE_AUTHOR()?
    9. What is MODULE_DESCRIPTION()?
    10. What is MODULE_VERSION()?
    11. What is MODULE_DEVICE_TABLE()?
    12. What is EXPORT_SYMBOL()?
    13. What is EXPORT_SYMBOL_GPL()?
    14. Difference between them.
    15. What is a kernel symbol?
    16. What is symbol resolution?
    17. What causes an “Unknown symbol” error?
    18. What happens if a module depends on another module?
    19. How does the kernel resolve module dependencies?
    20. What is modprobe doing internally?

    Basic structure

    #include <linux/module.h>
    #include <linux/kernel.h>
    
    static int __init my_init(void)
    {
        pr_info("Driver loaded\n");
        return 0;
    }
    
    static void __exit my_exit(void)
    {
        pr_info("Driver unloaded\n");
    }
    
    module_init(my_init);
    module_exit(my_exit);
    
    MODULE_LICENSE("GPL");

    Interviewers may ask you to write this from memory.

    3. Kernel Build System

    1. How do you compile a kernel module?
    2. What is a kernel Makefile?
    3. What is Kbuild?
    4. What is Kconfig?
    5. What is .config?
    6. What is CONFIG_xxx?
    7. Difference between:
    CONFIG_xxx=y
    CONFIG_xxx=m
    CONFIG_xxx=n
    1. What does obj-m mean?
    2. What does obj-y mean?
    3. How do you build an external module?
    4. What is KDIR?
    5. What is ARCH?
    6. What is CROSS_COMPILE?
    7. Why must a module be built against the correct kernel?
    8. What is vermagic?
    9. What happens if kernel and module versions don’t match?
    10. What are kernel headers?
    11. Difference between userspace headers and kernel headers.
    12. How do you cross-compile a kernel module?
    13. How do you add a driver to the Linux kernel source tree?

    4. Kernel Data Types

    1. What is u8?
    2. What is u16?
    3. What is u32?
    4. What is u64?
    5. What is s32?
    6. What is size_t?
    7. What is ssize_t?
    8. What is phys_addr_t?
    9. What is dma_addr_t?
    10. What is dev_t?
    11. What is pid_t?
    12. What is atomic_t?
    13. Why does kernel code use its own data types?
    14. Why should you avoid assuming int is always a particular size?

    5. Kernel Memory Programming

    This is one of the highest-priority areas.

    Allocation

    1. What is kmalloc()?
    2. What is kzalloc()?
    3. What is kcalloc()?
    4. What is krealloc()?
    5. What is kfree()?
    6. What is vmalloc()?
    7. What is vzalloc()?
    8. What is vfree()?
    9. kmalloc() vs vmalloc().
    10. What does “physically contiguous” mean?
    11. What does “virtually contiguous” mean?
    12. Why is kmalloc() physically contiguous?
    13. Why is vmalloc() only virtually contiguous?
    14. Which is faster: kmalloc() or vmalloc()?
    15. When would you use each?

    GFP flags

    1. What is GFP?
    2. What is GFP_KERNEL?
    3. What is GFP_ATOMIC?
    4. What is GFP_NOWAIT?
    5. Why can’t GFP_KERNEL be used in interrupt context?
    6. Why is GFP_ATOMIC needed?
    7. What does it mean for an allocation to sleep?

    Advanced

    1. What is the buddy allocator?
    2. What is SLAB?
    3. What is SLUB?
    4. Why does the kernel use slab allocation?
    5. What is a slab cache?
    6. What is kmem_cache_create()?
    7. What is kmem_cache_alloc()?
    8. What is kmem_cache_free()?
    9. What is memory fragmentation?
    10. What is a memory leak?
    11. What is use-after-free?
    12. What is double-free?
    13. How do you detect kernel memory leaks?

    6. copy_to_user() / copy_from_user()

    1. Why can’t you directly access user memory from kernel code?
    2. What is copy_to_user()?
    3. What is copy_from_user()?
    4. Difference between memcpy() and copy_to_user().
    5. What does copy_to_user() return?
    6. What does copy_from_user() return?
    7. What happens if the user passes an invalid pointer?
    8. What is access_ok()?
    9. Why is validating user input important?
    10. Can copy_to_user() sleep?
    11. Can you call it from interrupt context?

    7. Kernel Pointers

    1. What is a kernel virtual address?
    2. What is a physical address?
    3. What is a user virtual address?
    4. What is virt_to_phys()?
    5. What is phys_to_virt()?
    6. What is ioremap()?
    7. Why is ioremap() required?
    8. What is __iomem?
    9. What is IS_ERR()?
    10. What is PTR_ERR()?
    11. What is ERR_PTR()?
    12. NULL pointer vs ERR_PTR.
    13. Why are kernel error pointers used?

    8. Character Driver Programming

    1. What is a character driver?
    2. How do you create a character driver?
    3. What is struct cdev?
    4. What is struct file_operations?
    5. What is struct inode?
    6. What is struct file?
    7. Difference between inode and file.
    8. What is dev_t?
    9. What is major number?
    10. What is minor number?
    11. What is alloc_chrdev_region()?
    12. What is register_chrdev_region()?
    13. Difference between them.
    14. What is cdev_init()?
    15. What is cdev_add()?
    16. What is cdev_del()?
    17. What is class_create()?
    18. What is device_create()?
    19. Who creates /dev/mydevice?
    20. What is udev?
    21. What is devtmpfs?
    22. How does /dev/mydevice connect to your driver?
    23. How does open() reach the driver?
    24. How does read() reach the driver?
    25. How does write() reach the driver?
    26. How does close() reach the driver?

    Flow

    Application
         ↓
    open("/dev/mydevice")
         ↓
    VFS
         ↓
    file_operations
         ↓
    driver->open()

    9. file_operations

    Prepare every callback:

    1. What is .open?
    2. What is .release?
    3. What is .read?
    4. What is .write?
    5. What is .unlocked_ioctl?
    6. What is .compat_ioctl?
    7. What is .mmap?
    8. What is .poll?
    9. What is .llseek?
    10. What is .fasync?
    11. What is .fsync?
    12. What is .read_iter?
    13. What is .write_iter?
    14. What is private_data?
    15. How do you store per-device data in private_data?

    10. ioctl

    1. What is ioctl?
    2. Why use ioctl?
    3. When should you use ioctl instead of read/write?
    4. What is _IO()?
    5. What is _IOR()?
    6. What is _IOW()?
    7. What is _IOWR()?
    8. What is an ioctl command number?
    9. How is data passed between userspace and kernel?
    10. Why should ioctl arguments be validated?
    11. How do you pass a structure through ioctl?
    12. What security problems can ioctl create?
    13. What is 32-bit/64-bit compatibility in ioctl?
    14. What is .compat_ioctl?

    11. Blocking & Non-Blocking I/O

    1. What is blocking I/O?
    2. What is non-blocking I/O?
    3. What is O_NONBLOCK?
    4. What happens when read() has no data?
    5. What is EAGAIN?
    6. What is EWOULDBLOCK?
    7. How do you implement blocking read in a driver?
    8. How do you implement non-blocking read?
    9. What is a wait queue?
    10. Why do drivers put processes to sleep?
    11. How does the driver wake the process?

    12. Wait Queues

    1. What is a wait queue?
    2. Why are wait queues required?
    3. What is wait_event()?
    4. What is wait_event_interruptible()?
    5. What is wait_event_timeout()?
    6. What is wake_up()?
    7. What is wake_up_interruptible()?
    8. What is the wait condition?
    9. Why must the condition be checked again after waking?
    10. What is a spurious wakeup?
    11. How would you implement a blocking read() using a wait queue?

    Typical design

    Application
        ↓
    read()
        ↓
    Data unavailable
        ↓
    wait_event()
        ↓
    Process sleeps
        ↓
    Hardware interrupt
        ↓
    Data arrives
        ↓
    wake_up()
        ↓
    read() continues

    13. Poll / Select / Epoll

    1. Why does a driver implement poll()?
    2. What is poll_wait()?
    3. How does select() work?
    4. How does poll() work?
    5. How does epoll() work?
    6. select() vs poll().
    7. poll() vs epoll().
    8. Level-triggered vs edge-triggered.
    9. What is POLLIN?
    10. What is POLLOUT?
    11. What is POLLERR?
    12. How does a driver notify userspace that data is available?

    14. Interrupt Programming

    1. What is an interrupt?
    2. What is IRQ?
    3. What is ISR?
    4. What is interrupt context?
    5. What is request_irq()?
    6. What is free_irq()?
    7. What is irqreturn_t?
    8. What is IRQ_HANDLED?
    9. What is IRQ_NONE?
    10. What is shared IRQ?
    11. What is IRQF_SHARED?
    12. Edge vs level triggered interrupt.
    13. What is interrupt affinity?
    14. What is interrupt latency?
    15. Why can’t an ISR sleep?
    16. Can you call kmalloc(GFP_KERNEL) from ISR?
    17. Can you acquire a mutex inside ISR?
    18. Can you use a spinlock inside ISR?
    19. What is threaded IRQ?
    20. What is request_threaded_irq()?

    15. Top Half / Bottom Half

    1. What is top half?
    2. What is bottom half?
    3. Why do we defer interrupt work?
    4. What is tasklet?
    5. What is workqueue?
    6. What is threaded interrupt?
    7. Tasklet vs workqueue.
    8. Workqueue vs threaded IRQ.
    9. Which can sleep?
    10. Which runs in interrupt context?
    11. When would you choose each mechanism?

    Simple idea

    Hardware Interrupt
           ↓
        Top Half
           ↓
      Quick processing
           ↓
       Bottom Half
           ↓
    Longer processing

    16. Spinlocks

    1. What is spinlock?
    2. Why do we need spinlocks?
    3. What is spin_lock()?
    4. What is spin_unlock()?
    5. What is spin_lock_irqsave()?
    6. What is spin_unlock_irqrestore()?
    7. Why disable interrupts while taking some spinlocks?
    8. Can a spinlock holder sleep?
    9. What happens if it does?
    10. Spinlock vs mutex.
    11. Spinlock vs semaphore.
    12. What is spinlock contention?
    13. What is recursive spinlock acquisition?
    14. What is deadlock with spinlocks?

    17. Mutex

    1. What is a mutex?
    2. Why use mutex?
    3. mutex_lock().
    4. mutex_unlock().
    5. Can mutex sleep?
    6. Can mutex be used in interrupt context?
    7. Mutex vs spinlock.
    8. Mutex vs semaphore.
    9. Recursive mutex?
    10. What happens if a process dies while holding a mutex?
    11. What is priority inversion?

    18. Semaphores

    1. What is semaphore?
    2. Binary semaphore vs counting semaphore.
    3. Semaphore vs mutex.
    4. What is down()?
    5. What is up()?
    6. Can semaphore sleep?
    7. Can semaphore be used in interrupt context?
    8. When would you choose semaphore?

    19. Atomic Operations

    1. What is an atomic operation?
    2. Why do we need atomic operations?
    3. What is atomic_t?
    4. What is atomic_read()?
    5. What is atomic_set()?
    6. What is atomic_inc()?
    7. What is atomic_dec()?
    8. What is atomic_add()?
    9. Atomic variable vs mutex.
    10. When should you use atomic operations?

    20. Memory Barriers

    1. What is memory ordering?
    2. What is a memory barrier?
    3. Why are memory barriers required on SMP?
    4. What is compiler reordering?
    5. What is CPU reordering?
    6. What is mb()?
    7. What is rmb()?
    8. What is wmb()?
    9. What is smp_mb()?
    10. What is READ_ONCE()?
    11. What is WRITE_ONCE()?
    12. Give a real race condition where a memory barrier is needed.

    21. Kernel Linked Lists

    1. Why does Linux use linked lists?
    2. What is struct list_head?
    3. What is an intrusive linked list?
    4. INIT_LIST_HEAD().
    5. list_add().
    6. list_add_tail().
    7. list_del().
    8. list_for_each().
    9. list_for_each_entry().
    10. What is container_of()?
    11. Why is container_of() important?
    12. How does container_of() work?
    13. What is offsetof()?

    22. container_of()

    A classic interview question.

    Suppose:

    struct my_device {
        int id;
        struct list_head list;
    };

    If you have:

    struct list_head *ptr;

    how do you obtain:

    struct my_device *

    Answer:

    container_of()

    Know exactly how and why it works.

    23. Kernel Process Programming

    1. What is task_struct?
    2. What information does it contain?
    3. How do you get the current task?
    4. What is current?
    5. What is current->pid?
    6. What is current->comm?
    7. What is process context?
    8. What is kernel context?
    9. Can kernel code create processes?
    10. Can kernel code create threads?
    11. What is kthread_run()?
    12. What is kthread_stop()?
    13. How do you stop a kernel thread?
    14. Can a kernel thread sleep?
    15. What is schedule()?
    16. What is schedule_timeout()?

    24. Kernel Threads

    1. What is a kernel thread?
    2. User thread vs kernel thread.
    3. What is kthread_run()?
    4. What is kthread_create()?
    5. What is wake_up_process()?
    6. What is kthread_should_stop()?
    7. What is kthread_stop()?
    8. Can a kernel thread call schedule()?
    9. How do you safely terminate a kernel thread?
    10. Kernel thread vs workqueue.

    25. Timers

    1. What is a kernel timer?
    2. Why are kernel timers used?
    3. What is struct timer_list?
    4. What is timer_setup()?
    5. What is mod_timer()?
    6. What is del_timer()?
    7. What is timer callback?
    8. Can a timer callback sleep?
    9. Timer vs delayed work.
    10. How do you create a periodic timer?

    26. Workqueues

    1. What is workqueue?
    2. Why use workqueue?
    3. What is deferred work?
    4. What is struct work_struct?
    5. What is INIT_WORK()?
    6. What is schedule_work()?
    7. What is cancel_work_sync()?
    8. Can workqueue code sleep?
    9. Workqueue vs tasklet.
    10. Workqueue vs kernel thread.
    11. What is delayed work?
    12. What is schedule_delayed_work()?

    27. Device Tree Programming

    1. What is Device Tree?
    2. What is DTS?
    3. What is DTSI?
    4. What is DTB?
    5. What is DTBO?
    6. What is compatible?
    7. What is reg?
    8. What is interrupts?
    9. What is clocks?
    10. What is gpios?
    11. What is status?
    12. What is a phandle?
    13. What is of_match_table?
    14. What is of_device_id?
    15. How does a driver read a Device Tree property?
    16. What is of_property_read_u32()?
    17. What is of_property_read_string()?
    18. How do you obtain a GPIO?
    19. How do you obtain an IRQ?
    20. How does Device Tree trigger probe()?

    Critical flow

    DTS
     ↓
    DTB
     ↓
    Kernel parses Device Tree
     ↓
    Device created
     ↓
    Driver registered
     ↓
    compatible matching
     ↓
    probe()

    28. Platform Driver Programming

    1. What is a platform driver?
    2. Why use platform drivers?
    3. What is struct platform_driver?
    4. What is probe()?
    5. What is remove()?
    6. When is probe() called?
    7. How does platform driver matching work?
    8. What is platform_get_resource()?
    9. What is platform_get_irq()?
    10. What is platform_get_drvdata()?
    11. What is platform_set_drvdata()?
    12. What is devm_ioremap_resource()?
    13. What is devm_kzalloc()?
    14. What is devm_request_irq()?
    15. What happens if probe fails?
    16. How do you clean up resources?

    29. I2C Kernel Programming

    1. What is I2C?
    2. What is an I2C adapter?
    3. What is an I2C client?
    4. What is struct i2c_driver?
    5. What is struct i2c_client?
    6. What is struct i2c_adapter?
    7. What is probe()?
    8. What is remove()?
    9. What is i2c_transfer()?
    10. What is i2c_master_send()?
    11. What is i2c_master_recv()?
    12. What is SMBus?
    13. I2C vs SMBus.
    14. How does an I2C driver match a Device Tree node?
    15. How do you debug an I2C device that isn’t responding?

    30. SPI Kernel Programming

    1. What is SPI?
    2. What is SPI master?
    3. What is SPI device?
    4. What is struct spi_driver?
    5. What is struct spi_device?
    6. What is struct spi_transfer?
    7. What is struct spi_message?
    8. What is spi_sync()?
    9. What is spi_async()?
    10. What is CPOL?
    11. What is CPHA?
    12. What are SPI modes?
    13. How does SPI driver matching work?
    14. How is SPI represented in Device Tree?
    15. I2C vs SPI.

    31. GPIO Kernel Programming

    1. What is GPIO?
    2. What is GPIO descriptor?
    3. What is gpiod_get()?
    4. What is gpiod_set_value()?
    5. What is gpiod_get_value()?
    6. GPIO input vs output.
    7. GPIO vs pinctrl.
    8. How do you describe GPIO in Device Tree?
    9. How can a GPIO generate an interrupt?
    10. Legacy GPIO API vs descriptor-based API.

    32. MMIO

    1. What is memory-mapped I/O?
    2. What is a hardware register?
    3. How does CPU access hardware registers?
    4. What is ioremap()?
    5. What is iounmap()?
    6. What is readb()?
    7. What is readw()?
    8. What is readl()?
    9. What is writeb()?
    10. What is writew()?
    11. What is writel()?
    12. Why shouldn’t you use normal pointer access for MMIO?
    13. What is __iomem?
    14. What is register masking?
    15. How do you set/clear a register bit?

    33. DMA

    1. What is DMA?
    2. Why use DMA?
    3. CPU transfer vs DMA transfer.
    4. What is a DMA buffer?
    5. What is DMA mapping?
    6. What is dma_map_single()?
    7. What is dma_unmap_single()?
    8. What is dma_alloc_coherent()?
    9. What is coherent DMA?
    10. What is streaming DMA?
    11. What is cache coherency?
    12. What is DMA mask?
    13. What is dma_set_mask_and_coherent()?
    14. What is IOMMU?
    15. What happens if CPU cache isn’t synchronized with DMA?

    34. Device Model

    1. What is Linux device model?
    2. What is struct device?
    3. What is a bus?
    4. What is a driver?
    5. What is a device?
    6. What is a class?
    7. What is kobject?
    8. What is reference counting?
    9. What is sysfs?
    10. What is uevent?
    11. What is device binding?
    12. What is driver binding?
    13. What is hotplug?
    14. What is udev?

    35. Sysfs Programming

    1. What is sysfs?
    2. Why is sysfs used?
    3. How does a driver create a sysfs attribute?
    4. What is struct device_attribute?
    5. What is show()?
    6. What is store()?
    7. What is DEVICE_ATTR()?
    8. What is sysfs_create_group()?
    9. Sysfs vs procfs.
    10. Sysfs vs debugfs.

    36. Debugfs

    1. What is debugfs?
    2. Why use debugfs?
    3. How do you create a debugfs file?
    4. How do you expose driver debug information?
    5. Debugfs vs sysfs.
    6. Should production applications depend on debugfs?

    37. Kernel Debugging

    1. How do you debug a kernel module?
    2. What is dmesg?
    3. What is dynamic debug?
    4. What is ftrace?
    5. What is tracepoint?
    6. What is kprobe?
    7. What is kretprobe?
    8. What is perf?
    9. What is KGDB?
    10. What is KASAN?
    11. What is KCSAN?
    12. What is lockdep?
    13. What is kmemleak?
    14. What is kernel panic?
    15. What is Oops?
    16. Oops vs panic.
    17. What is a kernel call trace?
    18. How do you find the source line causing a crash?
    19. What is addr2line?
    20. Why do you need vmlinux with debug symbols?

    38. Kernel Crash Questions

    Prepare these scenarios:

    Q1

    Kernel crashes with NULL pointer dereference. How do you debug?

    Q2

    Driver works for 10 minutes and then crashes.

    What do you investigate?

    Memory corruption
    Race condition
    Use-after-free
    DMA corruption
    Stack overflow

    Q3

    Driver unload causes kernel panic.

    Think:

    Outstanding references
    Running workqueue
    Active timer
    Interrupt still enabled
    Use-after-free

    Q4

    System hangs when driver is unloaded.

    Think:

    Deadlock
    Blocked process
    Workqueue not cancelled
    Kernel thread not stopped

    39. Error Handling

    1. Why does kernel code return negative error codes?
    2. What is -EINVAL?
    3. What is -ENOMEM?
    4. What is -EFAULT?
    5. What is -EBUSY?
    6. What is -ENODEV?
    7. What is -EIO?
    8. What is IS_ERR()?
    9. What is PTR_ERR()?
    10. What is ERR_PTR()?
    11. NULL pointer vs error pointer.
    12. How do you clean resources when probe() fails halfway?

    40. Reference Counting

    1. What is reference counting?
    2. Why is reference counting needed?
    3. What is kref?
    4. What is refcount_t?
    5. What happens if reference counting is wrong?
    6. How can reference counting prevent use-after-free?
    7. What is a module reference count?
    8. Why can’t a driver unload while it is still in use?

    41. RCU

    1. What is RCU?
    2. Why use RCU?
    3. What is read-copy-update?
    4. What is rcu_read_lock()?
    5. What is rcu_read_unlock()?
    6. What is synchronize_rcu()?
    7. RCU vs mutex.
    8. RCU vs spinlock.
    9. When is RCU useful?

    42. Kernel Scheduling APIs

    1. What is schedule()?
    2. What is schedule_timeout()?
    3. What is cond_resched()?
    4. What is yield()?
    5. What is task state?
    6. What is TASK_RUNNING?
    7. What is TASK_INTERRUPTIBLE?
    8. What is TASK_UNINTERRUPTIBLE?
    9. Why shouldn’t you normally use TASK_UNINTERRUPTIBLE unnecessarily?

    43. Kernel Preemption

    1. What is preemption?
    2. What is kernel preemption?
    3. What is voluntary preemption?
    4. What is preemptive kernel?
    5. What is preempt_disable()?
    6. What is preempt_enable()?
    7. What is preemption count?
    8. Why can’t certain kernel contexts be preempted?
    9. How does PREEMPT_RT change kernel behavior?

    44. Per-CPU Variables

    1. What is per-CPU data?
    2. Why use per-CPU variables?
    3. What problem do they solve?
    4. What is DEFINE_PER_CPU()?
    5. What is alloc_percpu()?
    6. How does per-CPU data improve performance?
    7. How does it reduce locking?

    45. Kernel Stack

    1. What is a kernel stack?
    2. User stack vs kernel stack.
    3. Does each thread have its own kernel stack?
    4. How large is a kernel stack?
    5. Why must kernel stack usage be limited?
    6. What causes kernel stack overflow?
    7. Why should large local arrays be avoided in kernel code?
    8. What happens during user → kernel transition to the stack?

    46. Kernel Concurrency Scenarios

    Be able to answer:

    Scenario

    One CPU is executing your driver while an interrupt occurs and accesses the same data.

    What do you use?

    Possible answer: appropriate locking such as a spinlock, depending on context.

    Scenario

    Two processes call your driver’s write() simultaneously.

    What do you do?

    Answer: identify shared state and protect it with appropriate synchronization.

    Scenario

    ISR modifies a buffer while userspace reads it.

    Think:

    Interrupt context
           ↕
    Synchronization
           ↕
    Process context

    47. User ↔ Kernel Communication

    Know every major mechanism:

    read()
    write()
    ioctl()
    mmap()
    poll()
    sysfs
    procfs
    netlink

    Questions:

    1. How does userspace communicate with kernel?
    2. When would you use read/write?
    3. When would you use ioctl?
    4. When would you use mmap?
    5. When would you use sysfs?
    6. What is netlink?
    7. What is procfs?
    8. Which mechanism is appropriate for configuration vs bulk data?

    48. mmap Programming

    1. What is mmap()?
    2. Why map kernel memory into userspace?
    3. How does a driver’s .mmap callback work?
    4. What is zero-copy?
    5. Why is mmap useful for high-bandwidth data?
    6. What are mmap security concerns?
    7. How can DMA buffers be exposed to userspace?

    49. Kernel Networking Programming

    1. What is struct net_device?
    2. What is sk_buff?
    3. What is NAPI?
    4. Why is NAPI used?
    5. What happens when an Ethernet packet arrives?
    6. How does a network driver receive packets?
    7. What is RX ring?
    8. What is TX ring?
    9. How is DMA used by network drivers?
    10. What is interrupt coalescing?

    50. Power Management

    1. What is runtime PM?
    2. What is system suspend?
    3. What is resume?
    4. What is suspend()?
    5. What is resume()?
    6. What is pm_runtime_get_sync()?
    7. What is pm_runtime_put()?
    8. What is autosuspend?
    9. What is wakeup source?
    10. How does a driver handle power state transitions?

    51. Kernel Time / Timers

    1. What is jiffies?
    2. What is HZ?
    3. What is kernel tick?
    4. What is high-resolution timer?
    5. What is monotonic time?
    6. What is ktime?
    7. Timer vs sleep.
    8. Timer callback vs workqueue.

    52. Kernel Lists / Queues

    1. Linked list.
    2. Hash list.
    3. Circular buffer.
    4. Ring buffer.
    5. FIFO.
    6. What is kfifo?
    7. Why use kfifo?
    8. How do you implement producer-consumer?
    9. How do you synchronize a ring buffer?

    53. Kernel FIFO

    1. What is kfifo?
    2. Why use kfifo?
    3. kfifo_in().
    4. kfifo_out().
    5. How do you allocate a FIFO?
    6. Is kfifo automatically thread-safe?
    7. How would you synchronize producer and consumer?

    54. Kernel APIs — Must Know

    You should recognize and explain these:

    kmalloc()
    kzalloc()
    kfree()
    
    vmalloc()
    vfree()
    
    copy_to_user()
    copy_from_user()
    
    mutex_lock()
    mutex_unlock()
    
    spin_lock()
    spin_unlock()
    
    spin_lock_irqsave()
    spin_unlock_irqrestore()
    
    wait_event()
    wake_up()
    
    schedule()
    schedule_timeout()
    
    request_irq()
    free_irq()
    request_threaded_irq()
    
    alloc_chrdev_region()
    unregister_chrdev_region()
    
    cdev_init()
    cdev_add()
    cdev_del()
    
    class_create()
    device_create()
    device_destroy()
    
    ioremap()
    iounmap()
    
    readl()
    writel()
    
    devm_kzalloc()
    devm_request_irq()
    devm_ioremap_resource()
    
    kthread_run()
    kthread_stop()
    
    schedule_work()
    cancel_work_sync()
    
    dma_alloc_coherent()
    dma_map_single()
    dma_unmap_single()
    
    container_of()
    list_add()
    list_del()
    list_for_each_entry()

    55. Kernel Coding Questions

    Interviewers may give you code and ask:

    Example 1

    char *buf;
    
    buf = kmalloc(100, GFP_KERNEL);

    Questions:

    • What does this do?
    • What if allocation fails?
    • How do you free it?
    • Can this be called from ISR?

    Example 2

    spin_lock(&lock);
    foo++;
    spin_unlock(&lock);

    Questions:

    • Why use spinlock?
    • Can foo++ be interrupted?
    • Can this code sleep?
    • What happens on SMP?

    Example 3

    if (copy_from_user(buf, user_buf, count))
        return -EFAULT;

    Questions:

    • Why use copy_from_user()?
    • What does its return value mean?
    • Why return -EFAULT?

    56. Kernel Programming Scenario Questions

    These are very important for actual interviews.

    1. Your driver hangs the system.

    How do you debug it?

    2. Your probe() isn’t called.

    What do you check?

    3. /dev/mydevice isn’t created.

    What do you check?

    4. Interrupt isn’t coming.

    What do you check?

    5. I2C device isn’t detected.

    What do you check?

    6. Driver crashes during rmmod.

    What do you check?

    7. read() blocks forever.

    What could be wrong?

    8. CPU usage becomes 100%.

    Could your driver be causing it?

    9. DMA data is corrupted.

    What could be wrong?

    10. Driver works on one board but not another.

    What would you investigate?

    11. Race condition occurs only occasionally.

    How would you debug it?

    12. Kernel memory usage keeps increasing.

    What do you investigate?

    13. System crashes after suspend/resume.

    What do you investigate?

    14. Driver works initially but fails after repeated open/close.

    What could be wrong?

    15. Hardware generates interrupts continuously.

    What could cause an interrupt storm?

    57. Most Important Questions to Master

    If you have an interview soon, do these first:

    1. Kernel vs user space.
    2. Kernel module lifecycle.
    3. module_init() / module_exit().
    4. Kernel Makefile.
    5. kmalloc() / vmalloc().
    6. GFP flags.
    7. copy_to_user() / copy_from_user().
    8. Character driver architecture.
    9. Major/minor numbers.
    10. cdev.
    11. file_operations.
    12. open/read/write/ioctl.
    13. Blocking/non-blocking I/O.
    14. Wait queues.
    15. poll().
    16. Interrupts.
    17. Top half/bottom half.
    18. Workqueue.
    19. Kernel thread.
    20. Mutex.
    21. Spinlock.
    22. Semaphore.
    23. Atomic operations.
    24. Memory barriers.
    25. Race conditions.
    26. Deadlocks.
    27. container_of().
    28. Linked lists.
    29. Device Tree.
    30. Platform driver.
    31. probe() / remove().
    32. MMIO.
    33. ioremap().
    34. I2C driver.
    35. SPI driver.
    36. GPIO.
    37. DMA.
    38. Sysfs.
    39. Debugfs.
    40. Kernel debugging.
    41. Kernel Oops.
    42. Kernel panic.
    43. KASAN.
    44. Lockdep.
    45. ftrace.
    46. Power management.
    47. mmap.
    48. VFS basics.
    49. Kernel scheduling.
    50. Real-world debugging scenarios.
  • Embedded Linux + Yocto Interview Questions

    PART 1 – Embedded Linux Fundamentals

    Beginner

    1. What is Embedded Linux?
    2. What is the difference between Linux and Embedded Linux?
    3. What are the major components of an Embedded Linux system?
    4. What is a Linux distribution?
    5. What is a BSP?
    6. What is a bootloader?
    7. What is a kernel?
    8. What is a root filesystem?
    9. What is a device tree?
    10. What is a cross compiler?
    11. What is cross compilation?
    12. What is a toolchain?
    13. What are GCC, binutils and glibc?
    14. What is an architecture-specific toolchain?
    15. What is the difference between host, target and build machine?
    16. What is an embedded target?
    17. What is /boot?
    18. What is /etc?
    19. What is /dev?
    20. What is /proc?
    21. What is /sys?
    22. What is /tmp?
    23. What is /var?
    24. What is /usr?
    25. What is /lib?
    26. What happens when Linux boots?
    27. What is the Linux boot sequence?
    28. What is firmware?
    29. What is hardware initialization?
    30. What is a console?
    31. What is a serial console?
    32. What is UART?
    33. Why is UART commonly used for debugging embedded Linux?
    34. What is SSH?
    35. What is Telnet?
    36. SSH vs Telnet?
    37. What is BusyBox?
    38. Why is BusyBox commonly used in Embedded Linux?
    39. What is init?
    40. What is PID 1?
    41. What is systemd?
    42. systemd vs SysVinit?
    43. What is a daemon?
    44. What is a service?
    45. What is a shell?
    46. What is Bash?
    47. What is a process?
    48. What is a thread?
    49. Process vs thread?
    50. What is a signal?

    PART 2 – Embedded Linux Architecture

    1. Explain the complete Embedded Linux architecture.
    2. Explain:
    Application
         ↓
    Libraries
         ↓
    System Calls
         ↓
    Linux Kernel
         ↓
    Device Drivers
         ↓
    Hardware
    1. What happens when an application calls open()?
    2. What happens when an application calls read()?
    3. What happens when an application calls write()?
    4. What is a system call?
    5. Why can’t user applications directly access hardware?
    6. User space vs kernel space?
    7. What is privilege level?
    8. What is kernel mode?
    9. What is user mode?
    10. How does an application communicate with a driver?
    11. What is /dev?
    12. How are device nodes created?
    13. What is udev?
    14. What is devtmpfs?
    15. What is sysfs?
    16. What is procfs?
    17. What is debugfs?
    18. What is tmpfs?
    19. What is initramfs?
    20. initramfs vs root filesystem?
    21. What is NFS root filesystem?
    22. Why use NFS during embedded development?
    23. What is a read-only root filesystem?
    24. Why would an embedded system use a read-only rootfs?

    PART 3 – Boot Process

    Extremely Important

    1. Explain the Embedded Linux boot sequence from power-on to application.

    Expected:

    Power ON
       ↓
    ROM / Boot ROM
       ↓
    Bootloader
       ↓
    Hardware initialization
       ↓
    Load Kernel
       ↓
    Load Device Tree
       ↓
    Kernel initialization
       ↓
    Mount root filesystem
       ↓
    Start PID 1
       ↓
    Start services
       ↓
    Application
    1. What is Boot ROM?
    2. What is SPL?
    3. What is U-Boot?
    4. Why is U-Boot commonly used?
    5. U-Boot vs BIOS?
    6. What is UEFI?
    7. U-Boot vs UEFI?
    8. What is SPL?
    9. Why do we need SPL?
    10. What is bootcmd?
    11. What is bootargs?
    12. What is printenv?
    13. What is setenv?
    14. What is saveenv?
    15. What is bootm?
    16. What is booti?
    17. What is bootz?
    18. What is kernel image Image?
    19. Image vs zImage?
    20. What is uImage?
    21. Image vs uImage?
    22. What is FIT image?
    23. What is extlinux.conf?
    24. What is kernel command line?
    25. How does the kernel receive boot arguments?
    26. What is:
    console=ttyS0,115200
    1. What is:
    root=/dev/mmcblk0p2
    1. What is:
    rootwait
    1. What is:
    rw
    1. What is:
    ro
    1. What happens if root filesystem cannot be mounted?
    2. What is kernel panic?
    3. How do you debug a kernel boot failure?

    PART 4 – Linux Kernel Basics

    1. What is the Linux kernel?
    2. Monolithic kernel vs microkernel?
    3. Why is Linux called a monolithic kernel?
    4. What is a modular kernel?
    5. What is a kernel module?
    6. Built-in driver vs loadable module?
    7. What is:
    insmod
    1. What is:
    modprobe
    1. insmod vs modprobe?
    2. What is:
    lsmod
    1. What is:
    rmmod
    1. What is:
    modinfo
    1. What is /lib/modules/<kernel-version>?
    2. What is EXPORT_SYMBOL()?
    3. EXPORT_SYMBOL vs EXPORT_SYMBOL_GPL?
    4. What is kernel configuration?
    5. What is .config?
    6. What is defconfig?
    7. What is menuconfig?
    8. What is:
    make menuconfig
    1. What is:
    make defconfig
    1. What is Kconfig?
    2. What is Kbuild?
    3. Kconfig vs Kbuild?

    PART 5 – Linux Device Tree

    Must Know

    1. What is Device Tree?
    2. Why was Device Tree introduced?
    3. What problem does Device Tree solve?
    4. What is DTS?
    5. What is DTSI?
    6. DTS vs DTSI?
    7. What is DTB?
    8. DTS → DTB conversion?
    9. What is Device Tree Compiler?
    10. What is:
    dtc
    1. Explain a Device Tree node.
    2. What is compatible?
    3. What is reg?
    4. What is interrupts?
    5. What is clocks?
    6. What is clock-names?
    7. What is gpio?
    8. What is gpio-controller?
    9. What is status = "okay"?
    10. What does:
    status = "disabled";

    mean?

    1. What are phandles?
    2. What is &uart0?
    3. What is Device Tree overlay?
    4. What is aliases?
    5. What is chosen node?
    6. What is the memory node?
    7. How does a driver match with Device Tree?
    8. Explain:
    compatible → driver matching → probe()
    1. How do you debug Device Tree issues?

    PART 6 – Linux Device Drivers

    1. What is a device driver?
    2. Why do we need drivers?
    3. Character vs block vs network driver?
    4. What is a character device?
    5. What is a block device?
    6. What is a network device?
    7. What is major number?
    8. What is minor number?
    9. What is dev_t?
    10. What is struct file_operations?
    11. Explain:
    open()
    read()
    write()
    ioctl()
    mmap()
    poll()
    release()
    1. What is copy_to_user()?
    2. What is copy_from_user()?
    3. Why can’t we directly dereference a user-space pointer?
    4. What is kmalloc()?
    5. What is kzalloc()?
    6. What is vmalloc()?
    7. kmalloc() vs vmalloc()?
    8. What is GFP_KERNEL?
    9. What is GFP_ATOMIC?
    10. GFP_KERNEL vs GFP_ATOMIC?
    11. What is devm_*()?
    12. Why use devm-managed resources?
    13. What is probe()?
    14. What is remove()?
    15. What is driver binding?
    16. What is driver unbinding?
    17. What is platform driver?
    18. What is platform device?
    19. Why are platform drivers commonly used in SoC systems?
    20. What is platform_driver?
    21. What is platform_device?
    22. What is platform_get_resource()?
    23. What is devm_ioremap_resource()?
    24. What is ioremap()?
    25. What is MMIO?
    26. MMIO vs port I/O?

    PART 7 – Interrupts

    1. What is an interrupt?
    2. Hardware interrupt vs software interrupt?
    3. What is IRQ?
    4. What is IRQ number?
    5. What is ISR?
    6. What is interrupt handler?
    7. What is request_irq()?
    8. What is free_irq()?
    9. What is threaded IRQ?
    10. Hard IRQ vs threaded IRQ?
    11. What can you do inside an ISR?
    12. What should you NOT do inside an ISR?
    13. Why can’t you sleep in interrupt context?
    14. What is interrupt context?
    15. What is process context?
    16. What is bottom half?
    17. What is top half?
    18. What is tasklet?
    19. What is workqueue?
    20. Tasklet vs workqueue?
    21. What is softirq?
    22. Softirq vs tasklet?
    23. What is interrupt affinity?
    24. What is interrupt storm?
    25. What is shared IRQ?
    26. What is edge-triggered interrupt?
    27. What is level-triggered interrupt?

    PART 8 – Synchronization

    1. Why is synchronization required?
    2. What is race condition?
    3. What is critical section?
    4. What is mutex?
    5. What is semaphore?
    6. What is spinlock?
    7. Mutex vs spinlock?
    8. Binary semaphore vs mutex?
    9. What is read-write lock?
    10. What is atomic operation?
    11. What is atomic_t?
    12. What is memory barrier?
    13. Why are memory barriers required?
    14. What is deadlock?
    15. What are the conditions for deadlock?
    16. What is priority inversion?
    17. How can priority inversion be handled?
    18. Can mutex be used in interrupt context?
    19. Can spinlock be used in process context?
    20. What happens if you sleep while holding a spinlock?

    PART 9 – Linux Memory Management

    1. What is virtual memory?
    2. Physical vs virtual address?
    3. What is MMU?
    4. What is page?
    5. What is page table?
    6. What is TLB?
    7. What is page fault?
    8. Minor vs major page fault?
    9. What is kernel virtual address?
    10. What is user virtual address?
    11. What is DMA?
    12. What is DMA mapping?
    13. What is cache coherency?
    14. What is coherent DMA?
    15. Streaming DMA vs coherent DMA?
    16. What is CMA?
    17. What is reserved memory?
    18. What is memory fragmentation?
    19. What is slab allocator?
    20. SLAB vs SLUB?
    21. What is page allocator?

    PART 10 – Linux System Programming

    1. What is a process?
    2. What is PID?
    3. What is PPID?
    4. What is fork()?
    5. What is exec()?
    6. fork() vs exec()?
    7. What is wait()?
    8. What is waitpid()?
    9. What is zombie process?
    10. What is orphan process?
    11. What is daemon process?
    12. What is exit()?
    13. What is _exit()?
    14. exit() vs _exit()?
    15. What is IPC?
    16. Types of IPC?
    17. Pipe?
    18. Named pipe?
    19. Message queue?
    20. Shared memory?
    21. Semaphore?
    22. Socket?
    23. Signal?
    24. Shared memory vs pipe?
    25. Message queue vs shared memory?
    26. What is POSIX?
    27. POSIX threads?
    28. What is pthread_create()?
    29. What is pthread_join()?
    30. What is pthread_mutex?
    31. What is condition variable?
    32. What is thread scheduling?

    PART 11 – Linux Networking

    1. What is socket?
    2. TCP vs UDP?
    3. What is IP address?
    4. MAC address vs IP address?
    5. What is ARP?
    6. What is DHCP?
    7. What is DNS?
    8. What is routing?
    9. What is gateway?
    10. What is subnet mask?
    11. What is loopback?
    12. What is Ethernet?
    13. What is CAN?
    14. What is SocketCAN?
    15. How do you bring up an interface?
    16. Explain:
    ip link
    ip addr
    ip route
    1. How do you capture packets?
    2. What is tcpdump?
    3. What is ethtool?
    4. How do you debug network connectivity?

    PART 12 – Linux Debugging

    1. How do you debug an Embedded Linux application?
    2. How do you debug a kernel crash?
    3. What is dmesg?
    4. What is journalctl?
    5. What is strace?
    6. What is ltrace?
    7. What is GDB?
    8. GDB vs KGDB?
    9. What is core dump?
    10. How do you analyze a core dump?
    11. What is gdbserver?
    12. How do you remotely debug an embedded application?
    13. What is perf?
    14. What is ftrace?
    15. What is trace-cmd?
    16. What is printk?
    17. printk vs pr_info/pr_err?
    18. What is dynamic debug?
    19. What is lockdep?
    20. What is KASAN?
    21. What is KCSAN?
    22. What is kmemleak?
    23. How do you debug memory leaks?
    24. How do you debug CPU utilization?
    25. How do you debug high boot time?
    26. How do you debug random kernel crashes?

    PART 13 – Linux Build System

    1. What is a Linux kernel build?
    2. What is Makefile?
    3. What is recursive Make?
    4. What is cross compilation?
    5. What is ARCH?
    6. What is CROSS_COMPILE?

    Example:

    make ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu-
    1. What is toolchain prefix?
    2. What is sysroot?
    3. What is libc?
    4. glibc vs musl?
    5. glibc vs uClibc?
    6. What is static linking?
    7. What is dynamic linking?
    8. Static vs dynamic linking?
    9. What is ELF?
    10. What is executable?
    11. What is shared library?
    12. What is .so?
    13. What is .a?
    14. What is linker?
    15. What is loader?
    16. What is ld.so?

    PART 14 – Yocto Fundamentals

    Most Important for Yocto Interviews

    1. What is Yocto Project?
    2. Is Yocto an operating system?
    1. What does Yocto provide?
    2. What is OpenEmbedded?
    3. Yocto vs OpenEmbedded?
    4. What is Poky?
    5. Is Poky the Yocto Project?
    6. What is BitBake?
    7. What is a recipe?
    8. What is .bb file?
    9. What is .bbappend?
    10. What is .inc file?
    11. What is layer?
    12. What is metadata?
    13. What is machine configuration?
    14. What is distro configuration?
    15. What is image recipe?
    16. What is package recipe?
    17. What is packagegroup?
    18. What is BSP layer?
    19. What is application layer?
    20. What is distro layer?
    21. What is meta layer?
    22. Why is Yocto layer-based?

    PART 15 – Yocto Architecture

    1. Explain Yocto architecture.
    BitBake
       ↓
    Metadata
       ↓
    Recipes
       ↓
    Classes
       ↓
    Configuration
       ↓
    Tasks
       ↓
    Packages
       ↓
    Root Filesystem
       ↓
    Image
    1. What is metadata?
    2. What is BitBake datastore?
    3. What is parsing?
    4. What is task execution?
    5. What is dependency resolution?
    6. What is package generation?
    7. What is image generation?
    8. What is deploy directory?
    9. What is tmp?
    10. What is downloads?
    11. What is sstate-cache?
    12. What is buildhistory?
    13. What is conf/local.conf?
    14. What is conf/bblayers.conf?
    15. What is MACHINE?
    16. What is DISTRO?
    17. What is TARGET_ARCH?
    18. What is TARGET_SYS?
    19. What is BUILD_SYS?
    20. What is HOST_SYS?

    PART 16 – Yocto Recipes

    1. Explain a basic Yocto recipe.
    2. What is:
    SUMMARY
    DESCRIPTION
    LICENSE
    LIC_FILES_CHKSUM
    SRC_URI
    SRCREV
    S
    PV
    PR
    1. What is SRC_URI?
    2. What is SRCREV?
    3. What is PV?
    4. What is PR?
    5. What is WORKDIR?
    6. What is S?
    7. What is B?
    8. What is D?
    9. What is DEPLOYDIR?
    10. What is ${bindir}?
    11. What is ${libdir}?
    12. What is ${sysconfdir}?
    13. What is ${datadir}?
    14. What is ${includedir}?

    PART 17 – Yocto Tasks

    1. What is a BitBake task?
    2. What is do_fetch?
    3. What is do_unpack?
    4. What is do_patch?
    5. What is do_configure?
    6. What is do_compile?
    7. What is do_install?
    8. What is do_package?
    9. What is do_package_write_*?
    10. What is do_rootfs?
    11. What is do_image?
    12. What is do_image_complete?
    13. Explain the complete recipe build flow.
    do_fetch
     ↓
    do_unpack
     ↓
    do_patch
     ↓
    do_configure
     ↓
    do_compile
     ↓
    do_install
     ↓
    do_package
     ↓
    do_package_write
    1. What is task dependency?
    2. How do you add dependency between tasks?
    3. What is addtask?
    4. What is task ordering?
    5. What is before?
    6. What is after?

    PART 18 – Yocto Variables

    1. What is variable expansion?
    2. Difference between:
    =
    ?=
    ??=
    :=
    1. What is immediate expansion?
    2. What is lazy expansion?
    3. Difference:
    FOO = "abc"
    FOO := "abc"
    1. What is:
    ${@python-expression}
    1. What is OVERRIDES?
    2. What is override syntax?
    3. Explain:
    VAR:${MACHINE}
    1. What is append?
    2. What is prepend?
    3. Difference between:
    VAR:append = " abc"
    VAR += "abc"
    1. What is DISTRO_FEATURES?
    2. What is MACHINE_FEATURES?
    3. What is IMAGE_FEATURES?
    4. What is EXTRA_IMAGE_FEATURES?
    5. What is PACKAGECONFIG?
    6. What is DEPENDS?
    7. What is RDEPENDS?
    8. What is RRECOMMENDS?
    9. DEPENDS vs RDEPENDS?
    10. RDEPENDS vs RRECOMMENDS?

    PART 19 -Yocto Dependencies

    1. What does DEPENDS mean?
    2. What does RDEPENDS mean?
    3. What happens if a library is missing during compilation?
    4. What happens if a runtime library is missing?
    5. Why can a package exist but its dependency still be missing?
    6. What is sysroot in Yocto?
    7. What is recipe-specific sysroot?
    8. What is staging?
    9. Why shouldn’t you manually modify Yocto sysroot?
    10. How does BitBake know where dependencies are?

    PART 20 – Yocto Classes

    1. What is a Yocto class?
    2. What is .bbclass?
    3. What is inherit?
    4. What is inherit cmake?
    5. What is inherit meson?
    6. What is inherit autotools?
    7. What is inherit pkgconfig?
    8. What is inherit systemd?
    9. What is inherit module?
    10. What is inherit kernel?
    11. What is inherit externalsrc?
    12. What is inherit cmake doing internally?
    13. When would you use externalsrc?

    PART 21 – Yocto Layers

    1. What is a Yocto layer?
    2. Why create a custom layer?
    3. How do you create a layer?
    4. What does bitbake-layers create-layer do?
    5. What is BBLAYERS?
    6. What is BBFILE_COLLECTIONS?
    7. What is BBFILE_PATTERN?
    8. What is BBFILE_PRIORITY?
    9. What is layer priority?
    10. What happens if two layers contain the same recipe?
    11. Which recipe gets selected?
    12. How does .bbappend work across layers?
    13. How do you check available layers?
    14. How do you check recipe providers?
    15. Explain:
    bitbake-layers show-layers
    bitbake-layers show-recipes
    bitbake-layers show-appends

    PART 22 – Yocto Image Creation

    1. What is an image recipe?
    2. What is:
    IMAGE_INSTALL
    1. What is:
    CORE_IMAGE_EXTRA_INSTALL
    1. Difference between IMAGE_INSTALL and CORE_IMAGE_EXTRA_INSTALL?
    2. What is IMAGE_FEATURES?
    3. What is EXTRA_IMAGE_FEATURES?
    4. How do you add an application to an image?
    5. How do you add a package?
    6. How do you remove a package?
    7. How do you add SSH server?
    8. How do you create a custom image?
    9. What is:
    inherit core-image
    1. How do you create a minimal image?
    2. How do you create a development image?

    PART 23 – Yocto Package Management

    1. What is a package?
    2. What is package manager?
    3. Yocto package formats?
    4. RPM vs DEB vs IPK?
    5. What is PACKAGE_CLASSES?
    6. What is IMAGE_PKGTYPE?
    7. What is package splitting?
    8. Why does one recipe produce multiple packages?
    9. What is:
    PN
    PN-dev
    PN-dbg
    PN-staticdev
    1. What is ${PN}?
    2. What is ${PN}-dev?
    3. What is ${PN}-dbg?
    4. What is FILES:${PN}?
    5. What is FILES:${PN}-dev?

    PART 24 – Yocto Kernel

    1. How is Linux kernel built in Yocto?
    2. What is linux-yocto?
    3. What is a kernel recipe?
    4. How do you customize the kernel?
    5. How do you add a kernel configuration?
    6. What is kernel fragment?
    7. What is .cfg fragment?
    8. How do you add a kernel patch?
    9. How do you modify Device Tree using Yocto?
    10. How do you add a new DTS file?
    11. How do you configure kernel options?
    12. What is:
    KERNEL_DEVICETREE
    1. What is:
    KERNEL_FEATURES
    1. How do you verify the kernel configuration?
    2. Where is the built kernel located?

    PART 25 – Yocto Device Tree

    1. How do you modify Device Tree in Yocto?
    2. Where do Device Tree sources live?
    3. How do you add custom DTS?
    4. How do you add a Device Tree patch?
    5. How do you enable a peripheral?
    6. How do you disable a peripheral?
    7. How does a Yocto kernel recipe find DTS files?
    8. How do you debug Device Tree compilation?
    9. How do you verify the DTB inside the final image?

    PART 26 – Yocto Debugging

    1. BitBake recipe compilation fails. How do you debug?
    2. What is:
    bitbake -c clean
    1. What is:
    bitbake -c cleansstate
    1. clean vs cleansstate?
    2. What is:
    bitbake -c cleanall
    1. cleanall vs cleansstate?
    2. What is:
    bitbake -e
    1. How do you find the final value of a variable?
    2. How do you find why a variable has a particular value?
    3. What is:
    bitbake -g
    1. How do you inspect dependency graph?
    2. What is:
    bitbake -c devshell
    1. What is log.do_compile?
    2. What is run.do_compile?
    3. Where do you find task logs?
    4. How do you debug missing header files?
    5. How do you debug missing libraries?
    6. How do you debug cannot find -lxxx?
    7. How do you debug QA errors?
    8. What is do_package_qa?

    PART 27 – Yocto QA Errors

    1. What is Yocto QA?
    2. What is:
    installed-vs-shipped
    1. What is:
    file-rdeps
    1. What is:
    dev-so
    1. What is:
    already-stripped
    1. What is:
    buildpaths
    1. What is:
    compile-host-path
    1. What is:
    rpaths
    1. What is:
    invalid-pkgconfig
    1. What is:
    libdir
    1. What is:
    arch
    1. Why shouldn’t QA errors simply be disabled?
    2. When would you use INSANE_SKIP?

    PART 28 – Yocto sstate and Downloads

    1. What is sstate?
    2. Why is sstate important?
    3. What is SSTATE_DIR?
    4. What is DL_DIR?
    5. Why does Yocto download source separately?
    6. How does Yocto avoid rebuilding everything?
    7. What is shared state cache?
    8. What causes sstate invalidation?
    9. What is hash equivalence?
    10. What is BitBake signature?
    11. What is task hash?
    12. What happens when a task’s inputs change?

    PART 29 — Yocto SDK

    1. What is Yocto SDK?
    2. Why use an SDK?
    3. What is extensible SDK?
    4. Standard SDK vs eSDK?
    5. How do you generate an SDK?
    6. What is:
    bitbake <image> -c populate_sdk
    1. What is:
    populate_sdk_ext
    1. What is cross-development SDK?
    2. How do you compile an application using Yocto SDK?
    3. What is sysroot inside SDK?

    PART 30 – Yocto Multiconfig

    1. What is multiconfig?
    2. Why use multiconfig?
    3. How can you build multiple machines?
    4. How can you build host and target components?
    5. What is:
    BBMULTICONFIG
    1. How does dependency work across multiconfigs?

    PART 31 – Yocto Reproducibility

    1. What is reproducible build?
    2. Why are reproducible builds important?
    3. What causes non-reproducibility?
    4. How does Yocto support reproducible builds?
    5. What is build timestamp?
    6. What is source timestamp?
    7. How do you investigate differences between two images?

    PART 32 – Yocto Licensing

    1. How does Yocto handle licenses?
    2. What is LICENSE?
    3. What is LIC_FILES_CHKSUM?
    4. Why is LIC_FILES_CHKSUM required?
    5. What happens if license checksum changes?
    6. What is INCOMPATIBLE_LICENSE?
    7. How do you exclude GPL packages?
    8. How do you handle commercial packages?

    PART 33 – Yocto Security

    1. How do you secure an Embedded Linux image?
    2. How do you enable secure boot?
    3. What is verified boot?
    4. What is measured boot?
    5. Secure boot vs verified boot?
    6. What is TPM?
    7. What is dm-verity?
    8. What is read-only rootfs?
    9. What is signed package?
    10. How do you reduce attack surface?
    11. Why should unnecessary services be removed?
    12. How do you disable root login?
    13. How do you disable password-based SSH?

    PART 34 – Yocto OTA

    1. What is OTA update?
    2. How would you implement OTA for Embedded Linux?
    3. What is A/B update?
    4. Why use dual root filesystem?
    5. What happens if update fails?
    6. What is rollback?
    7. What is RAUC?
    8. What is SWUpdate?
    9. What is Mender?
    10. How would you design a reliable OTA system?
    11. How do you prevent bricking during OTA?

    PART 35 – Yocto Performance

    1. Why is Yocto build slow?
    2. How do you reduce build time?
    3. How does sstate improve build performance?
    4. How does parallelism work?
    5. What is:
    BB_NUMBER_THREADS
    1. What is:
    PARALLEL_MAKE
    1. What is network caching?
    2. How do you optimize CI Yocto builds?
    3. What is shared sstate server?
    4. What is source mirror?

    PART 36 – Advanced BitBake

    1. What is BitBake’s dependency resolver?
    2. How does BitBake determine task execution order?
    3. What is task signature?
    4. What is task hash?
    5. What is stamp?
    6. What is stamp-based execution?
    7. What is fakeroot?
    8. Why does Yocto use fakeroot/pseudo?
    9. What is pseudo?
    10. Why is do_install executed under fakeroot?
    11. What is BB_TASK_NICE_LEVEL?
    12. What is BB_TASK_IONICE_LEVEL?
    13. What is BB_NO_NETWORK?
    14. What is BB_FETCH_PREMIRRORONLY?
    15. What is PREMIRRORS?
    16. What is MIRRORS?

    PART 37 – Yocto Advanced Recipe Questions

    1. How do you write a recipe for a Git project?
    2. How do you specify Git branch?
    3. How do you specify commit?
    4. What is:
    SRC_URI = "git://..."
    SRCREV = "..."
    1. What is ${AUTOREV}?
    2. Why should AUTOREV generally be avoided in production?
    3. How do you apply a patch?
    4. How do you add multiple patches?
    5. How do you disable a patch?
    6. How do you override recipe variables?
    7. How do you create machine-specific configuration?
    8. How do you create distro-specific configuration?
    9. How do you make a recipe machine-specific?
    10. How do you make a package architecture-independent?

    PART 38 – CMake + Yocto

    1. How do you build a CMake project using Yocto?
    2. What is:
    inherit cmake
    1. What is EXTRA_OECMAKE?
    2. How does Yocto pass compiler information to CMake?
    3. How do you pass CMake options?
    4. How do you install binaries from CMake?
    5. How do you handle external dependencies?
    6. How do you debug CMake cross-compilation?

    PART 39 – Autotools + Yocto

    1. What is Autotools?
    2. What is:
    configure
    Makefile
    automake
    autoconf
    1. What is:
    inherit autotools
    1. What is EXTRA_OECONF?
    2. What is oe_runconf?
    3. How does Yocto cross-compile Autotools projects?

    PART 40 – Real Interview Troubleshooting

    These are very high-value interview questions.

    Scenario 1

    Your application builds successfully on Ubuntu but fails in Yocto. Why?

    Possible areas:

    • missing DEPENDS
    • incorrect sysroot
    • missing headers
    • missing pkg-config
    • wrong PACKAGECONFIG
    • host contamination
    • incorrect CMake configuration

    Scenario 2

    Your recipe compiles but binary is missing from the final image. Why?

    Check:

    do_install
    FILES:${PN}
    IMAGE_INSTALL
    package split

    Scenario 3

    cannot find -lpulse

    How would you debug?

    Scenario 4

    Header file exists on your host but Yocto cannot find it.

    Why?

    Scenario 5

    Application works on Ubuntu but crashes on target.

    How do you debug?

    Scenario 6

    Device Tree compiles but driver doesn’t probe.

    What do you check?

    compatible
    status
    reg
    interrupts
    clocks
    GPIO
    driver match
    probe()

    Scenario 7

    Driver probes but hardware doesn’t work.

    How do you debug?

    Scenario 8

    Kernel boots but root filesystem doesn’t mount.

    What do you check?

    Scenario 9

    Kernel hangs during boot.

    How do you debug?

    Scenario 10

    Yocto rebuilds everything after a small change.

    Why?

    Scenario 11

    Yocto build suddenly becomes very slow.

    What do you investigate?

    Scenario 12

    Image size is 1 GB. How do you reduce it?

    Scenario 13

    Target has only 128 MB RAM. How would you optimize Linux?

    Scenario 14

    Application has high CPU usage.

    How do you investigate?

    Scenario 15

    System randomly freezes.

    How do you debug?

    PART 41 – Expert Embedded Linux Questions

    Architecture

    1. Design an Embedded Linux boot architecture for a custom SoC.
    2. Design a production BSP.
    3. How would you structure a Yocto project for multiple products?
    4. How would you maintain multiple hardware revisions?
    5. How would you support multiple SoCs?
    6. How would you maintain multiple kernel versions?
    7. How would you maintain multiple product variants?
    8. How would you design a long-term-maintenance Yocto system?

    PART 42 – Expert Yocto Project Architecture

    1. Design a custom Yocto layer architecture.

    Example:

    meta-company
    ├── conf
    ├── classes
    ├── recipes-core
    ├── recipes-kernel
    ├── recipes-bsp
    ├── recipes-app
    ├── recipes-multimedia
    └── recipes-security
    1. Where should application recipes live?
    2. Where should BSP recipes live?
    3. Where should machine configuration live?
    4. Where should distro configuration live?
    5. How do you prevent vendor-layer modifications from affecting your product layer?
    6. How do you handle vendor BSP upgrades?
    7. How do you maintain custom patches?

    PART 43 – Production Yocto

    1. How do you create a production image?
    2. Development image vs production image?
    3. How do you remove debugging tools from production?
    4. How do you disable SSH in production?
    5. How do you enable read-only rootfs?
    6. How do you configure watchdog?
    7. How do you configure system health monitoring?
    8. How do you recover from application crashes?
    9. How do you automatically restart services?
    10. How do you collect crash logs?
    11. How do you implement persistent logs?
    12. How do you reduce boot time?

    PART 44 – Embedded Linux Audio + Yocto

    Since audio is a common Embedded Linux area, these are particularly useful if your role involves ALSA/PulseAudio.

    1. What is ALSA?
    2. What is PulseAudio?
    3. ALSA vs PulseAudio?
    4. What is PipeWire?
    5. ALSA architecture?
    6. What is PCM?
    7. What is mixer?
    8. What is ALSA device?
    9. What is hardware device?
    10. What is aplay?
    11. What is arecord?
    12. What is amixer?
    13. What is alsactl?
    14. What is speaker-test?
    15. How do you debug audio playback?
    16. What causes sample-rate mismatch?
    17. What causes underrun?
    18. What causes overrun?
    19. What is buffer size?
    20. What is period size?
    21. How do you reduce audio latency?
    22. How would you package ALSA utilities using Yocto?
    23. How would you add PulseAudio to a Yocto image?
    24. How would you debug:
    cannot find -lpulse
    cannot find -lpulse-simple
    1. How do DEPENDS and RDEPENDS apply to an audio application?

    PART 45 – Automotive Embedded Linux

    For automotive roles, prepare these too:

    1. What is Automotive Linux?
    2. Embedded Linux vs Automotive Linux?
    3. What is Automotive Grade Linux?
    4. What is Android Automotive?
    5. Embedded Linux vs Android Automotive?
    6. What is QNX?
    7. Linux vs QNX?
    8. What is AUTOSAR?
    9. AUTOSAR Classic vs Adaptive?
    10. Linux vs AUTOSAR Adaptive?
    11. What is CAN?
    12. CAN FD?
    13. What is SOME/IP?
    14. What is DDS?
    15. What is Ethernet AVB?
    16. What is TSN?
    17. What is ECU?
    18. What is IVI?
    19. What is infotainment system?
    20. What is gateway ECU?
    21. What is ADAS?
    22. What is functional safety?
    23. What is ISO 26262?
    24. What is ASIL?
    25. What is cybersecurity in automotive Linux?

    PART 46 — Extremely Important “Explain Your Project” Questions

    These often matter more than theoretical questions.

    Be ready to answer:

    1. Explain your Embedded Linux project.
    2. Explain your Yocto project.
    3. Why did you use Yocto?
    4. Why not build the Linux system manually?
    5. What BSP did you use?
    6. Which machine did you use?
    7. Which Linux kernel version?
    8. Which Yocto release?
    9. Which layers did you use?
    10. Did you create a custom layer?
    11. Did you write recipes?
    12. Did you modify the kernel?
    13. Did you modify Device Tree?
    14. Did you write a driver?
    15. How did you debug the driver?
    16. How did you debug Yocto builds?
    17. How did you reduce build time?
    18. How did you reduce image size?
    19. How did you add an application to the image?
    20. How did you add a systemd service?
    21. How did you configure networking?
    22. How did you configure audio?
    23. How did you debug boot issues?
    24. What was the hardest bug you solved?
    25. What performance optimization did you make?
    26. What was your contribution personally?
    27. What would you improve in the project?

    PART 47 – Must-Know Commands

    You should be comfortable explaining these without memorizing blindly.

    Linux

    ps
    top
    htop
    free
    df
    du
    mount
    lsblk
    fdisk
    dmesg
    journalctl
    systemctl
    ip
    ss
    ping
    route
    ethtool
    tcpdump
    strace
    lsof
    find
    grep
    awk
    sed
    cat
    less
    hexdump
    dd
    chmod
    chown
    ln
    scp
    ssh

    Kernel

    uname
    lsmod
    modprobe
    insmod
    rmmod
    modinfo
    dmesg
    sysctl

    Yocto

    source oe-init-build-env
    bitbake
    bitbake-layers
    devtool
    recipetool
    oe-pkgdata-util

    Especially:

    bitbake -e
    bitbake -c clean
    bitbake -c cleansstate
    bitbake -c devshell
    bitbake -c menuconfig
    bitbake -c compile
    bitbake -c install
    bitbake-layers show-layers
    bitbake-layers show-recipes
    bitbake-layers show-appends

    PART 48 – 20 Questions You Absolutely Must Master

    If you have limited preparation time, do not skip these:

    1. Explain complete Embedded Linux boot process.
    2. Explain Yocto architecture.
    3. Yocto vs Buildroot.
    4. Yocto vs OpenEmbedded vs Poky vs BitBake.
    5. What is a recipe?
    6. What is a Yocto layer?
    7. .bb vs .bbappend?
    8. DEPENDS vs RDEPENDS?
    9. Explain BitBake task flow.
    10. How do you add an application to a Yocto image?
    11. How do you customize the Linux kernel using Yocto?
    12. How do you modify Device Tree using Yocto?
    13. How do you debug a failed Yocto recipe?
    14. How do you debug cannot find -lxxx?
    15. What is sstate cache?
    16. What is sysroot?
    17. How does Device Tree bind to a driver?
    18. How do you debug a driver that doesn’t probe?
    19. How do you debug a Linux kernel boot failure?
    20. Explain your complete Embedded Linux/Yocto project end-to-end.

    Final Interview Preparation Structure

    Recommend preparing in this order:

                        EMBEDDED LINUX
                              │
              ┌───────────────┴────────────────┐
              │                                │
           LINUX                           YOCTO
              │                                │
       ┌──────┼───────┐              ┌─────────┼─────────┐
       │      │       │              │         │         │
     Boot   Kernel  System          BitBake   Recipes   Layers
       │      │       │              │         │         │
     UBoot Drivers  IPC             Tasks   Packages   BSP
       │      │       │              │         │         │
     DT   Interrupts Processes      Variables  Image   Machine
       │      │       │              │         │         │
       └──────┼───────┘              └─────────┼─────────┘
              │                                │
              └──────────────┬─────────────────┘
                             │
                        DEBUGGING
                             │
                 ┌───────────┼───────────┐
                 │           │           │
               GDB         ftrace      strace
                 │           │           │
               KGDB        perf       dmesg
                             │
                        PRODUCTION
                             │
                  ┌──────────┼──────────┐
                  │          │          │
               Security     OTA       Performance
  • Linux System Programming – Complete Interview Question Bank

    1. Linux System Programming Fundamentals

    Basic Concepts

    1. What is Linux System Programming?
    2. What is the difference between System Programming and Application Programming?
    3. What is a Linux system call?
    4. Why do we need system calls?
    5. What happens internally when a system call is called?
    6. What is the difference between user space and kernel space?
    7. What is a context switch?
    8. What causes a context switch?
    9. What is process context?
    10. What is interrupt context?
    11. What is kernel mode?
    12. What is user mode?
    13. How does a program transition from user mode to kernel mode?
    14. What is the system call interface?
    15. What is libc?
    16. Difference between glibc, libc and system calls.
    17. What is POSIX?
    18. Linux vs POSIX?
    19. What is a POSIX API?
    20. What is an API vs ABI?
    21. What is errno?
    22. How is errno implemented?
    23. Why should you not directly check errno after every function?
    24. What does perror() do?
    25. Difference between perror() and strerror().

    2. Processes

    This is one of the most important interview areas.

    Process Basics

    1. What is a process?
    2. Process vs program?
    3. Process vs thread?
    4. What are the different process states?
    5. What is PID?
    6. What is PPID?
    7. What is process ID 1?
    8. What is a parent process?
    9. What is a child process?
    10. What is an orphan process?
    11. What is a zombie process?
    12. How does a process become zombie?
    13. How does the parent remove a zombie?
    14. What happens if the parent terminates before the child?
    15. Who adopts an orphan process?
    16. What is process hierarchy?
    17. How can you see process hierarchy in Linux?
    18. What is ps?
    19. What is /proc/<pid>?

    3. fork()

    1. What is fork()?
    2. What does fork() return?
    3. What happens internally during fork()?
    4. Does fork() copy the entire process memory?
    5. What is Copy-on-Write (COW)?
    6. Why is Copy-on-Write used?
    7. What happens to global variables after fork()?
    8. What happens to stack after fork()?
    9. What happens to heap after fork()?
    10. What happens to file descriptors after fork()?
    11. Does child inherit environment variables?
    12. Does child inherit signal handlers?
    13. Does child inherit pending signals?
    14. Does child inherit mutexes?
    15. What happens to threads after fork() in a multithreaded process?
    16. What is fork() + exec()?
    17. Why is fork() commonly followed by exec()?

    Coding Questions

    pid_t pid = fork();
    
    if (pid == 0)
        printf("Child\n");
    else if (pid > 0)
        printf("Parent\n");
    else
        perror("fork");

    Interviewers may ask:

    How many times will this code execute?

    4. exec()

    Know all of these:

    • execl()
    • execlp()
    • execle()
    • execv()
    • execvp()
    • execve()

    Questions:

    1. What does exec() do?
    2. Does exec() create a new process?
    3. Difference between fork() and exec().
    4. Why is exec() usually used with fork()?
    5. Difference between execv() and execvp().
    6. What happens to PID after exec()?
    7. What happens to open file descriptors after exec()?
    8. What is FD_CLOEXEC?
    9. What happens to memory after exec()?
    10. What happens to signal dispositions after exec()?
    11. Why can exec() fail?
    12. Explain fork() → exec() → wait().

    5. Process Termination

    1. exit()
    2. _exit()
    3. _Exit()
    4. Difference between exit() and _exit().
    5. What happens when exit() is called?
    6. What are atexit() handlers?
    7. What happens to stdio buffers?
    8. Why is _exit() preferred in a child after fork() in certain cases?
    9. What is exit status?
    10. How does parent obtain child exit status?

    6. wait() / waitpid()

    1. What is wait()?
    2. What is waitpid()?
    3. Difference between wait() and waitpid().
    4. What is WIFEXITED()?
    5. What is WEXITSTATUS()?
    6. What is WIFSIGNALED()?
    7. What is WTERMSIG()?
    8. What is WIFSTOPPED()?
    9. What is WSTOPSIG()?
    10. What is WIFCONTINUED()?
    11. What is blocking wait()?
    12. How do you perform non-blocking wait?
    13. How do you prevent zombie processes?

    7. File Descriptors

    This is extremely important for Linux interviews.

    1. What is a file descriptor?
    2. Why does Linux use file descriptors?
    3. What are standard file descriptors?
    4. stdin = 0
    5. stdout = 1
    6. stderr = 2
    7. What is a file descriptor table?
    8. What is an open file description?
    9. What is an inode?
    10. Explain relationship:
    Process
       ↓
    File Descriptor
       ↓
    Open File Description
       ↓
    Inode
       ↓
    File
    1. What does open() return?
    2. What happens internally when open() is called?
    3. What happens when close() is called?
    4. What happens if you don’t close a file descriptor?
    5. What is FD leak?
    6. How do you detect FD leaks?
    7. What is the maximum number of FDs?
    8. What is ulimit -n?
    9. Difference between file descriptor and FILE pointer.
    10. Difference between fd and FILE *.

    8. File Operations

    Know:

    open()
    close()
    read()
    write()
    pread()
    pwrite()
    lseek()
    fcntl()
    ioctl()
    dup()
    dup2()
    dup3()

    Questions:

    1. Explain open().
    2. Explain read().
    3. Explain write().
    4. Explain close().
    5. What does lseek() do?
    6. What is SEEK_SET?
    7. What is SEEK_CUR?
    8. What is SEEK_END?
    9. Can lseek() be used on a pipe?
    10. What happens if read() returns 0?
    11. What does partial read() mean?
    12. What does partial write() mean?
    13. Why can write() write fewer bytes than requested?
    14. Difference between blocking and non-blocking I/O.
    15. What is O_RDONLY?
    16. O_WRONLY?
    17. O_RDWR?
    18. O_CREAT?
    19. O_APPEND?
    20. O_TRUNC?
    21. O_EXCL?
    22. O_NONBLOCK?
    23. O_SYNC?
    24. O_DSYNC?
    25. O_CLOEXEC?

    9. dup(), dup2(), dup3()

    1. What is dup()?
    2. What is dup2()?
    3. What is dup3()?
    4. Difference between dup() and dup2().
    5. How does shell output redirection work?

    Example:

    ./program > output.txt
    1. How can you implement:
    command > file

    using system calls?

    Answer involves:

    open()
    dup2()
    close()
    exec()

    10. File I/O vs Standard I/O

    1. read() vs fread()
    2. write() vs fwrite()
    3. open() vs fopen()
    4. close() vs fclose()
    5. What is stdio buffering?
    6. Full buffering?
    7. Line buffering?
    8. Unbuffered I/O?
    9. Why does printf() not immediately write to terminal/file?
    10. What does fflush() do?
    11. Why can output be duplicated after fork()?

    11. Pipes

    1. What is a pipe?
    2. How does pipe work?
    3. Is pipe unidirectional?
    4. What are anonymous pipes?
    5. What are named pipes?
    6. What is FIFO?
    7. Difference between pipe and FIFO.
    8. How is a pipe created?
    9. What does pipe() return?
    10. What happens when pipe buffer becomes full?
    11. What happens when no reader exists?
    12. What happens when no writer exists?
    13. What happens when all writers close the pipe?
    14. What does read() return on EOF?
    15. What happens when writing to a pipe with no reader?
    16. What is SIGPIPE?
    17. What is PIPE_BUF?
    18. Is pipe communication bidirectional?
    19. How can two processes communicate bidirectionally?

    12. FIFO

    1. What is FIFO?
    2. Why is FIFO called named pipe?
    3. How do you create FIFO?
    4. mkfifo()
    5. FIFO vs regular file.
    6. FIFO vs anonymous pipe.
    7. Blocking behavior of FIFO.
    8. What happens when FIFO has no reader?
    9. What happens when FIFO has no writer?

    13. IPC – Inter Process Communication

    You should know all major IPC mechanisms:

    Pipe
    FIFO
    Message Queue
    Shared Memory
    Semaphore
    Socket
    Signal

    Questions:

    1. What is IPC?
    2. Why do processes need IPC?
    3. List Linux IPC mechanisms.
    4. Which IPC is fastest?
    5. Which IPC allows direct shared memory?
    6. Which IPC provides message boundaries?
    7. Which IPC is suitable for large data?
    8. Shared memory vs pipe.
    9. Message queue vs pipe.
    10. Semaphore vs mutex.
    11. Socket vs pipe.

    14. Shared Memory

    1. What is shared memory?
    2. Why is shared memory fast?
    3. How do two processes share memory?
    4. What is shmget()?
    5. shmat()?
    6. shmdt()?
    7. shmctl()?
    8. POSIX shared memory?
    9. shm_open()
    10. mmap()
    11. Shared memory synchronization?
    12. Why does shared memory need synchronization?
    13. Shared memory vs message queue.
    14. Shared memory vs pipe.
    15. How would you implement producer-consumer using shared memory?

    15. Message Queues

    System V

    msgget()
    msgsnd()
    msgrcv()
    msgctl()

    POSIX

    mq_open()
    mq_send()
    mq_receive()
    mq_close()
    mq_unlink()

    Questions:

    1. What is message queue?
    2. Message queue vs pipe.
    3. Why use message queues?
    4. What is message priority?
    5. What happens when queue is full?
    6. Blocking vs non-blocking message queue.
    7. POSIX vs System V message queues.

    16. Signals

    Another must-know topic.

    1. What is a signal?
    2. Why are signals used?
    3. Synchronous vs asynchronous signals.
    4. SIGINT
    5. SIGTERM
    6. SIGKILL
    7. SIGSTOP
    8. SIGSEGV
    9. SIGBUS
    10. SIGPIPE
    11. SIGCHLD
    12. SIGALRM
    13. SIGUSR1
    14. SIGUSR2
    15. What is signal handler?
    16. signal() vs sigaction().
    17. Why prefer sigaction()?
    18. What is signal masking?
    19. What is sigprocmask()?
    20. What is sigpending()?
    21. What is sigsuspend()?
    22. What is kill()?
    23. Does kill() always terminate a process?
    24. What does raise() do?
    25. What is pause()?
    26. What is a blocked signal?
    27. What is a pending signal?
    28. Can SIGKILL be caught?
    29. Can SIGSTOP be caught?
    30. What happens when multiple signals arrive?
    31. What are real-time signals?
    32. Standard vs real-time signals.
    33. What is signal-safe function?
    34. What functions can safely be called from signal handlers?

    17. Threads

    1. What is a thread?
    2. Process vs thread.
    3. Why use threads?
    4. User-level vs kernel-level threads.
    5. What is POSIX thread?
    6. pthread_create()
    7. pthread_join()
    8. pthread_exit()
    9. pthread_self()
    10. pthread_cancel()
    11. What happens if thread function returns?
    12. Joinable vs detached thread.
    13. What is a detached thread?
    14. What happens if main thread exits?
    15. Thread stack?
    16. Thread-local storage?
    17. What does each thread share?
    18. What does each thread have independently?

    Very common question:

    What is shared between threads?

    Answer:

    Code
    Data
    Heap
    Global variables
    Open file descriptors
    Address space

    Each thread has its own:

    Stack
    Registers
    Program counter
    Thread ID

    18. Mutex

    1. What is mutex?
    2. Why do we need mutex?
    3. pthread_mutex_init()
    4. pthread_mutex_lock()
    5. pthread_mutex_unlock()
    6. pthread_mutex_destroy()
    7. What is recursive mutex?
    8. Normal mutex?
    9. Error-checking mutex?
    10. Mutex vs semaphore.
    11. Mutex vs spinlock.
    12. What is deadlock?
    13. How does deadlock happen?
    14. How can deadlock be prevented?
    15. What is lock ordering?

    19. Condition Variables

    1. What is condition variable?
    2. Why use condition variable?
    3. pthread_cond_wait()
    4. pthread_cond_signal()
    5. pthread_cond_broadcast()
    6. Why does pthread_cond_wait() release mutex?
    7. Why should condition variable be used with mutex?
    8. Why should while generally be used instead of if around condition waits?
    9. What is spurious wakeup?
    10. Producer-consumer using condition variables.

    20. Semaphores

    1. What is semaphore?
    2. Binary semaphore?
    3. Counting semaphore?
    4. sem_init()
    5. sem_wait()
    6. sem_post()
    7. sem_trywait()
    8. sem_destroy()
    9. Mutex vs semaphore.
    10. Binary semaphore vs mutex.
    11. Counting semaphore use cases.
    12. Can a different thread unlock a mutex?
    13. Can a different thread call sem_post()?

    21. Deadlock

    Know the four Coffman conditions:

    1. Mutual exclusion
    2. Hold and wait
    3. No preemption
    4. Circular wait

    Interview questions:

    • What is deadlock?
    • Give a real example.
    • How do you detect deadlock?
    • How do you prevent deadlock?
    • How can lock ordering prevent deadlock?
    • Deadlock vs starvation.
    • Deadlock vs livelock.

    22. Race Conditions

    1. What is race condition?
    2. Give an example.
    3. How do you reproduce race conditions?
    4. How do you prevent race conditions?
    5. Mutex solution.
    6. Atomic operation solution.
    7. Race condition vs data race.
    8. Why does volatile NOT solve race conditions?
    9. Atomic vs volatile.

    23. Synchronization

    Know:

    Mutex
    Semaphore
    Condition Variable
    Spinlock
    Read/Write Lock
    Atomic Operations
    Memory Barriers
    Futex

    Questions:

    1. Mutex vs semaphore.
    2. Mutex vs spinlock.
    3. Spinlock vs rwlock.
    4. Atomic operation vs mutex.
    5. What is memory ordering?
    6. What is memory barrier?
    7. What is futex()?
    8. Why are futexes important in Linux?

    24. Scheduling

    1. What is CPU scheduling?
    2. Preemptive scheduling?
    3. Cooperative scheduling?
    4. Process priority?
    5. Nice value?
    6. nice()
    7. setpriority()
    8. Real-time scheduling?
    9. SCHED_FIFO
    10. SCHED_RR
    11. SCHED_OTHER
    12. SCHED_DEADLINE
    13. What is priority inversion?
    14. Priority inheritance?
    15. Priority ceiling?

    25. CPU Affinity

    1. What is CPU affinity?
    2. Why pin a thread/process to a CPU?
    3. sched_setaffinity()
    4. sched_getaffinity()
    5. Why is CPU affinity useful in real-time/embedded systems?

    26. mmap()

    Extremely important for Embedded Linux.

    1. What is mmap()?
    2. Why use mmap()?
    3. Memory mapping?
    4. File-backed mapping?
    5. Anonymous mapping?
    6. MAP_SHARED
    7. MAP_PRIVATE
    8. PROT_READ
    9. PROT_WRITE
    10. PROT_EXEC
    11. MAP_ANONYMOUS
    12. MAP_FIXED
    13. munmap()
    14. msync()
    15. mprotect()
    16. madvise()
    17. mmap vs read/write.
    18. How can processes communicate using mmap?
    19. How does mmap relate to device drivers?
    20. Why do drivers expose mmap()?

    27. Virtual Memory

    1. What is virtual memory?
    2. Why does Linux use virtual memory?
    3. Virtual address vs physical address.
    4. Page?
    5. Page table?
    6. MMU?
    7. TLB?
    8. Page fault?
    9. Minor page fault?
    10. Major page fault?
    11. Demand paging?
    12. Copy-on-write?
    13. Anonymous memory?
    14. File-backed memory?
    15. Swap?
    16. What happens during page fault?
    17. What is memory fragmentation?
    18. Internal vs external fragmentation.

    28. brk() and mmap() / Heap

    1. How does malloc() obtain memory?
    2. What is brk()?
    3. What is sbrk()?
    4. Does malloc always use brk()?
    5. When does malloc use mmap()?
    6. What happens when free() is called?
    7. What is heap fragmentation?
    8. What is memory leak?
    9. How can memory leaks be detected?

    29. select()

    1. What is select()?
    2. Why use select()?
    3. What is I/O multiplexing?
    4. What is fd_set?
    5. FD_ZERO()
    6. FD_SET()
    7. FD_CLR()
    8. FD_ISSET()
    9. What is timeout?
    10. Limitations of select().
    11. Why does select() modify fd_set?
    12. What is FD_SETSIZE?

    30. poll()

    1. What is poll()?
    2. pollfd structure.
    3. POLLIN
    4. POLLOUT
    5. POLLERR
    6. POLLHUP
    7. POLLNVAL
    8. select() vs poll().
    9. Advantages of poll.

    31. epoll()

    Very important for advanced Linux interviews.

    1. What is epoll?
    2. Why was epoll introduced?
    3. epoll_create1()
    4. epoll_ctl()
    5. epoll_wait()
    6. EPOLLIN
    7. EPOLLOUT
    8. EPOLLERR
    9. EPOLLHUP
    10. Level-triggered epoll.
    11. Edge-triggered epoll.
    12. LT vs ET.
    13. Why must you use non-blocking I/O with ET?
    14. EPOLLONESHOT
    15. EPOLLEXCLUSIVE
    16. epoll vs select.
    17. epoll vs poll.
    18. How does epoll scale with thousands of FDs?

    32. Non-Blocking I/O

    1. What is blocking I/O?
    2. What is non-blocking I/O?
    3. O_NONBLOCK
    4. What does EAGAIN mean?
    5. What does EWOULDBLOCK mean?
    6. How do you implement non-blocking read?
    7. Non-blocking socket.
    8. Non-blocking pipe.
    9. Non-blocking device driver.

    33. Sockets

    This is a huge interview topic.

    Basics

    1. What is socket?
    2. What is socket programming?
    3. TCP vs UDP.
    4. Client-server architecture.
    5. What is IP address?
    6. What is port?
    7. What is protocol?
    8. What is socket family?
    9. AF_INET
    10. AF_INET6
    11. AF_UNIX

    TCP

    Know:

    socket()
    bind()
    listen()
    accept()
    connect()
    send()
    recv()
    close()

    Questions:

    1. Explain TCP server flow.
    2. Explain TCP client flow.
    3. Why is listen() required?
    4. What does accept() return?
    5. Does accept() create a new socket?
    6. Difference between listening socket and connected socket.
    7. What is backlog?
    8. What happens if accept() isn’t called?
    9. What does connect() do?
    10. What happens when client closes connection?
    11. What does recv() return 0 mean?
    12. What is SO_REUSEADDR?
    13. What is SO_REUSEPORT?

    34. UDP

    1. TCP vs UDP.
    2. Is UDP connection-oriented?
    3. Does UDP guarantee delivery?
    4. Does UDP preserve message boundaries?
    5. sendto()
    6. recvfrom()
    7. sendmsg()
    8. recvmsg()
    9. UDP broadcast.
    10. UDP multicast.

    35. Unix Domain Sockets

    Especially useful in Embedded Linux / Android.

    1. What is Unix domain socket?
    2. Why use Unix sockets?
    3. Unix socket vs TCP socket.
    4. AF_UNIX
    5. Stream vs datagram Unix sockets.
    6. Abstract namespace sockets.
    7. How can processes communicate through Unix sockets?

    36. Socket I/O Multiplexing

    Questions:

    1. How can one server handle multiple clients?
    2. Threads vs select.
    3. Threads vs epoll.
    4. select + socket.
    5. poll + socket.
    6. epoll + socket.
    7. Non-blocking socket + epoll.
    8. Reactor pattern.

    37. File System

    1. What is filesystem?
    2. What is inode?
    3. What is directory?
    4. What is hard link?
    5. What is symbolic link?
    6. Hard link vs soft link.
    7. What is mount?
    8. What is mount point?
    9. What is /proc?
    10. What is /sys?
    11. What is /dev?
    12. What is /tmp?
    13. What is /etc?
    14. What is /var?
    15. What is /home?
    16. What is /run?
    17. What is tmpfs?
    18. What is procfs?
    19. What is sysfs?
    20. What is devtmpfs?

    38. Directory APIs

    Know:

    opendir()
    readdir()
    closedir()
    rewinddir()
    seekdir()
    telldir()

    Questions:

    1. How do you list directory contents from C?
    2. What does readdir() return?
    3. What is struct dirent?
    4. What is d_name?
    5. How do you recursively traverse a directory?

    39. File Metadata

    Know:

    stat()
    fstat()
    lstat()

    Questions:

    1. Difference between stat() and lstat().
    2. stat() vs fstat().
    3. What is struct stat?
    4. File size?
    5. File permissions?
    6. File type?
    7. Access time?
    8. Modification time?
    9. Change time?
    10. What is st_mode?
    11. What is S_ISREG()?
    12. S_ISDIR()?
    13. S_ISLNK()?

    40. Permissions

    1. Linux file permissions.
    2. Owner/group/others.
    3. rwx.
    4. Numeric permissions.
    5. chmod().
    6. chown().
    7. fchmod().
    8. umask().
    9. What is umask?
    10. What happens when creating a file?
    11. SUID?
    12. SGID?
    13. Sticky bit?
    14. ACL?
    15. Capability?

    41. Links

    1. Hard link?
    2. Soft link?
    3. link()
    4. unlink()
    5. symlink()
    6. readlink()
    7. Why can’t directories normally have hard links created by users?
    8. What happens when original file is deleted?

    42. Daemons

    1. What is daemon?
    2. Foreground vs background process.
    3. How do you create daemon?
    4. What is daemonization?
    5. Why call fork()?
    6. Why call setsid()?
    7. Why change working directory?
    8. Why redirect stdin/stdout/stderr?
    9. Why close inherited FDs?
    10. What is a session?
    11. What is process group?
    12. What is controlling terminal?

    43. Sessions & Process Groups

    1. What is process group?
    2. What is process group ID?
    3. What is session?
    4. What is session leader?
    5. What is controlling terminal?
    6. setsid()
    7. setpgid()
    8. getsid()
    9. getpgrp()
    10. Why are process groups needed for job control?

    44. Terminal / TTY

    1. What is TTY?
    2. What is pseudo-terminal?
    3. PTY vs TTY.
    4. What is /dev/tty?
    5. /dev/pts?
    6. What is terminal driver?
    7. What is terminal line discipline?
    8. What is canonical mode?
    9. What is raw mode?
    10. termios.

    45. Memory Management

    1. malloc()
    2. calloc()
    3. realloc()
    4. free()
    5. memset()
    6. memcpy()
    7. memmove()
    8. memcmp()
    9. Memory leak.
    10. Double free.
    11. Use-after-free.
    12. Buffer overflow.
    13. Dangling pointer.
    14. Heap corruption.
    15. Stack overflow.
    16. Memory alignment.
    17. Memory fragmentation.
    18. How do you debug memory corruption?

    46. memcpy() vs memmove()

    1. Difference?
    2. What happens with overlapping memory?
    3. Why can memcpy() fail with overlapping regions?
    4. Implementation-level difference.

    47. Memory Alignment

    1. What is alignment?
    2. Why is alignment important?
    3. Aligned vs unaligned access.
    4. ARM alignment behavior.
    5. Structure alignment.
    6. Padding.
    7. posix_memalign()
    8. aligned_alloc().

    48. ioctl()

    Especially important for device-driver interviews.

    1. What is ioctl?
    2. Why use ioctl?
    3. Why can’t normal read/write handle everything?
    4. How does ioctl work?
    5. What is ioctl command number?
    6. _IO()
    7. _IOR()
    8. _IOW()
    9. _IOWR()
    10. What is direction?
    11. What is command magic number?
    12. What is command number?
    13. How does userspace communicate with driver through ioctl?
    14. Why must kernel validate user pointers?
    15. copy_to_user()
    16. copy_from_user().

    49. fcntl()

    1. What is fcntl()?
    2. File descriptor duplication.
    3. File descriptor flags.
    4. File status flags.
    5. F_GETFD
    6. F_SETFD
    7. F_GETFL
    8. F_SETFL
    9. FD_CLOEXEC
    10. File locking with fcntl().

    50. File Locking

    1. What is file locking?
    2. Advisory locking?
    3. Mandatory locking?
    4. flock()
    5. fcntl() locking.
    6. Shared lock?
    7. Exclusive lock?
    8. Blocking vs non-blocking lock.

    51. Timers

    Know:

    sleep()
    usleep()
    nanosleep()
    alarm()
    setitimer()
    timer_create()
    timer_settime()
    timerfd_create()

    Questions:

    1. sleep() vs nanosleep().
    2. Why is usleep() obsolete?
    3. What is POSIX timer?
    4. What is timerfd?
    5. Timer vs sleep.
    6. Periodic timer?
    7. Absolute vs relative timer.
    8. CLOCK_MONOTONIC vs CLOCK_REALTIME.

    52. Time APIs

    1. time()
    2. gettimeofday()
    3. clock_gettime()
    4. clock_settime()
    5. CLOCK_REALTIME
    6. CLOCK_MONOTONIC
    7. CLOCK_MONOTONIC_RAW
    8. CLOCK_PROCESS_CPUTIME_ID
    9. CLOCK_THREAD_CPUTIME_ID

    Very common:

    Why should timeout logic generally use CLOCK_MONOTONIC instead of CLOCK_REALTIME?

    53. /proc

    Extremely important in Linux.

    1. What is proc filesystem?
    2. Why is /proc called virtual filesystem?
    3. /proc/cpuinfo
    4. /proc/meminfo
    5. /proc/interrupts
    6. /proc/ioports
    7. /proc/iomem
    8. /proc/mounts
    9. /proc/modules
    10. /proc/<pid>/status
    11. /proc/<pid>/maps
    12. /proc/<pid>/fd
    13. /proc/<pid>/cmdline
    14. /proc/<pid>/stat
    15. /proc/loadavg

    54. /sys / sysfs

    1. What is sysfs?
    2. Difference between /proc and /sys.
    3. What is kobject?
    4. What is sysfs attribute?
    5. What is /sys/class?
    6. What is /sys/devices?
    7. What is /sys/bus?
    8. How do drivers expose information through sysfs?

    55. Environment Variables

    1. What is environment variable?
    2. getenv()
    3. setenv()
    4. unsetenv()
    5. putenv()
    6. How does child inherit environment?
    7. How does execve() handle environment?

    56. Dynamic Linking

    1. Static linking vs dynamic linking.
    2. What is shared library?
    3. .so file?
    4. .a file?
    5. What is ELF?
    6. What is dynamic linker?
    7. What is ld.so?
    8. What is LD_LIBRARY_PATH?
    9. What is RPATH?
    10. What is RUNPATH?
    11. What is symbol resolution?
    12. What is lazy binding?
    13. What is PLT?
    14. What is GOT?
    15. What is dlopen()?
    16. dlsym()
    17. dlclose()
    18. dlerror().

    57. ELF

    1. What is ELF?
    2. ELF header?
    3. Program header?
    4. Section header?
    5. .text
    6. .data
    7. .bss
    8. .rodata
    9. Symbol table.
    10. Relocation.
    11. Static vs dynamic ELF.
    12. readelf.
    13. objdump.
    14. nm.
    15. ldd.

    58. System Call Tracing

    strace

    Know:

    strace ./program
    strace -f ./program
    strace -p PID
    strace -e trace=file ./program
    strace -e trace=network ./program

    Questions:

    1. What is strace?
    2. How does strace work?
    3. How do you trace child processes?
    4. How do you trace file operations?
    5. How do you trace network calls?
    6. What is ptrace()?
    7. How does debugger use ptrace?

    59. Debugging

    GDB

    Know:

    break
    run
    continue
    next
    step
    finish
    print
    display
    watch
    info registers
    info threads
    backtrace
    thread

    Questions:

    1. How do you debug segmentation fault?
    2. What is core dump?
    3. How do you enable core dump?
    4. What is ulimit -c?
    5. How do you analyze core dump?
    6. What is GDB?
    7. Attach GDB to running process?
    8. Debug multithreaded application?
    9. Debug deadlock?
    10. Debug memory corruption?

    60. Core Dump

    1. What is core dump?
    2. Why is core dump generated?
    3. How to enable core dump?
    4. What is ulimit -c unlimited?
    5. How do you analyze core?
    6. What information does core contain?
    7. What is a segmentation fault?
    8. SIGSEGV vs SIGBUS.

    61. Linux IPC – Advanced

    Know:

    eventfd
    signalfd
    timerfd
    memfd
    pidfd
    futex

    Questions:

    1. What is eventfd?
    2. Why use eventfd?
    3. eventfd vs pipe.
    4. What is signalfd?
    5. Why use signalfd?
    6. What is timerfd?
    7. Why combine timerfd with epoll?
    8. What is pidfd?
    9. Why is pidfd useful?
    10. What is futex?
    11. How does pthread mutex relate to futex?

    62. Asynchronous I/O

    1. What is asynchronous I/O?
    2. Synchronous vs asynchronous I/O.
    3. POSIX AIO.
    4. aio_read()
    5. aio_write()
    6. io_uring.
    7. What is io_uring?
    8. Why was io_uring introduced?
    9. io_uring vs epoll.
    10. Blocking vs non-blocking vs asynchronous I/O.

    63. io_uring

    For modern Linux interviews:

    1. What is io_uring?
    2. Submission Queue?
    3. Completion Queue?
    4. SQE?
    5. CQE?
    6. Why can io_uring reduce syscall overhead?
    7. io_uring vs epoll.

    64. Namespaces

    Important for modern Linux.

    1. What is Linux namespace?
    2. Why are namespaces used?
    3. PID namespace.
    4. Mount namespace.
    5. Network namespace.
    6. IPC namespace.
    7. UTS namespace.
    8. User namespace.
    9. Cgroup namespace.
    10. Time namespace.

    65. Cgroups

    1. What are cgroups?
    2. Why use cgroups?
    3. CPU limits.
    4. Memory limits.
    5. I/O limits.
    6. Process accounting.
    7. cgroups vs namespaces.
    8. How containers use cgroups.

    66. Containers

    1. What is Linux container?
    2. Container vs VM.
    3. How do namespaces provide isolation?
    4. How do cgroups provide resource control?
    5. What is Docker fundamentally using from Linux?

    67. Capabilities

    1. What are Linux capabilities?
    2. Why capabilities?
    3. Root vs capabilities.
    4. CAP_NET_ADMIN
    5. CAP_SYS_ADMIN
    6. CAP_SYS_PTRACE
    7. Effective capabilities.
    8. Permitted capabilities.
    9. Inheritable capabilities.

    68. Security

    1. File permissions.
    2. ACL.
    3. Capabilities.
    4. SELinux.
    5. AppArmor.
    6. ASLR.
    7. NX bit.
    8. Stack canary.
    9. PIE.
    10. RELRO.

    69. Boot & Process Startup

    For Embedded Linux, know:

    Boot ROM
     ↓
    Bootloader
     ↓
    Linux Kernel
     ↓
    init
     ↓
    systemd / init system
     ↓
    Services
     ↓
    Application

    Questions:

    1. What happens after kernel boot?
    2. What is init?
    3. Why is PID 1 special?
    4. What is systemd?
    5. What is service?
    6. What is daemon?
    7. How does systemd start services?
    8. What is target?
    9. What is unit?
    10. What is journal?

    70. Linux Logging

    1. syslog()
    2. openlog()
    3. closelog()
    4. logger
    5. journald.
    6. journalctl.
    7. Kernel logs vs application logs.
    8. dmesg.
    9. Log levels.

    71. Kernel ↔ User Space Communication

    Very important for your Embedded Linux/device-driver interviews.

    Know:

    System Calls
    ioctl
    sysfs
    procfs
    debugfs
    netlink
    mmap
    signals
    device files

    Questions:

    1. How does userspace communicate with kernel?
    2. ioctl vs sysfs.
    3. sysfs vs procfs.
    4. debugfs?
    5. What is netlink?
    6. Why use mmap in drivers?
    7. How does /dev communicate with drivers?
    8. What happens when userspace opens /dev/mydevice?

    72. Device Files

    1. What is /dev?
    2. Character device vs block device.
    3. What is major number?
    4. What is minor number?
    5. What is mknod()?
    6. What is udev?
    7. How are device nodes created?
    8. What happens during:
    open("/dev/mydevice", ...);
    1. How does VFS reach driver?
    2. What is file_operations?

    73. VFS

    1. What is VFS?
    2. Why does Linux need VFS?
    3. What is inode?
    4. What is dentry?
    5. What is struct file?
    6. What is superblock?
    7. What is filesystem object?
    8. Explain:
    Application
     ↓
    System Call
     ↓
    VFS
     ↓
    Filesystem
     ↓
    Block Layer
     ↓
    Device Driver
     ↓
    Hardware
    1. Difference between inode and struct file.
    2. What is dentry cache?

    74. Linux Performance

    Know these tools:

    top
    htop
    ps
    vmstat
    iostat
    sar
    free
    uptime
    time
    perf
    strace
    ltrace
    pidstat
    mpstat
    iotop
    ftrace

    Questions:

    1. How do you find CPU bottleneck?
    2. How do you find memory bottleneck?
    3. How do you find I/O bottleneck?
    4. How do you identify high CPU process?
    5. How do you identify memory leak?
    6. How do you identify FD leak?
    7. How do you identify thread problems?
    8. How do you profile an application?

    75. perf

    1. What is perf?
    2. CPU profiling.
    3. perf stat
    4. perf record
    5. perf report
    6. CPU cycles.
    7. Instructions.
    8. Cache misses.
    9. Context switches.
    10. Page faults.

    76. ftrace

    1. What is ftrace?
    2. Function tracer.
    3. Function graph tracer.
    4. Tracepoints.
    5. kprobes.
    6. uprobes.
    7. How is ftrace different from strace?
    8. How do you investigate kernel latency?

    77. Linux I/O Architecture

    Understand:

    Application
        ↓
    read/write
        ↓
    VFS
        ↓
    Page Cache
        ↓
    Filesystem
        ↓
    Block Layer
        ↓
    I/O Scheduler
        ↓
    Device Driver
        ↓
    Hardware

    Questions:

    1. What is page cache?
    2. Buffered I/O?
    3. Direct I/O?
    4. O_DIRECT?
    5. O_SYNC?
    6. fsync()?
    7. fdatasync()?
    8. sync()?
    9. Why is write() not necessarily writing directly to disk?
    10. What happens when fsync() is called?

    78. System Call Internals

    For senior interviews:

    1. How does a system call work internally?
    2. What is syscall number?
    3. What happens during syscall entry?
    4. What happens during syscall return?
    5. What is syscall instruction?
    6. What is sysenter?
    7. ARM SVC instruction?
    8. x86 syscall mechanism?
    9. How are syscall arguments passed?
    10. What is syscall table?
    11. How does kernel return errno?

    79. Error Handling

    Know common errors:

    EINTR
    EAGAIN
    EWOULDBLOCK
    EINVAL
    EBADF
    ENOMEM
    EACCES
    EPERM
    ENOENT
    EEXIST
    EPIPE
    ECONNRESET
    ETIMEDOUT
    ENOSPC
    EMFILE
    ENFILE

    Questions:

    1. Difference between EINTR and EAGAIN.
    2. What should you do if read() returns EINTR?
    3. What is EMFILE?
    4. EMFILE vs ENFILE.
    5. What is EPIPE?
    6. Why can write() return EPIPE?
    7. What is ECONNRESET?
    8. What is EINVAL?

    80. Advanced Interview Scenarios

    These are where experienced interviewers differentiate candidates.

    Scenario 1

    Parent creates child, child exits, but process remains in ps. Why?

    → Zombie.

    Scenario 2

    Two threads increment a global counter but final value is incorrect. Why?

    → Race condition.

    Scenario 3

    Application CPU usage suddenly becomes 100%. How do you debug?

    → top → identify PID → top -H / ps -L → perf → GDB.

    Scenario 4

    Application crashes randomly with SIGSEGV.

    Discuss:

    core dump
    gdb
    backtrace
    ASAN
    valgrind
    memory corruption
    race condition
    use-after-free
    stack corruption

    Scenario 5

    Server needs to handle 10,000 connections.

    Discuss:

    non-blocking sockets
    epoll
    event-driven architecture

    Scenario 6

    Two processes need to exchange a 10 MB buffer continuously.

    Discuss:

    Shared Memory
    +
    Synchronization

    Scenario 7

    You need to notify a process that data is ready.

    Possible:

    pipe
    eventfd
    signal
    socket
    shared memory + semaphore

    Scenario 8

    Application leaks file descriptors. How do you find it?

    ls /proc/<pid>/fd

    and:

    lsof -p <pid>

    Scenario 9

    Application has memory leak.

    Discuss:

    Valgrind
    ASan
    heap profiling
    /proc/<pid>/status

    Scenario 10

    Thread A waits for Thread B, while B waits for A.

    → Deadlock.

    81. Must-Know Linux Commands for Interviews

    You should be comfortable with:

    ps
    top
    htop
    pstree
    pgrep
    pkill
    kill
    killall
    nice
    renice
    taskset
    lsof
    strace
    ltrace
    gdb
    readelf
    objdump
    nm
    ldd
    file
    size
    strings
    dmesg
    journalctl
    free
    vmstat
    iostat
    sar
    mpstat
    pidstat
    perf
    ftrace
    ip
    ss
    netstat
    mount
    umount
    df
    du
    ls
    find
    stat
    chmod
    chown
    ln

    82. Top 50 Questions You Absolutely Must Master

    If your interview is soon, prioritize these:

    1. What is a system call?
    2. User space vs kernel space?
    3. Process vs thread?
    4. fork()?
    5. Copy-on-write?
    6. exec()?
    7. fork() vs exec()?
    8. wait() vs waitpid()?
    9. Zombie vs orphan?
    10. File descriptor?
    11. File descriptor table?
    12. inode vs file descriptor?
    13. open/read/write/close?
    14. dup2()?
    15. fcntl()?
    16. Pipe?
    17. FIFO?
    18. Shared memory?
    19. Message queue?
    20. Semaphore?
    21. Signal?
    22. sigaction()?
    23. Signal masking?
    24. Mutex?
    25. Condition variable?
    26. Mutex vs semaphore?
    27. Race condition?
    28. Deadlock?
    29. Priority inversion?
    30. mmap()?
    31. Virtual memory?
    32. Page fault?
    33. select()?
    34. poll()?
    35. epoll()?
    36. LT vs ET?
    37. Blocking vs non-blocking I/O?
    38. TCP socket programming?
    39. TCP vs UDP?
    40. Unix domain socket?
    41. /proc?
    42. /sys?
    43. ioctl()?
    44. VFS?
    45. Device file?
    46. strace?
    47. GDB/core dump?
    48. perf?
    49. Dynamic linking/ELF?
    50. Kernel ↔ userspace communication?

    83. Embedded Linux Interview Priority

    Since you’re targeting Embedded Linux, don’t study every topic with equal depth.

    🔴 Tier 1 – Must Master

    Process
    fork
    exec
    wait
    File Descriptor
    File I/O
    Pipe
    Signal
    Thread
    Mutex
    Semaphore
    Condition Variable
    Race Condition
    Deadlock
    IPC
    mmap
    Virtual Memory
    select
    poll
    epoll
    Socket
    ioctl
    /proc
    /sys
    VFS
    Device Files
    System Calls

    🟠 Tier 2 – Strongly Recommended

    Shared Memory
    Message Queue
    FIFO
    fcntl
    File Locking
    Timers
    Scheduling
    CPU Affinity
    ELF
    Dynamic Linking
    Core Dump
    GDB
    strace
    perf
    ftrace
    Daemon
    TTY
    Unix Domain Socket
    Netlink
    eventfd
    timerfd
    signalfd

    🟡 Tier 3 – Advanced/Senior

    io_uring
    futex
    Namespaces
    Cgroups
    Capabilities
    SELinux
    ASLR
    PIE
    RELRO
    AIO
    Memory Ordering
    Advanced VFS
    Syscall Internals
    Kernel/User ABI