JAWAHARLAL NEHRU TECHNOLOGICAL UNIVERSITY HYDERABAD

JAWAHARLAL NEHRU TECHNOLOGICAL UNIVERSITY HYDERABAD B.Tech IV LINUX PROGRAMMING Previous Question Paper (July - 2023 - R16)

B.Tech | IV | II | R16 | July - 2023

Answer PaperPaper Code: 138GHMaximum Marks: 75Time: 3 Hours

Note: i) Question paper consists of Part A, Part B. ii) Part A is compulsory, which carries 25 marks. In Part A, Answer all questions. iii) In Part B, Answer any one question from each unit. Each question carries 10 marks and may have a, b as sub questions.

Part A

125 marks
a

What is an associative array?

2 marks

Answer

An associative array, also known as a map or dictionary, is a data structure that stores a collection of key-value pairs. Unlike traditional arrays that use integer indices to access elements, associative arrays use unique keys (which can be strings, numbers, or other hashable data types) to retrieve associated values. Each key in the array maps to a specific value. This allows for more flexible and intuitive data organization, especially when dealing with data that doesn't naturally fit into sequential integer indexing.

For example, in a programming context, you might use an associative array to store user information where the username is the key and the value is an object containing the user's details (email, age, etc.).

b

Distinguish between “awk” and “sed”.

3 marks

Answer

Both awk and sed are powerful stream editors and text processing utilities in Unix-like operating systems, commonly used for pattern scanning and transformation. However, they differ significantly in their primary purpose and capabilities:

Featuresed (Stream Editor)awk (Aho, Weinberger, and Kernighan)
Primary UsePrimarily used for text substitution and simple transformations on a line-by-line basis. It operates on a stream of text, applying editing commands.Primarily used for pattern scanning and processing. It excels at parsing structured text files, performing calculations, and generating reports based on data fields.
Data HandlingProcesses text line by line. It has limited capabilities for handling fields within a line.Processes text line by line, but automatically splits each line into fields (based on whitespace or a specified delimiter), making it easy to work with columnar data.
Programming ConstructsOffers basic commands for substitution, deletion, insertion, and branching. Its scripting capabilities are relatively simple.Provides a more sophisticated programming language with variables, arithmetic and string operators, control flow statements (if, while, for), and associative arrays.
OutputTypically outputs the modified stream. Can be used to extract specific lines.Can format and print output, often generating reports or summaries based on processed data.
Example Use CaseReplacing all occurrences of 'foo' with 'bar' in a file. Deleting empty lines.Calculating the sum of values in a specific column of a CSV file. Extracting and reformatting data from log files.
c

What is an Inode?

2 marks

Answer

Sign in to view the complete answer paper.

d

Distinguish between soft and hard links.

3 marks

Answer

Sign in to view the complete answer paper.

e

What are signals used for?

2 marks

Answer

Sign in to view the complete answer paper.

f

Distinguish between a thread and a process.

3 marks

Answer

Sign in to view the complete answer paper.

g

Distinguish between named and unnamed pipes.

2 marks

Answer

Sign in to view the complete answer paper.

h

Distinguish between IPC between processes on a single system and different systems.

3 marks

Answer

Sign in to view the complete answer paper.

i

What is a client-server model?

2 marks

Answer

Sign in to view the complete answer paper.

j

What is a shared memory used for?

3 marks

Answer

Sign in to view the complete answer paper.

Part B

210 marks
a

Describe the control statements in shell.

5 marks

Answer

Sign in to view the complete answer paper.

b

Give the commands for backup, extracting, compressing and uncompressing and explain.

5 marks

Answer

Sign in to view the complete answer paper.

OR
310 marks
a

Explain any five commands for working with files in Linux.

5 marks

Answer

Sign in to view the complete answer paper.

b

Write a script for arithmetic calculator using command line arguments.

5 marks

Answer

Sign in to view the complete answer paper.

410 marks
a

Give the commands for moving, copying, removing and finding files along with examples.

5 marks

Answer

Sign in to view the complete answer paper.

b

How to change file permissions and ownership in Linux?

5 marks

Answer

Sign in to view the complete answer paper.

OR
5

Explain the following Linux commands using examples: mkdir, opendir, readdir, closedir and rewinddir.

10 marks

Answer

Sign in to view the complete answer paper.

6

Explain Linux system call interface for process management in detail.

10 marks

Answer

Sign in to view the complete answer paper.

OR
7

Explain the typical lifecycle of a signal and the Linux support for signals.

10 marks

Answer

Sign in to view the complete answer paper.

810 marks
a

Demonstrate with an example the use of semaphores for synchronization.

5 marks

Answer

Sign in to view the complete answer paper.

b

Demonstrate with an example two-way communication using pipes.

5 marks

Answer

Sign in to view the complete answer paper.

OR
910 marks
a

Explain IPC mechanism of message passing.

5 marks

Answer

Sign in to view the complete answer paper.

b

How do you implement a semaphore in Linux?

5 marks

Answer

Sign in to view the complete answer paper.

10

Explain the mechanism of IPC using shared memory and describe system calls for the same.

10 marks

Answer

Sign in to view the complete answer paper.

OR
1110 marks
a

Make a comparison of various IPC mechanisms.

5 marks

Answer

Sign in to view the complete answer paper.

b

Give an overview of Berkeley sockets.

5 marks

Answer

Sign in to view the complete answer paper.

About this paper

This page contains the solved question paper with answers of LINUX PROGRAMMING from JAWAHARLAL NEHRU TECHNOLOGICAL UNIVERSITY HYDERABAD for B.Tech ECE IV II, July - 2023, R16.

For the question paper without answers, switch to the Question Paper tab.

Other papers in LINUX PROGRAMMING

Loading Question Papers

Fetching data from database...