Unix Interview Questions
- 0of 0 votes
AnswersYou run a linux binary provided by a customer and don’t get any output. The customer assures you it should provide output. You don’t have the source code for this binary. How would you debug this? What tools / techniques can you use ? *
- donk August 26, 2019 in United States for Engineering| Report Duplicate | Flag | PURGE
Notfamous Technical Support Engineer Unix - 0of 0 votes
AnswerThe question which has been asked is : how to share a variable across two unrelated process in Linux without using IPC.
- linardni November 29, 2017 in India| Report Duplicate | Flag | PURGE
unknown Software Engineer / Developer Unix - 0of 0 votes
AnswersI have a file which has a number of 10 digit numerals and 10 digit alphanumeric characters. Write a UNIX basic command to print distinct 10 digit alphanumeric charters
- priyanka.mandal1691 February 08, 2017 in India
Sample Input
1234567890
1234567890
123456789X
0974385495
Expected O/P
123456789X| Report Duplicate | Flag | PURGE
Amazon SDE1 Unix - 0of 0 votes
AnswerDelete files of size more than 100mb in a folder which are older than 90 days.
- priyanka.mandal1691 February 08, 2017 in India| Report Duplicate | Flag | PURGE
Amazon SDE1 Unix - 0of 0 votes
AnswersGiven a comma separated file print the last but one column of every line.
- priyanka.mandal1691 February 08, 2017 in India
e.g:
a,b,c,d,e,f
1,2,3,4
w,x,y,z
output should be
e
3
y| Report Duplicate | Flag | PURGE
Amazon SDE1 Unix - 0of 2 votes
AnswersFind the highest time difference in the below log file Using single Unix command
- Srinivas December 04, 2015 in United States
STARTTIME:2015-12-01 04:13:15
ENDTIME :2015-12-01 04:14:16
----------------------------------------------
----------------------------------------------
STARTTIME:2015-12-01 04:11:15
ENDTIME :2015-12-01 04:11:17
----------------------------------------------
----------------------------------------------
STARTTIME:2015-12-01 04:12:15
ENDTIME :2015-12-01 04:15:15
----------------------------------------------
----------------------------------------------
STARTTIME:2015-12-01 04:10:10
ENDTIME :2015-12-01 04:10:11
----------------------------------------------
----------------------------------------------| Report Duplicate | Flag | PURGE
Amazon Development Support Engineer Unix - 0of 0 votes
Answersasked if i know unix, linux scripting.
- Tom Walker June 07, 2015 in United States
if given 100 servers, you deploying your app in those servers. The server creates log. The logs can contain error messages. how would you group and count the error messages from all servers and receive them using unix commands.| Report Duplicate | Flag | PURGE
Ebay Software Developer Automata Debugging System Design Unix - 0of 0 votes
Answerscommand which will tell all the running process and amount memory consumed by them
- poojaarora014 February 22, 2015 in India| Report Duplicate | Flag | PURGE
Deshaw Inc SDET Unix - 0of 0 votes
Answersshell script to rename all files in directory
- helphand2015 January 22, 2015 in India| Report Duplicate | Flag | PURGE
McAfee SDET Unix - 0of 0 votes
AnswersHow to remove file named "~" ?
- Pinky August 09, 2014 in India for ECOX| Report Duplicate | Flag | PURGE
Amazon SDE1 Unix - 0of 0 votes
AnswersWrite a shell script to reverse a string without using inbuilt function.
- gaurav.2897 August 07, 2014 in India| Report Duplicate | Flag | PURGE
Software Engineer / Developer Unix - 4of 4 votes
AnswersWhat happens when you type in shell
list=$(ls)
Interviewer expected the list of system-calls made, file-descriptors involved etc.
- Moony April 29, 2014 in United States| Report Duplicate | Flag | PURGE
Google Site Reliability Engineer Unix - 0of 0 votes
Answerswhat is memory leak and write a shell script to find memory leak ?
- arunpro13 February 12, 2014 in India| Report Duplicate | Flag | PURGE
Alcatel Lucent Tech Lead Unix - 0of 0 votes
AnswersWhat is memory leak and write a shell script to find memory leak ?
- arunpro13 February 12, 2014 in India| Report Duplicate | Flag | PURGE
Aricent Testing / Quality Assurance Unix - 0of 2 votes
AnswersDesign a Logging mechanism. Should be thread safe.
- R@M3$H.N January 07, 2014 in India
Initially i came up with Command Pattern, and write into a File. Was asked how i will synchronize multiple threads writing into Same File?
Later he gave hint about Aspect-oriented Programming(AOP). And also he gave a hint of Not always writing into the File, can also be a Mail,etc..| Report Duplicate | Flag | PURGE
Microsoft SDE-2 Data Structures Problem Solving System Design Threads Unix - 0of 0 votes
Answersexplain with example when to use mutex and when to use semaphore
- skbb18 December 02, 2013 in India| Report Duplicate | Flag | PURGE
StartUp Developer Program Engineer Unix - 0of 0 votes
AnswersIf the parent process creates multiple children using fork() what will be pid of process(getpid) in parent address space?
- Ravi September 19, 2013 in United States
my understanding is when the parent process creates child process, the parent process get the pid of child. But the question is when parent process creates more than on child what will be the its pid?| Report Duplicate | Flag | PURGE
Unix - 1of 1 vote
AnswersA user creates a file test.sh on a linux system. He wishes to give another user on the same system the permission to execute that file. What permissions should he give to the file?
- Saurabh Singhal August 22, 2013 in India| Report Duplicate | Flag | PURGE
VMWare Inc Intern Unix - 0of 0 votes
AnswersYou are given an application which sometimes may go into infinite loop.
- EK MACHCHAR May 16, 2013 in United States
Come up with a deployment plan s.t. the erring process is killed as soon as it goes into infinite loop.| Report Duplicate | Flag | PURGE
TP Network Engineer Unix - 0of 0 votes
AnswersA log file is of below format
log.txt
=====================================
TIMESTAMP:MM-DD-YYYY
REQUEST:______________________________
RESPONSE:____________________________
SUCCESS:200:________________________
=====================================
TIMESTAMP:MM-DD-YYYY
REQUEST:______________________________
RESPONSE:____________________________
ERROR:400:________________________
=====================================
TIMESTAMP:MM-DD-YYYY
REQUEST:______________________________
RESPONSE:____________________________
ERROR:=500:________________________
=====================================
TIMESTAMP:MM-DD-YYYY
REQUEST:______________________________
RESPONSE:____________________________
ERROR:400:________________________
=====================================
TIMESTAMP:MM-DD-YYYY
REQUEST:______________________________
RESPONSE:____________________________
ERROR:401:________________________
I want the count of error between two given dates.
- anushvenki May 12, 2013 in Indiagrep '0[6789]:\| 1[01234567]' | ""grep -c "ERROR" log.txt timestamp = grep "TIMESTAMP" awk '$timestamawk>=from&&$timestamp<=to' from="2007/03/20 15:13" to="2007/08/19 14:31" log.txt | grep "ERROR" | wc -l timestamp = grep "TIMESTAMP" echo timestamp | awk -F'[- ]' '$2 >= 25 && $3 <= 04 { print }' | grep -c "ERROR"
| Report Duplicate | Flag | PURGE
Amazon Applications Developer Unix - 0of 0 votes
AnswersWrite a C program to search for a given pattern from various files in a directory without using grep or any other inbuilt command
- sharmapeeyush121 April 12, 2013 in India for Only_me| Report Duplicate | Flag | PURGE
Google Program Manager Unix - 2of 2 votes
AnswersYou are trying to to daemonize an unknown, black-box binary executable. The binary executable returns no output to STDOUT or STDERR. Assume that the mystery binary return code is non-zero. What troubleshooting steps might you take to learn more about what the binary is supposed to do, and why it is failing?
- longbelly March 21, 2013 in United States| Report Duplicate | Flag | PURGE
Google Site Reliability Engineer Unix - 0of 0 votes
AnswersThere are 100's of html files in a folder. The files contain phone numbers in formats xxxxxxxxxx, xxxxx-xxxxx, xxx-xxx-xxxx. Have to search all the files and return unique phone numbers from those files.
- velu.s20 December 06, 2012 in United States| Report Duplicate | Flag | PURGE
Unix - 0of 0 votes
AnswersDifference between kill -9 and kill -3
- Survivor November 20, 2012 in United States| Report Duplicate | Flag | PURGE
Qualcomm Applications Developer Unix - 0of 0 votes
AnswersHow to find a process and kill in unix?
- Survivor November 20, 2012 in United States| Report Duplicate | Flag | PURGE
Qualcomm Applications Developer Unix - 0of 0 votes
AnswersUnix command which will display content of file which has more than 45 characters?
- Sach September 20, 2012 in India| Report Duplicate | Flag | PURGE
Credit Suisse Unix - 0of 0 votes
Answerswrite a running c program. When you compile the program another c program shud run and output of the 3rd command must be printed. give the UNIX xommands for the same.
- Kavish Dwivedi July 21, 2012 in United States for mobile engineering| Report Duplicate | Flag | PURGE
Intern Unix - 0of 0 votes
AnswersHow would you kill a process by name in terminal in one line? i.e. NOT kill -9 pid. Follow-up what happens when you type kill processname or kill pid(actual pid)
- apple-maybe? April 08, 2012 in United States for Data Mining| Report Duplicate | Flag | PURGE
Apple Software Engineer / Developer Unix - 0of 0 votes
AnswersThe normal shell script question, give a unix command that takes an input as a pattern and searches all unique numbers in the file
- An April 04, 2012 in United States
I came up with egrep [ pattern ] im not sure if it was correct syntactically but i explained the logic to him and he said ok, lets move on to the next question -.-| Report Duplicate | Flag | PURGE
Amazon Software Engineer / Developer Unix