Explore topic-wise InterviewSolutions in .

This section includes InterviewSolutions, each offering curated multiple-choice questions to sharpen your knowledge and support exam preparation. Choose a topic below to get started.

19201.

Justify the following statements 1. In C++, the ‘delete’ operator performs the reverse action of ‘new’ operator. 2. If ‘arr’ is the name of an array, then arr++ is not a valid statement 3. If ‘k’ is a long variable with address 1001 and it is stored by a pointer variable ‘p’, then ‘p + 1 ’ will point to the location with address 1005.

Answer»

1. In C++, the ‘delete’ operator performs the reverse action of ‘new’ operator. In C++, both ‘new’ and ‘delete’ operators are used for dynamic allocation and deallocation of memory respectively, ie. For allocation of memory at runtime new operator is used. For deallocation of memory that have been allocated by the new operator, ‘delete’ operator is used. 

2. arr++ is not a valid statement. Because the base address of an array can not change. Array name gives the base address of the array. 

3. Pointer variable hold the address of memory location where the data is stored. So incrementing the pointer variable is adding the size of the data type. Long data type takes 

4 bytes of memory. So incrementing the pointer variable P makes it point to the address 1005.

19202.

How many bytes of memory allocates for the following variable declaration if you are using Dev C++? short int x;(a) 2(b) 4 (c) 6 (d) 8

Answer»

Answer is (a) 2

19203.

When a C++ program is compiled, the compiler allocates 20 bytes of memory and when the same program is executed 10 more bytes of memory were allocated1. How do you account for these two types of memory allocations? 2. Name the operator used for the second type of memory allocation and also write the syntax.

Answer»

1. Static and dynamic memory allocation.

2. ‘new’ operator is used for dynamic allocation of memory syntax, datatype ‘pointer variable = new datatype; 

eg: int *ptr = new int;

19204.

Write the features of System defined Functions?

Answer»

System Defined Functions: A function is already created by system it is a reusable piece or block of code that performs a specific action. Functions can either return values when called or can simply perform an operation without returning any value. 

Features of System defined functions:

1. System defined functions are otherwise called as predefined or built-in functions. 

2. PHP has over 700 built in functions that performs different tasks. 

3. Built in functions are functions that exists in PHP installation package.

19205.

Differentiate user define and system defined Functions?

Answer»

System defined:

1. These functions are already present in the system (comes along with installation package). 

2. Cannot be edited. 

3. Name is provided by the developer 

Eg. isnum( ), isalpha( ).

19206.

Write the purpose of parameterized Function?

Answer»

1. Required information can be shared between function declaration and function calling part inside the program.

2. The parameter is also called as arguments, it is like variables. The arguments are mentioned after the function name and inside of the parenthesis. 

3. There is no limit for sending arguments, just separate them with a comma notation.

19207.

A function in PHP which starts with ………. (double underscore) is known as …………(a) Magic Function (b) Inbuilt Function (c) Default Function (d) User Defined Function

Answer»

A function in PHP which starts with (double underscore) is known as Magic Function.

19208.

Which one of the following is the right way of defining a function in PHP? (a) function {function body } (b) data type functionName(parameters) {function body} (c) functionName(parameters) {function body } (d) function functionName(parameters) { function body }

Answer»

(d) function functionName(parameters) { function body }

19209.

Define Function in PHP?

Answer»

In most of the programming language, a block of segment in a program that performs a specific operation tasks (Insert, Execute, Delete, Calculate, etc.). This segment is also known as Function. A Function is a type of sub routine or procedure in a program.

19210.

What functions count elements in an array? (a) count (b) both a and b (c) Array Count (d) Count_array

Answer»

(b) both a and b

19211.

Define User defined Function?

Answer»

User Defined Function: User Defined Function (UDF) in PHP gives a privilege to user to write own specific operation inside of existing program module.

Function Declaration: A user-defined Function declaration begins with the keyword “function”.

19212.

Indices of arrays can be either strings or numbers and they are denoted as(a) $my_array {4} (b) $my array [4] (c) $my_array |4| (d) None of these

Answer»

