Linux Interview Questions for React Native Developers (2 Yrs Exp)
Q: Why do React Native developers need to know Linux?
A: React Native developers often use Linux for:
- Setting up development environments
- Running Android builds/emulators
- Managing backend services (Node.js, APIs)
- Debugging issues on CI/CD pipelines
- Git and command-line tooling
Q: How do you check the current working directory in Linux?
A: pwd
Q: How do you list files in a directory including hidden files?
A: ls -la
Q: How do you change file permissions using chmod?
A: chmod 755 script.sh
Q: How to check if Node.js and npm are installed and their versions?
A: node -v
npm -v
Q: How do you kill a process running on a specific port (e.g., 8081)?
A: lsof -i :8081
kill -9 <PID>
# or
fuser -k 8081/tcp
Q: How do you search for a specific string inside a file or folder?
A: grep "string" filename
grep -r "string" ./path/to/folder
Q: How do you find the path of a command (like node)?
A: which node
Q: How do you set environment variables temporarily and permanently?
A: Temporary:
export REACT_NATIVE_ENV=production
Permanent:
Add to ~/.bashrc:
export REACT_NATIVE_ENV=production
Then run:
source ~/.bashrc
Q: How do you give execute permission to a script and run it?
A: chmod +x script.sh
./script.sh
Q: How to install dependencies using Linux CLI?
A: npm install
yarn install
sudo apt install openjdk-11-jdk
sudo apt install android-sdk
Q: How do you start a React Native project on Linux?
A: npx react-native init MyApp
cd MyApp
npx react-native run-android
Q: How do you set ANDROID_HOME environment variable in Linux?
A: export ANDROID_HOME=$HOME/Android/Sdk
export PATH=$PATH:$ANDROID_HOME/emulator
export PATH=$PATH:$ANDROID_HOME/platform-tools
Q: How to check system logs while debugging Android build issues?
A: adb logcat
Q: How do you use curl to test an API in Linux?
A: curl -X GET http://localhost:3000/api/users
curl -X POST -H "Content-Type: application/json" -d '{"name":"John"}' http://localhost:3000/api/users