Blog Archives
1 2

01: 14 Unix must-know interview questions & answers

Q1 How do you remove the Control-M characters from a file?
A1 Control-M is a carriage return on keyboard. The ^M is the keyboard equivalent to \r. In a file originated from DOS/Windows the \r\n is used for an end of line carriage return, whereas in Unix it is \n for a new line.

So, if created a file in DOS/Windows and copied it to a Unix machine, you need to convert the carriage returns from \r\n to \n. You need to remove \r.

Using the sed command that replaces Control-M with nothing

Tags: ,

01: Unix interview Q&As for data engineers – part 1 sed & find

Experienced developers & data engineers are lazy and use the right tools & know-hows to get the tasks done quickly & effectively on the job.

Q01 What Unix commands are handy for the data engineers?
A01 find, grep, sed, and awk are very handy for data engineers.

Q02 How will you go about approaching the below problem statement? What are some of the considerations & questions you will be asking?

Problem Statement

You have a list of say 100’s of data files on a machine running on Unix operating system. You are extracting these data files from a source system …



01: Unix interview Q&As for data engineers – part 2 cat, grep, gunzip & wc

Experienced developers & data engineers are lazy and use the right tools & know-hows to get the tasks done quickly & effectively on the job. Unix interview Q&As for data engineers. Problem Statement Given a zipped file with below content having both meta data & actual content, the task is…



01: Unix interview Q&As for data engineers – part 3 grep

Experienced developers & data engineers are lazy and use the right tools & know-hows to get the tasks done quickly & effectively on the job. Unix interview Q&As for data engineers – part 2. Problem Statement When you have 100s of log files, how will you go about searching for…



01: Unix interview Q&As for data engineers – part 4 locate & find

Experienced developers & data engineers are lazy and use the right tools & know-hows to get the tasks done quickly & effectively on the job. Problem Statement How will you search for a file location by name? For example, where are my log files? Under which folder is mysql installed?…



01: Unix interview Q&As for data engineers – part 5 xargs

This extends Unix interview Q&As for data engineers – part 4 locate & find. Where to use xargs? xargs can be used when you need to take the output from one command and use it as an argument to another. grep, sed and awk takes the data from standard input,…



01: Unix interview Q&As for data engineers – part 6 awk

This extends Unix interview Q&As for data engineers – part 6 cut and awk. awk format The “action” is performed if the pattern matches.

For example: Given the below csv data file “my_data.csv”



01: Unix interview Q&As for data engineers – part 6 cut and awk

cut & awk Unix commands are used to extract sections from each line of text. cut vs. awk cut accepts a single-character delimiter, and is suitable only for very simple text file formats whereas awk is much more versatile, and can handle somewhat more complex field delimiter definitions including regular…



02: Top 10 Linux interview Q&As

Many production systems run on Linux systems, especially the Cloud infrastructure (i.e. AWS & GCP). Even Android uses the Linux kernel under the hood. So, it really pays to have a good knowledge of Linux.

Q1. How do you check for open ports in Linux?
A1. With the netstat command. In general you will be using the following:



03: Shell script interview Q&As for Java developers

Q1 How will you go about reading a CSV file as shown below?

A1



12 SSH interview Q&As

Q1. What is ssh? A1. SSH is a secure protocol used for remotely connecting to Linux servers. For example, creating an ssh connection from your local laptop to an ec2 instance running on AWS or any server on the cloud.

You will be prompted for a password, and then…



5 curl vs wget interview Q&As

Q1. What are the differences between curl & wget? A1. wget is a tool to download files from servers. It let’s you download files from an HTTP/HTTPS or FTP server. You give it a link and it automatically downloads the file where the link points to. Wget’s major strong side…



Bash script interview Q&As – 01: variables & arrays

A Bash script is a plain text file which contains a series of commands. It allows you to perform a series of actions. Bash scripting is an essential skill for any developer and system administrator to perform tasks efficiently and automate repetitive tasks. Like any other programming languages, you will be creating variables & working with variables.

Q01 What is a variable in bash, and how do you use them?
A01 A variable in bash can contain a number, a character, a string of characters. Bash variables are untyped. You don’t have to declare a variable, just assigning a VALUE …



Bash script interview Q&As – 02: variable or parameter expansion

This extends Bash script interview Q&As – variables & arrays Q01 How will you concatenate strings in Bash? A01 In Bash, when variables or strings are written one after another, they automatically concatenate.



Bash script interview Q&As – 03: conditional expressions

Q01 What is a conditional expression in bash? A01 A conditional in Bash scripting is made up of two things: a conditional statement and one or more conditional operators. if statement examples with arithmetic comparisons like -eq, -lt, -le, -gt, -ge, and -ne.



Bash script interview Q&As – 04: conditionals, command, &>, and $?

Q01 Can you explain the below code? temp.sh:



Bash script interview Q&As – 05: IFS & Read a file line by line

Q01 What is an IFS in Bash? A01 IFS is a special variable in Bash which is used to control the field separator for line parsing. By default, IFS is set to a space, a tab, and a newline character, which means that fields in a string are separated by…



Bash script interview Q&As – 06: Running bash scripts, dot command & path components

Q01 How will you run a Bash script? A01 Bash scripts, like scripts written in other programming languages, can be run in a wide variety of ways. Permission to run Firstly, the script needs to have the right permission to execute the script. For example, user permission:

OR



Hidden Unix, Git & SVN config files

You need to use “ls -la” to list the hidden files in your home (i.e ~) directory. These config files are “.bashrc”, “.inputrc”, “.profile”, etc. In computing, a hidden folder or hidden file is a folder or file that does not display by default when showing a directory/file listing. In Unix-like operating systems, any file or folder that starts with a dot character is to be treated as hidden. The ls command does not display them unless the -a flag (ls -a) is used.

Q1. What is a .bashrc file?
A1. .bashrc is a shell script that Bash runs …



sed and awk to write shell scripts for Java developers

Q. How would you go about replacing a piece of a text or a phrase from 20,000+ web templates residing on a Unix file system? Even some candidates with 5+ years of experience will be tempted to spend a day or two to write 200+ lines of code to achieve…



1 2

300+ Java & Big Data FAQs - Quick Prep

Java & Big Data Tutorials

Top