(b) $my array [4]

19213.

For finding nonempty elements in array we use (a) is_array ( ) function) (b) sizeof( ) function (c) array_count ( ) function (d) count ( ) function

Answer»

(d) count ( ) function

19214.

PHP has over ……… built in functions.(a) 200 (b) 500(c) 700 (d) 900

Answer»

PHP has over 700 built in functions.

19215.

Find the wrong statement from the following? (a) pre-defined functions are called as built-in functions (b) pre-defined functions are called as system functions (c) parameterized functions are called system functions

Answer»

(c) parameterized functions are called system functions

19216.

As compared to associative arrays, vector arrays are much (a) Faster (b) Slower(c) Stable (d) None of them

Answer»

Correct Answer is : (b) Slower

19217.

How many classification of functions are there? (a) 2 (b) 3 (c) 4 (d) 5

Answer»

Correct Answer is : (b) 3

19218.

A function is a type of ………… in a program.(a) sub routine (b) procedure (c) both a & b (d) array

Answer»

A function is a type of both a & b in a program.

19219.

PHP arrays are also called as (a) Vector arrays (b) Perl arrays (c) Hashes

Answer»

Correct Answer is : (c) Hashes

19220.

…………. are functions that exist in PHP installation package.

Answer»

Built-in functions are functions that exist in PHP installation package.

19221.

Define associative array?

Answer»

Associative arrays are a key-value pair data structure. Instead of having storing data in a linear array, with associative arrays you can store your data in a collection and assign it a unique key which you may use for referencing your data.

19222.

Usage of Array in PHP?

Answer»

One of the most useful aspects of using arrays in PHP is when combined with the foreach statement. This allows you to quickly loop though an array with very little code.

19223.

PHP’s numerically indexed array begin with position ……………(a) 1 (b) 2 (c) 0 (d) -1

Answer»

PHP’s numerically indexed array begin with position 0

19224.

The arguments have to be enclosed within (a) [ ] (b) <> (c) { } (d) ( )

Answer»

Correct Answer is: (d) ( )

19225.

The arguments are separated by (a) . (b) :(c) , (d) ;

Answer»

Correct Answer is: (c) ,

19226.

The parameter is also called as (a) Arguments (b) Value (c) Calling function (d) return

Answer»

(a) Arguments

19227.

Pick the odd one out. Indexed, Associative, Multi functional, Multi dimensional

Answer»

Multi functional

19228.

Explain the Multidimensional Array?

Answer»

Multidimensional Arrays:

1. A multidimensional array is an array containing one or more arrays. 

2. PHP understands multidimensional arrays that are two, three, four, five, or more levels deep. 

3. However, arrays more than three levels deep are hard to manage for most people.

Example:

<?php

// A two-dimensional array Sstudent-array

(

array(“Iniyan” , 100,96)

array(“Kavin” ,60,59), 

array(“Nilani” ,1313,139)

);

echo $$student[0][0].“: Tamil Mark: “.$student [0]

[1]English mark: “.$student [0] [2].”br”;

echo $$student[1][0].“: Tamil Mark: “.$student [1][1].”.

English mark: “.$student [1] [2].”<br>”;

echo $$student[2][0].“: Tamil Mark: “.$student [2]

[1]English mark: “.$student [2] [2].”<br>”;

?>

19229.

How many types of arrays are there? (a) 1 (b) 2 (c) 3 (d) 4

Answer»

Correct Answer is: (c) 3

19230.

What is the keyword for creating an array? (a) Arr( ) (b) array( ) (c) a( ) (d) a[ ]

Answer»

Correct Answer is: (b) array( )

19231.

Differentiate Associate array and Multidimensional array?

Answer»

Associate array: Associative arrays are a key-value pair data structure. Instead of having storing data in a* linear array, with associative arrays you can store your data in a collection and assign it a unique key which you may use for referencing your data.

Multidimensional array: A multidimensional array is an array containing one or more arrays. PHP understands multidimensional arrays that are two, three, four, five, or more levels deep. However, arrays more than three levels deep are hard to manage for most people.

19232.

