Skip to content
Tech Interview Prep
Technical interview guide

ROS (Robot Operating System) Fundamentals

The de facto standard middleware for robotics software: nodes, topics, and services that let components communicate.

Read
45 min
Practice MCQs
25
Interview Q&A
25
Edition
v4
Editorial status
Reviewed
Relevant for
Robotics Engineer

Scope: ROS 2 Rolling node, topic, service, action, QoS, executor, callback-group, lifecycle, tf2, parameter, security, rosbag2, and composition documentation reviewed 2026-09-04.

Curated: · Written: · Reviewed:

25 questions

MCQ-15A node `cam_driver` is started with `ros2 run cam_driver cam_driver --ros-args -r __ns:=/front -r image_raw:=/shared/image`. Its source code publishes to the relative topic name `image_raw`. Which topic does the node actually publish on?
MCQ-23A bringup launch file starts a camera driver and a perception node. Launched on the dev host with no namespace, perception receives frames. On the robot the same file runs as `ros2 launch bringup robot.launch.py namespace:=robot1`, and perception receives nothing. `ros2 topic list` shows `/camera/image_raw` and `/robot1/image_raw`; `ros2 topic info /camera/image_raw` reports 1 publisher and 0 subscribers. What explains the silence?
MCQ-24A ROS 2 Humble robot (default `rmw_fastrtps_cpp`) shows a new publisher on `/scan` in `ros2 topic info -v`, and the entry matches what the subscriber expects. What does that result actually establish about the peer?
MCQ-4A sensor driver publishes on /scan with QoS reliability RELIABLE, durability VOLATILE, and deadline 100 ms. A mapping node subscribes to /scan with reliability BEST_EFFORT, durability TRANSIENT_LOCAL, and deadline 200 ms. What happens?
MCQ-6A `/map` publisher is configured with durability=TRANSIENT_LOCAL, reliability=RELIABLE, history=KEEP_LAST, depth=3. It publishes map_v1 through map_v5, one per second. A subscriber process then starts and subscribes to `/map` with durability=TRANSIENT_LOCAL. Which samples does it receive when it joins?
MCQ-2A depth camera node publishes 640×480 frames at 30 Hz. Three consumers subscribe (a mapper, a recorder, and a visualizer) and the recorder's disk writes sometimes stall for hundreds of milliseconds. The publisher must keep publishing at 30 Hz regardless of any consumer's pace, and a consumer that starts late should get the newest frame rather than a backlog. Which interaction should the node use?
MCQ-5A ROS 2 Humble node publishes sensor_msgs/Imu at 100 Hz (10 ms period) with QoS: RELIABLE, KEEP_LAST depth 5, deadline 10 ms, lifespan 50 ms. The subscriber runs over Wi-Fi with 2% packet loss and a 30 ms retransmission round trip. Over a 60 s run it logs no dropped messages but reports deadline misses on about 2% of samples, and every delivered sample is under 50 ms old. Which diagnosis fits these numbers?
MCQ-19A ROS 2 Humble planner subscribes to `/scan` with `Reliability: RELIABLE`, `Deadline: 150 ms`, and `Liveliness: AUTOMATIC` with a 500 ms lease. The publisher runs at 10 Hz and the planner's executor is healthy. At t=0 the perception process is SIGKILLed mid-run. Which sequence of QoS events does the planner observe?
MCQ-10A ROS 2 node on a warehouse AMR runs for weeks between reboots. Its velocity controller arms a 100 ms watchdog: if no new cmd_vel arrives within 100 ms, it commands the base to stop. The host runs chrony with makestep configured, so a large NTP offset steps the system clock instead of slewing it. Which clock should the watchdog read to measure the 100 ms?
MCQ-11A robot moves at 1.2 m/s along +x. A lidar scan arrives with header.stamp = 100.025 s. The tf2 buffer holds odom->base_link at 100.000 s (x=0.000 m) and 100.100 s (x=0.120 m). The node's current time is 100.050 s. Which odom x-coordinate should tf2 return for the scan?
MCQ-12A ROS 2 Humble node declares `max_speed` with default 1.0 and a `floating_point_range` of [0.0, 2.0], and registers an on-set-parameters callback that returns `successful = false` for any proposed value above 1.5. The parameter was earlier accepted at 0.5. An operator now runs `ros2 param set /motor max_speed 1.8`. What is the value of `max_speed` after the call returns?
MCQ-13A perception node is a ROS 2 lifecycle node. Its on_configure callback creates the /scan publisher and loads the calibration file; on_activate starts the 10 Hz publish timer. After launch, `ros2 lifecycle get /perception` prints `inactive`, and the controller subscribed to /scan logs no messages for 5 s. What explains the silence?
MCQ-1A team runs a ROS 2 Humble robot whose single process starts a camera driver node, a detector node, and a planner node. Profiling shows the detector's 40 ms inference loop starves the planner's 5 ms control callback, so control jitter grows from 2 ms to 30 ms. The team wants the planner's callback to keep its 5 ms deadline without changing any node's code. What should they do?
MCQ-7A ROS 2 node runs a single-threaded executor and subscribes to two topics: /lidar at 20 Hz and /control at 50 Hz. The /lidar callback does a 60 ms blocking point-cloud transform; the /control callback takes 2 ms. A subscriber on /control reports that commands arrive in bursts with gaps up to ~60 ms, even though /control messages are published every 20 ms. What is the cause?
MCQ-3A ROS 2 node runs a `MultiThreadedExecutor` with 4 threads. Its `/move_arm` service callback and its `/estop` subscription callback are both in the node's default callback group. A client calls `/move_arm`; the callback blocks for 45 s while it streams a trajectory. Five seconds in, an operator publishes `true` on `/estop`. What happens to the e-stop callback?
MCQ-9A ROS 2 node (rclcpp) subscribes to /scan and /cmd, and both callbacks are placed in the same reentrant callback group. The node is spun with a MultiThreadedExecutor using 4 threads. Each /scan callback takes 200 ms to process, while /cmd messages arrive at 10 Hz. What happens to the /cmd callbacks while a /scan callback is running?
MCQ-8A ROS 2 node (rclcpp, Humble) subscribes to /scan and /odom. Both subscriptions are added to the same mutually exclusive callback group. Each callback blocks for 20 ms doing work. The node is spun with a MultiThreadedExecutor constructed with 4 threads. Each topic publishes at 50 Hz, so 100 callbacks/s arrive in total. What should you expect?
MCQ-21A rclcpp node runs on a MultiThreadedExecutor with 4 threads. Its eight subscriptions all use the node's default callback group, and each topic publishes at 100 Hz. CPU sits near 25% of the machine's four cores, the node never crashes, but end-to-end latency p99 has risen from 8 ms to 300 ms and every subscription queue is pinned at its depth limit. Which measurement identifies where the 300 ms is spent?
MCQ-25A ROS 2 Humble mobile base runs a controller node whose timer publishes `/cmd_vel` every 20 ms, and a LiDAR driver node whose scan callback takes about 120 ms to process each scan. Both nodes are spun by one single-threaded executor in the same process, and all QoS is left at defaults. `colcon test` passes 380 unit tests, and a 60-second smoke launch on a workstation, with a stub driver whose scan callback returns immediately, shows no problem. In the field, the worst-case gap between consecutive `/cmd_vel` messages grows from 20 ms to over 120 ms whenever scans are arriving, and the base's safety monitor trips. Which addition to the test suite would have caught this before deployment?
MCQ-18A ROS 2 warehouse AMR uses a custom message `msg/Waypoint.msg` with two fields, `float64 x` and `float64 y`, and no unit or frame fields. The route planner publishes `x = 2000.0`, `y = 0.0` on `/waypoint`, meaning millimeters in the `map` frame. The drive controller subscribes and reads the fields as meters in the `odom` frame. The `odom` frame origin sits 3 m along +y from the `map` frame origin, with axes aligned. The robot starts at the `odom` origin. Where does the robot end up, in the `map` frame?
MCQ-14A warehouse robot runs a 4 MB, 10 Hz point-cloud publisher and a 100 Hz motor-command node. As separate processes, each cloud costs 6 ms of serialization and copy on the subscriber's core, so the team loads both into one `rclcpp_components` container with a single-threaded executor and intra-process comms on. A week later an out-of-bounds read in the point-cloud filter segfaults. What is the most likely outcome?
MCQ-17A team records a 90-second run of a mobile robot: /scan at 10 Hz, /odom at 50 Hz, and /cmd_vel using a custom drive_msgs type. During the run the lidar takes a moment to reach full scan rate after power-on, and the /scan and /odom callbacks contend for a shared mutex. They replay the bag on a workstation with `ros2 bag play --clock` to debug a navigation failure. Whatever playback options they choose, which of these can the replay not reproduce?
MCQ-16A ROS 2 Humble fleet runs SROS2 with a shared keystore, and every node's certificate is signed by the same fleet CA. A teleop node publishes /cmd_vel; the controller subscribes. After the controller's enclave permissions file is regenerated, the controller stops receiving commands, though its QoS profile is unchanged and it worked before. A debug node on the same host, in an enclave with broad permissions, runs ros2 topic echo /cmd_vel and sees the messages. What is the most likely cause?
MCQ-22A team's ROS 2 integration test for a navigation stack launches the real planner, controller and a fake sensor publisher, then asserts that a goal sent to /navigate_to_pose is reached within 30 s. On CI it passes about 70% of runs; the failures show the goal accepted but no path published, and rerunning the same commit sometimes passes. The test uses `rclpy.spin_until_future_complete` on the action client with a 30 s timeout and no wait for the controller server to appear. What is the most likely cause of the flaky failures?
MCQ-20A ROS 2 Jazzy node (rclcpp) drives a warehouse AMR at 0.3 m/s. A 20 Hz timer publishes geometry_msgs/Twist on /base/cmd_vel, and while a drive_to_dock action goal runs, the action server's execute callback publishes its own setpoints on the same topic from its own MultiThreadedExecutor thread. The motor driver latches the last Twist it receives and halts the base only when no message arrives for 500 ms. On Ctrl-C the process tears down and the base comes to rest 0.15 m past the target, crushing the charging connector. Which shutdown path stops the base within one 50 ms control period, about 0.015 m of travel?