Reviewed by Aditya Kumar · Last reviewed 2026-03-24
To check processes running in the background, use the jobs command for processes launched from your current shell session, or ps (Process Status) for a system wide view of all processes. Interactive…
This easy-level General/Other question appears frequently in data engineering interviews at companies like Citi. While less common, it tests deeper understanding that distinguishes strong candidates. Mastering the underlying concepts (python) will help you answer variations of this question confidently.
Start by clearly defining the core concept being asked about. Interviewers want to see that you understand the fundamentals before diving into implementation details. Structure your answer with a definition, then explain the practical application with a concise example. The expert answer includes a code example that demonstrates the implementation pattern.
To check processes running in the background, use the jobs command for processes launched from your current shell session, or ps (Process Status) for a system-wide view of all processes. Interactive tools like top or htop also provide real-time process monitoring.
jobs command lists processes that were started in the background (using &) within your current shell session. It shows their job ID, status (e.g., Running, Stopped), and the command itself. For processes running independently of your current shell, or those started by other users or services, ps is essential. Common ps invocations include ps aux (show all processes for all users, including those without a controlling terminal) or ps -ef (full format listing). You can pipe ps output to grep to filter for specific processes, for example, ps aux | grep 'python my_script.py'. pgrep offers a more direct way to find process IDs by name, like pgrep -l python. top and htop provide a dynamic, real-time view of running processes, CPU, and memory usage, which is invaluable for identifying resource-intensive tasks.
nohup python my_etl.py & to ensure it continues even if your terminal closes. You'd then use jobs to see its status within that shell, or ps aux | grep my_etl.py to find its system-wide process ID (PID) and monitor it. The trade-off is scope: jobs is quick for your immediate shell context, while ps offers deep system visibility, crucial for debugging issues like a runaway Spark driver process or a stuck Kafka consumer.
# Example: Find all Python processes
ps aux | grep python
kill (to terminate processes), disown (to remove a background job from the shell's job table), fg (foreground), and bg (background) to demonstrate a comprehensive understanding of process management.Red Flag: Only knowing one command. Pro-Move: 'ps aux for full view; we use pgrep in monitoring scripts; disown for long-running detached jobs.'
Some links below are affiliate links. If you buy through them we may earn a small commission at no extra cost to you — it helps keep DataEngPrep free.
According to DataEngPrep.tech, this is one of the most frequently asked General/Other interview questions, reported at 1 company. DataEngPrep.tech maintains an editor-reviewed database of 1,863 data engineering interview questions across 7 categories.