Explain Indexed array and Associate array in PHP?

Answer»

Indexed Arrays: Arrays with numeric index for the available values in array variable which contains key value pair as user / developer can take the values using keys.

Example:

<?php

$teacher_name=array(“Iniyan” , “Kavin” , “Nilani”);

echo “The students name are “ .$teacher_name[0]. “ , “

. $$teacher_name[l]. “ and” . $teacher_name[2].

?>

Associative Arrays:

1. Associative arrays are a key-value pair data structure. 

2. Instead of having storing data in a, linear array, with associative arrays you can store your data.

Example:

<?php

$Marks=array(“Studentl” =>“35” , “Student2” ==>“17” , “Student3” =>“43”);

echo “Studentl mark is” . $Marks[‘Studentl’]. “ is eligible for qualification”;

echo “Student2 mark is” . $Marks[‘Student2’]. “ is not eligible for qualification”;

19233.

Multidimensional Arrays?

Answer»

1. A multidimensional array is an array containing one or more arrays. . 

2. PHP understands multidimensional arrays that are two, three, four, five, or more levels deep. 

3. However, arrays more than three levels deep are hard to manage for most people.

19234.

vi stands for what?

Answer»

vi stands for the visual editor.

19235.

LINUX commands are divided into which categories?

Answer»

LINUX commands are divided into the following categories:

  • Directory oriented commands: ls, mkdir, pwd, etc.
  • File oriented commands: cat, cp, rm, etc.
  • File access commands: chmod, chgrp, head, etc.
  • General-purpose commands date, who, man, etc.
  • File search commands: find, grep.
19236.

Which command is used to create a new directory?

Answer»

mkdir command is used to create a new directory.

19237.

Explain X-Windows in the LINUX operating system.

Answer»

X-Windows: Linux is the powerful framework for working with graphical applications and it is referred to as X-windows system. X handles the function of opening X-based graphic user interface (GUI) applications and displaying them on an X-server process. LINUX has an X-based Desktop environment to provide a desktop metaphor and Windows manager to provide the GUI application like icons, window frames,menus and colours, or a combination of these items called themes.

19238.

What do you know about password protection in LINUX?

Answer»

Password protection is a very popular feature nowadays. Choosing good passwords is the first and most necessary step for having a secure system. You must remember these points while choosing a password.

1. Do not use your login name or your name.

2. Do not use proper names of any kind.

3. Do not use any contiguous letters on the keyboard.

4. Do not use strings that you can forget very easily or note it down at a secured place.

5. Avoid using a combination of capital and small letters.

You can change your password periodically. For this, you can set an expiration date of Linux password by using “Change” command.

19239.

Describe important parts of LINUX.OrDiscuss the application of LINUX.

Answer»

Three important parts of LINUX are:

  • Kernel: It controls the sources of computer, allotting them to different users and tasks.
  • Shell: It acts as a command interpreter. It takes the commands and passes it to the operating system.
  • File system: It is a logical method for organizing and storing large amount to information in a way which makes it easy to manage.
19240.

Explain any one File Search command.

Answer»

File Search Command find: This command recursively examines the specified directory tree to look for files matching some file attributes, and then takes some specified action on those files.

Syntax ⇒ find [path-list] [selection-criteria] [action]

selection – criteria

  • – name < filename > ⇒ selects the file specified.
  • – user < username > ⇒ selects files owned by user.
  • – type d ⇒ selects directories.
  • – size ⇒ selects files that are greater than/less than ‘n’ blocks (1 block = 512 bytes)
  • – mtime < n/+n/-n > ⇒ selects files that have been modified on exactly n days/more than n days/less than n days.

Examples:

⇒ find/home/Harsh – name “*.cpp” – print find /home /Harsh -m time 5 – print Here print action will print the file on the screen.

19241.

Define cd command of LINUX.

Answer»

cd: cd command is used to change the directory and your location to whatever directory you specify, cd home will change to the directory named home located inside the current directory, cd/home/main will change to the directory called main within the home directory.

Syntax: $ cd/home/main Here

$ shows the Linux prompt.

19242.

Define the ls command of LINUX.

Answer»

ls: This command is used to get a listing of the contents in the current directory in columns. The ls command can also give listings of other directories without having to go to those directories. This command can also handle wild characters such as the * and? e.g., ls b* will list all files starting with lower case b, ls b ? will list all twocharacter file names beginning with lower case b. Some of the more common switches are:

  • ⇒ ls -a: To view a hidden file including those beginning with the ‘..’
  • ⇒ ls -l: To view a long listing showing file attributes and file permissions.
  • ⇒ ls -s: To view the listing showing the size of each file rounded up to the nearest kilobyte.
  • ⇒ ls -S: To view the list of files according to file size.
  • ⇒ ls -r: Gives the listing in reverse order.
  • ⇒ ls -t: To view the directory according to time.
  • ⇒ ls -la: This will list all the files in a long format showing full file details.
19243.

What is Grep Command?

Answer»

Grep: The name grep stands for global regular expression printer. The term regular expression refers to the generalized search patterns that grep accepts. The grep command is the least versatile. It simply prints any line, it finds that matches the pattern. The grep command searches out the patterns globally and prints out the lines containing them. Example: grep pattern filename.

Here grep searches the named file (filename) for the Pattern (pattern) and prints out the lines containing the pattern. 

Grep raj employee searches the file inventory for the string of characters raj. It is important to realize that grep searches for the string raj and not the word raj. By this, we mean it searches for the consecutive characters “r” , “a” , and “j” without caring whether they form a word or just part of a word. Thus, the output is as follows:

Rajeev 400

Ranveer 300

deshraj 200

Each line contains the string raj.

19244.

What do you understand by ‘Operating System’? Describe the functions and features of LINUX.OrWhat is an operating system? Give the basic structure of LINUX.OrWhat is an OS? Explain the main features of LINUX.

Answer»

An operating system is system software which performs the following functions:

1. Processor management, that is, assignment to processors of different tasks being performed by the computer system.

2. Memory management, that is, allocation of main memory and other storage areas to the system programs as well as user programs and data.

3. Input/Output management, that is, coordination and assignment of the different input and output devices while one or more programs are being executed.

4. File management, that is, the storage of files on various storage devices and the transfer of these files from one storage device to another. It also allows all files to be easily changed and modified through the use of text editors or some other file manipulation routines.

5. Coordination and assignment of compilers, assemblers, utility programs and other software to various users of the computer system.

6. Establishment of data security and integrity. That is, ‘it keeps different programs and data in such a manner that they do not interfere with each other, It also protects itself from being destroyed by any user.

7. Facilitates easy communication between the computer system and the computer (human) operator.

8. Maintenance of internal time clock and log of system usage for all the users.

LINUX Operating System: The Linux operating system has three important features:

  • The Kernel
  • The Shell
  • Linux file system

Kernel: The kernel is the core of the Linux system. The kernel controls the sources of the computer, allotting them to different users and tasks. It is loaded in whenever the system is started up referred to as a boot of the system. It will manage the entire resources of the system, presenting them to you and every other user as a coherent system.

The functions performed by the kernel are:

1. Managing the machine’s memory and allocating it to each process.

2. Organising the transfer of data from one part of the machine to another.

3. Accepting instructions from the shell and carrying them out.

4. Enforcing the access permissions that are in force on the file system.

Shell: Linux has a simple user interface called the shell that has the power to provide the services that a user wants. You can see its prompt at the bottom left of your screen. You may enter commands at this prompt. The shell acts as a command interpreter, it takes each command and passes it to the operating system kernel to be acted upon. It then displays the results of this operation on your screen.

The important features provided by the shell are as follows:

  • create an environment that meets the user, needs
  • write shell scripts
  • manipulate the command history
  • define-command aliases
  • automatically complete the command line
  • edit the command line.

There are several different shells available on your system. The most popular shells are bash, pdkash, tesh, zsh, ash.

Linux File System: A file system is a logical method for organising and storing large amounts of information in a way which makes it easy to manage. The file is the smallest unit in which information is stored.

Features of LINUX: 

Following are the features of LINUX:

1. Linux operating system is freely available, which can be loaded in as many machines and as many times as necessary with a single package, without any licence.

2. Linux is a multiuser operating system. Not only can you have many user accounts available on a Linux system, but you can also have multiple users logged in and working on the system at the same time?’

3. In Linux, it is possible to have many programs running at the same time, which means that not only can you have many programs going at once, but that the Linux can itself have programs running in the background.

4. Linux can rely on two working environments, i.e., Shell, i.e., work interface command lines similar to DOS. X-Window, with lots of graphic interface options, including one that is very similar to an improved Windows 95/98.

5. Linux does disk formatting without interfering with the machine’s performance.

6. Linux has strong cryptography which offers you more security.

7. Linux can be installed in several machine profiles without the need to configure the software.

8. Linux operating system is safe from the virus since common users don’t have access to the system’s main kernel.

9. Linux can rely on freely distributed software as well as commercial applications.

10. Linux offers support for a variety of local area network (LAN) boards, modems and serial devices to connect your Linux system to a network.

19245.

What is System Software? What are its components?

Answer»

System Software is a set of programs that manage the resources of a computer system i.e. processing time, storage space etc. so that they are used in an optimal fashion, provide routine services such as copying data from one file to another and assist in the development of application programs. System software programs assist the computer in the efficient control, support, development and execution of application programs.

System software began to be used with the second generation computers. In this, the operation of a computer was primarily controlled by human operators. Human intervention wasted large amounts of computer time and human resources. To automate these functions, companies developed programs called operating systems. These programs are stored partially in primary storage and partially in direct-access secondary storage devices so the computer can access them immediately when they are needed. Operating systems manage a queue of jobs that are awaiting execution, can be read onto a disk. The operating systems will start each job when system resources are available for its execution.

System software can be classified into three types:

1. System control programs: These programs control the execution of programs, manage the storage and processing resources to the computer and perform other management and monitoring functions. The most common programs are an operating system, database management systems and communication monitors.

2. System support programs: These programs provide routine service functions to the other computer programs and computer utters. Utilities, librarians, performance monitors and job accounting are the most common examples.

3. System development programs: These programs assist in the creation of application programs. The language translators such as BASIC interpreter and application generators are the examples. System software’s are developed by system programmers and sold by both computer companies and specialized software firms.

19246.

Explain CLI in LINUX.

Answer»

Command Line Interface (CLI): Before icons and windows tools over computer screens, commands are typed to run most computers. On UNIX systems, from which Red Hat Linux was derived, the program used to interpret and manage commands was referred to as the shell. The shell interface provides a way to run programs, work with the file system, compile computer code, and manage the computer. If you type something wrong on a command line, the shell ensures that you have to delete the entire line and start over. As you edit a command line, you can type regular characters. The character appears at the location of your cursor. You can use right (→) and left (←) arrow keys to move the cursor from one end to the other on the command line. There are many keystrokes you can use to edit your command lines.

Keystrokes for Editing Text in Command Lines:

Keystroke → Meaning

Alt + t → Switch positions of current and previous words 

Alt + U → Change the current word to upper case

Alt + l → Change the current word to lower case

Alt + c → Change the current word to the initial capital

Ctrl + d → Delete the current character

Ctrl + t → Switch positions of current and previous characters

Ctrl + v → Insert a special character

Keystrokes for Editing Text in Command Lines:

Keystroke → Meaning

Alt + d → Cut the word followed by the cursor

Alt + y → Paste the earlier cut text

Ctrl + c → Delete the entire line

Ctrl + k → Cut text to the end of line

Ctrl + u → Cut text to the beginning of the line

Ctrl + w → Cut the word

Ctrl + y → Paste latest cut text

19247.

Which command is used to change the password?

Answer»

Change Command

19248.

A place where we give commands in LINUX is known as…

Answer»

Shell prompt/Command prompt.

19249.

Name different modes in which vi editors can be opened.

Answer»

The three modes in which the vi editor is opened are the command, insert and last line.

19250.

What are the three categories of files in LINUX?

Answer»

Ordinary, directory and special.