Tcs Questions With Answers: Note To The Students
Tcs Questions With Answers: Note To The Students
Tcs Questions With Answers: Note To The Students
2.#include <stdio.h>
3.int main() {
4. int num;
5. printf("Enter an integer: ");
6. scanf("%d", &num);
7.
8. // True if num is perfectly divisible by 2
9. if(num % 2 == 0)
10. printf("%d is even.", num);
11. else
12. printf("%d is odd.", num);
13.
14. return 0;
15. }
#include <stdio.h>
int main() {
int a[10][10], transpose[10][10], r, c, i, j;
printf("Enter rows and columns: ");
scanf("%d %d", &r, &c);
SVC – 11/11/2020
}
SVC – 11/11/2020
more GPS satellites, it can figure out where you are. Earth is surrounded by navigation
satellites.
6. What is TCP/IP?
TCP/IP is the underlying communication language of the Internet. In base
terms, TCP/IP allows one computer to talk to another computer via the Internet through
compiling packets of data and sending them to right location.
TCP/IP, or the Transmission Control Protocol/Internet Protocol, is a suite of communication
protocols used to interconnect network devices on the internet. TCP/IP can also be used as a
communications protocol in a private computer network (an intranet or an extranet).
7. What are keywords in C?
Keywords are predefined, reserved words used in programming that have special meanings to
the compiler. Keywords are part of the syntax and they cannot be used as an identifier. For
example:
int,float,double,return,if, else.
8. Program to reverse a string.
Using strrev:
#include <stdio.h>
#include <string.h>
int main()
{
char s[100];
strrev(s);
return 0;
}
without strrev:
#include <stdio.h>
int main()
{
char s[1000], r[1000];
int begin, end, count = 0;
printf("Input a string\n");
gets(s);
SVC – 11/11/2020
// Calculating string length
while (s[count] != '\0')
count++;
end = count - 1;
for (begin = 0; begin < count; begin++) {
r[begin] = s[end];
end--;
}
r[begin] = '\0';
printf("%s\n", r);
return 0;
}
int main()
{
//Initialize array
int arr[] = {5, 2, 8, 7, 1};
int temp = 0;
SVC – 11/11/2020
//Sort the array in ascending order
for (int i = 0; i < length; i++) {
for (int j = i+1; j < length; j++) {
if(arr[i] > arr[j]) {
temp = arr[i];
arr[i] = arr[j];
arr[j] = temp;
}
}
}
printf("\n");
Big data is data that contains greater variety arriving in increasing volumes and with ever-
higher velocity. This is known as the three Vs.
Put simply, big data is larger, more complex data sets, especially from new data sources.
These data sets are so voluminous that traditional data processing software just can’t manage
them. But these massive volumes of data can be used to address business problems you
wouldn’t have been able to tackle before.
SVC – 11/11/2020
Velocity Velocity is the fast rate at which data is received
Variety Variety refers to the many types of data that are available.
int main(void)
{
struct dirent *de; // Pointer for directory entry
closedir(dr);
return 0;
}
SVC – 11/11/2020
13. Prime number program in C.
#include <stdio.h>
int main() {
int n, i, flag = 0;
printf("Enter a positive integer: ");
scanf("%d", &n);
if (n == 1) {
printf("1 is neither prime nor composite.");
}
else {
if (flag == 0)
printf("%d is a prime number.", n);
else
printf("%d is not a prime number.", n);
}
return 0;
}
void main()
{
int num1, num2, i, j, flag, temp, count = 0;
SVC – 11/11/2020
printf("Enter the value of num1 and num2 \n");
scanf("%d %d", &num1, &num2);
if (num2 < 2)
{
printf("There are no primes upto %d\n", num2);
exit(0);
}
printf("Prime numbers are \n");
temp = num1;
if ( num1 % 2 == 0)
{
num1++;
}
for (i = num1; i <= num2; i = i + 2)
{
flag = 0;
for (j = 2; j <= i / 2; j++)
{
if ((i % j) == 0)
{
flag = 1;
break;
}
}
if (flag == 0)
{
printf("%d\n", i);
count++;
}
}
SVC – 11/11/2020
printf("Number of primes between %d & %d = %d\n", temp, num2, count);
}
14. How to count the number of 0s and 1s in a string without using a counter
To find the count of 0s in the binary representation of N, find the one’s complement of N and
find the count of set bits.
SVC – 11/11/2020
// Iterate untill n is 0
while (n) {
n &= (n - 1);
count++;
}
// Return the final count
return count;
}
// Function to count the number of 0s
// and 1s in binary representation of N
void count1s0s(int N)
{
// Initialise the count variables
int count0, count1;
// Function call to find the number
// of set bits in N
count1 = countSetBits(N);
// Function call to find 1s complement
N = onesComplement(N);
// Function call to find the number
// of set bits in 1s complement of N
count0 = countSetBits(N);
// Print the count
printf("Count of 0s in N is %d\n", count0);
SVC – 11/11/2020
printf("Count of 1s in N is %d\n", count1);
}
// Driver Code
int main()
{
// Given Number
int N = 5;
// Function Call
count1s0s(N);
return 0;
}
15. Difference between DBMS and RDBMS.
SVC – 11/11/2020
System-defined exceptions
User-defined exceptions
17.Pointers in C/C++.
3D Printing
The business applications for 3D printing are endless. The ability to customize a product
according to personalized specifications will allow businesses to provide nearly limitless
possibilities. In recent years, providing this kind of customization required either significant
reprogramming or manual intervention. With 3D printing, personalization is now one more
task that can be automated. 3D printing also enables the use of various materials that offer
cost-saving and environmentally sustainable benefits.
5G
The speeds accomplished with 5G greatly outpace those seen with previous networks. 5G
offers the supporting foundation that businesses can leverage to embrace emerging
technologies. When unencumbered by latency issues, businesses can provide greater
SVC – 11/11/2020
capabilities and service. Reaching consumer bases via mobile devices and smartphones will
soar to new heights as the IT infrastructure for 5G expands and becomes more pervasive.
Explain that you are ready to take up new technology and ready to upgrade. Since technology
is adaptive to change and so you are.
The information used to get packets to their destinations are contained in routing tables kept
by each router connected to the Internet. Routers are packet switches. A router is usually
connected between networks to route packets between them. Each router knows about it's
sub-networks and which IP addresses they use.
SVC – 11/11/2020
cat is for listing contents of any file. echo is for listing value of some variable.
26.normalization in DBMS.
Normalization is a process of organizing the data in database to avoid data redundancy,
insertion anomaly, update anomaly & deletion anomaly.
SVC – 11/11/2020
31.Types of joins.
(INNER) JOIN: Returns records that have matching values in both tables
LEFT (OUTER) JOIN: Returns all records from the left table, and the matched
records from the right table
RIGHT (OUTER) JOIN: Returns all records from the right table, and the
matched records from the left table
FULL (OUTER) JOIN: Returns all records when there is a match in either left
or right table
#include <stdio.h>
int main() {
int i, n, t1 = 0, t2 = 1, nextTerm;
printf("Enter the number of terms: ");
scanf("%d", &n);
printf("Fibonacci Series: ");
SVC – 11/11/2020
t2 = nextTerm;
}
return 0;
}
34.What is firewall?
A firewall is a network security device that monitors incoming and outgoing network traffic
and permits or blocks data packets based on a set of security rules. Its purpose is to establish
a barrier between your internal network and incoming traffic from external sources (such as
the internet) in order to block malicious traffic like viruses and hackers.
35.Structures in C.
A structure is a user defined data type in C/C++. A structure creates a data type that can be
used to group items of possibly different types into a single type.
Syntax/eg:
struct address
{
char name[50];
char street[100];
char city[50];
char state[20];
int pin;
};
36.What is internet ?
The Internet (or internet) is the global system of interconnected computer networks that uses
the Internet protocol suite (TCP/IP) to communicate between networks and devices.
The internet is a global network of computers that works much like the postal system, only
at sub-second speeds. Just as the postal service enables people to send one another envelopes
containing messages, the internet enables computers to send one another small packets of
digital data.
SVC – 11/11/2020
37.Program for decimal to hexadecimal.
1. #include <stdio.h>
2.
3. int main()
4. {
5. long decimalnum, quotient, remainder;
6. int i, j = 0;
7. char hexadecimalnum[100];
8.
9. printf("Enter decimal number: ");
10. scanf("%ld", &decimalnum);
11.
12. quotient = decimalnum;
13.
14. while (quotient != 0)
15. {
16. remainder = quotient % 16;
17. if (remainder < 10)
18. hexadecimalnum[j++] = 48 + remainder;
19. else
20. hexadecimalnum[j++] = 55 + remainder;
21. quotient = quotient / 16;
22. }
23. }
24.
25. // display integer into character
26. for (i = j; i >= 0; i--)
27. printf("%c", hexadecimalnum[i]);
28. return 0;
29. }
39.What is an array?
An array is a data structure that contains a group of elements. Typically these elements are
all of the same data type, such as an integer or string. Arrays are commonly used in
computer programs to organize data so that a related set of values can be easily sorted or
searched.
SVC – 11/11/2020
Following are the various types of linked list.
Simple Linked List − Item navigation is forward only.
Doubly Linked List − Items can be navigated forward and backward.
Circular Linked List − Last item contains link of the first element as next and the
first element has a link to the last element as previous.
41.Software development lifecycle.
Software Development Life Cycle (SDLC) is a process used by the software industry to
design, develop and test high quality softwares. The SDLC aims to produce a high-quality
software that meets or exceeds customer expectations, reaches completion within times and
cost estimates.
SVC – 11/11/2020
44.Difference between C and CPP.
45.Kruskal algorithm.
https://www.geeksforgeeks.org/kruskals-minimum-spanning-tree-algorithm-greedy-algo-2/
46.Prim’s algorithm.
https://www.geeksforgeeks.org/prims-minimum-spanning-tree-mst-greedy-algo-5/
DATA SEGMENT
NUM1 DB 9H
NUM2 DB 7H
RESULT DB ?
SVC – 11/11/2020
ENDS
CODE SEGMENT
START:
MOV AX,DATA
MOV DS,AX
MOV AL,NUM1
ADD AL,NUM2
MOV RESULT,AL
MOV AH,4CH
INT 21H
ENDS
END START
49.Static variables in C.
Static variables are initialized only once. The compiler persists with the variable till the end
of the program. Static variables can be defined inside or outside the function. They are local
to the block.
SVC – 11/11/2020
51.Virtual functions in C++.
A virtual function is a member function which is declared within a base class and is re-
defined(Overriden) by a derived class. When you refer to a derived class object using a
pointer or a reference to the base class, you can call a virtual function for that object and
execute the derived class’s version of the function.
Virtual functions ensure that the correct function is called for an object, regardless of
the type of reference (or pointer) used for function call.
They are mainly used to achieve Runtime polymorphism
Functions are declared with a virtual keyword in base class.
The resolving of function call is done at Run-time.
52.Multiple inheritance.
Multiple Inheritance is a feature of C++ where a class can inherit from more than one classes.
SVC – 11/11/2020
56.Unix commands.
Java Collections can achieve all the operations that you perform on a data
such as searching, sorting, insertion, manipulation, and deletion.
SVC – 11/11/2020
58.Grep unix command.
grep filter searches a file for a particular pattern of characters, and displays all lines
that contain that pattern. The pattern that is searched in the file is referred to as the
regular expression (grep stands for globally search for regular expression and print
out).
Syntax:
grep [options] pattern [files]
Options Description
-c : This prints only a count of the lines that match a pattern
-h : Display the matched lines, but do not display the filenames.
-i : Ignores, case for matching
-l : Displays list of a filenames only.
-n : Display the matched lines and their line numbers.
-v : This prints out all the lines that do not matches the
pattern
-e exp : Specifies expression with this option. Can use multiple
times.
-f file : Takes patterns from file, one per line.
-E : Treats pattern as an extended regular expression (ERE)
-w : Match whole word
-o : Print only the matched parts of a matching line,
with each such part on a separate output line.
#include <iostream.h>
int main()
{
char reverse[50];
int i=-1;
int j=0;
while(str[++i]!='\0');
while(i>=0)
SVC – 11/11/2020
reverse[j++]=str[--i];
reverse[j]='\0';
return 0;
60.NS lookup.
The NsLookup tool allows you to query DNS servers for resource records.
61.Types of IP address.
There are four different types of IP addresses: public, private, static, and dynamic.
SVC – 11/11/2020
64.Socket program in C.
https://www.geeksforgeeks.org/socket-programming-cc/
SVC – 11/11/2020
65.Primary key and foreign key.
SVC – 11/11/2020
66.ACID properties.
For instance, let’s consider a class Animal and let Cat be a subclass of Animal. So, any
cat IS animal. Here, Cat satisfies the IS-A relationship for its own type as well as its super
class Animal.
SVC – 11/11/2020
int main()
{
int arr[MAX_SIZE];
int N, i;
int * ptr = arr; // Pointer to arr[0]
// Make sure that pointer again points back to first array element
ptr = arr;
return 0;
}
Without pointers:
#include <stdio.h>
void main()
{
int arr[10];
int i;
printf("\n\nRead and Print elements of an array:\n");
printf("-----------------------------------------\n");
SVC – 11/11/2020
for(i=0; i<10; i++)
{
printf("element - %d : ",i);
scanf("%d", &arr[i]);
}
In C++, we can make operators to work for user defined classes. This means C++
has the ability to provide the operators with a special meaning for a data type, this
ability is known as operator overloading.
For example, we can overload an operator ‘+’ in a class like String so that we can
concatenate two strings by just using +.
Other example classes where arithmetic operators may be overloaded are Complex
Number, Fractional Number, Big Integer, etc.
A simple and complete example
#include<iostream>
using namespace std;
class Complex {
private:
int real, imag;
public:
Complex(int r = 0, int i =0) {real = r; imag = i;}
// This is automatically called when '+' is used with
// between two Complex objects
Complex operator + (Complex const &obj) {
Complex res;
res.real = real + obj.real;
res.imag = imag + obj.imag;
return res;
}
void print() { cout << real << " + i" << imag << endl; }
};
int main()
{
Complex c1(10, 5), c2(2, 4);
Complex c3 = c1 + c2; // An example call to "operator+"
c3.print();
}
SVC – 11/11/2020
70.Properties of binary tree.
A binary tree is a finite set of nodes that is either empty or consist a root node and two
disjoint binary trees called the left subtree and the right subtree. In other words, a binary
tree is a non-linear data structure in which each node has maximum of two child nodes.
The tree connections can be called as branches.
71.What to do to increase speed of access of a database?
Using primary keys to all the tables
Split the databases
Adding secondary indexes
72.Why Oracle?
Scalability and Performance: Features like Real Application Clustering and
Portability make an Oracle database scalable according to the usage. ...
Availability: Real-time applications require high data availability.
73.What is hadoop mapreduce?
MapReduce is a processing technique and a program model for distributed computing based
on java. The MapReduce algorithm contains two important tasks, namely Map and Reduce.
Map takes a set of data and converts it into another set of data, where individual elements are
broken down into tuples (key/value pairs). Secondly, reduce task, which takes the output
from a map as an input and combines those data tuples into a smaller set of tuples. As the
sequence of the name MapReduce implies, the reduce task is always performed after the map
job.
74.Features of OOP.
Inheritance
Inheritance can be defined as the process where one (parent/super) class acquires the
properties (methods and fields) of another (child/sub). With the use of inheritance, the
information is made manageable in a hierarchical order.
Polymorphism
Polymorphism is the ability of an object to perform different actions (or, exhibit different
behaviors) based on the context.
Abstraction
Abstraction is a process of hiding the implementation details from the user, only the
functionality will be provided to the user. In other words, the user will have the
information on what the object does instead of how it does it.
In Java, abstraction is achieved using Abstract classes and interfaces.
Encapsulation
SVC – 11/11/2020
Encapsulation in Java is a mechanism for wrapping the data (variables) and code acting
on the data (methods) together as a single unit. In encapsulation, the variables of a class
will be hidden from other classes and can be accessed only through the methods of their
current class. Therefore, it is also known as data hiding. To achieve encapsulation in
Java −
75.Explain structs.
76.What is J2EE?
A servlet is a Java class which is used to extend the capabilities of servers that host
applications accessed by means of a request-response model. Servlets are mainly used to
extend the applications hosted by webs servers, however, they can respond to other types of
requests too. For such applications, HTTP-specific servlet classes are defined by Java Servlet
technology.
A JSP is a text document which contains two types of text: static data and dynamic data. The
static data can be expressed in any text-based format (like HTML, XML, SVG and WML),
and the dynamic content can be expressed by JSP elements.
78.Explain heapsort.
https://www.programiz.com/dsa/heap-sort
An AVL tree is a self-balancing binary search tree, balanced to maintain O(log n) height.
SVC – 11/11/2020
A B-tree is a balanced tree, but it is not a binary tree. Nodes have more children, which
increases per-node search time but decreases the number of nodes the search needs to visit.
This makes them good for disk-based trees.
80.What is Javascript?
JavaScript can calculate, manipulate and validate data.
82.Types of topology.
Mesh Topology.
Star Topology.
Bus Topology.
Ring Topology.
Hybrid Topology.
SVC – 11/11/2020
84.Explain Joins with example/inner and outer joins.
https://www.w3schools.com/sql/sql_join.asp
86.Features of CPP.
Object Oriented.
Simple.
Platform Dependent.
Mid-level programming language.
Structured programming language.
Rich Library.
Memory Management.
Powerful & Fast.
SVC – 11/11/2020
1. What is Preprocessor in C?
Answer:
The C preprocessor is a macro processor that is used automatically by the C compiler to
transform your program before actual compilation. It is called a macro processor because
it allows you to define macros, which are brief abbreviations for longer constructs
conditional compilation.
2. What is Linking in C?
Answer:
Linking is the process of collecting and combining various pieces of code and data
into a file that can be loaded (copied) into memory and executed.
Linking refers to the creation of a single executable file from multiple object files.
Answer:
Step 1 - Create a newNode with given value and set its left and right to NULL.
Step 2 - Check whether tree is Empty.
Step 3 - If the tree is Empty, then set root to newNode.
Step 4 - If the tree is Not Empty, then check whether the value of newNode is smaller
or larger than the node (here it is root node).
Steps 5:Insert the elements to the left and right of the root. Samep process will
continue till it encounters last element.
5. What is binary tree?
Answer:
SVC – 11/11/2020
Binary Tree is a special type of generic tree in which, each node can have at most two
children. Binary tree is generally partitioned into three disjoint subsets. left sub-
tree which is also a binary tree.
Answer:
DBMS RDBMS
In DBMS, data is generally stored In RDBMS, the tables have an identifier called primary
in either a hierarchical form or a key and the data values are stored in the form of tables.
navigational form.
DBMS uses file system to store in RDBMS, data values are stored in the form of tables,
SVC – 11/11/2020
data, so there will be no relation so a relationship between these data values will be
between the tables. stored in the form of a table as well.
DBMS has to provide some RDBMS system supports a tabular structure of the data
uniform methods to access the and a relationship between them to access the stored
stored information. information.
SVC – 11/11/2020
Edge Computing.
Virtual Reality and Augmented Reality.
Cybersecurity.
strrev(s);
return 0;
}
SVC – 11/11/2020
#include <stdio.h>
#include <dirent.h>
int main(void)
{
structdirent *de; // Pointer for directory entry
// opendir() returns a pointer of DIR type.
DIR *dr = opendir(".");
if (dr == NULL) // opendir returns NULL if couldn't open directory
{
printf("Could not open current directory" );
return 0;
}
while ((de = readdir(dr)) != NULL)
printf("%s\n", de->d_name);
closedir(dr);
return 0;
}
Big data is larger, more complex data sets, especially from new data sources. These data sets
are so voluminous that traditional data processing software just can’t manage them. But these
massive volumes of data can be used to address business problems you wouldn’t have been
able to tackle before.
importjava.util.Scanner;
classChkPalindrome
{
public static void main(String args[])
{
String str, rev = "";
Scanner sc = new Scanner(System.in);
System.out.println("Enter a string:");
str = sc.nextLine();
SVC – 11/11/2020
for ( int i = length - 1; i >= 0; i-- )
rev = rev + str.charAt(i);
if (str.equals(rev))
System.out.println(str+" is a palindrome");
else
System.out.println(str+" is not a palindrome");
}
}
SVC – 11/11/2020
default:
printf("Please enter valid choice..");
}
}
}
void insertion_beginning()
{
struct node *ptr;
int item;
ptr = (struct node *)malloc(sizeof(struct node));
if(ptr == NULL)
{
printf("\nOVERFLOW");
}
else
{
printf("\nEnter Item value");
scanf("%d",&item);
if(head==NULL)
{
ptr->next = NULL;
ptr->prev=NULL;
ptr->data=item;
head=ptr;
}
else
{
ptr->data=item;
ptr->prev=NULL;
ptr->next = head;
head->prev=ptr;
head=ptr;
}
printf("\nNode inserted\n");
}
}
void insertion_last()
{
struct node *ptr,*temp;
int item;
ptr = (struct node *) malloc(sizeof(struct node));
if(ptr == NULL)
{
printf("\nOVERFLOW");
SVC – 11/11/2020
}
else
{
printf("\nEnter value");
scanf("%d",&item);
ptr->data=item;
if(head == NULL)
{
ptr->next = NULL;
ptr->prev = NULL;
head = ptr;
}
else
{
temp = head;
while(temp->next!=NULL)
{
temp = temp->next;
}
temp->next = ptr;
ptr ->prev=temp;
ptr->next = NULL;
}
}
printf("\nnode inserted\n");
}
void insertion_specified()
{
struct node *ptr,*temp;
int item,loc,i;
ptr = (struct node *)malloc(sizeof(struct node));
if(ptr == NULL)
{
printf("\n OVERFLOW");
}
else
{
temp=head;
printf("Enter the location");
scanf("%d",&loc);
for(i=0;i<loc;i++)
{
temp = temp->next;
if(temp == NULL)
{
SVC – 11/11/2020
printf("\n There are less than %d elements", loc);
return;
}
}
printf("Enter value");
scanf("%d",&item);
ptr->data = item;
ptr->next = temp->next;
ptr -> prev = temp;
temp->next = ptr;
temp->next->prev=ptr;
printf("\nnode inserted\n");
}
}
void deletion_beginning()
{
struct node *ptr;
if(head == NULL) {
printf("\n UNDERFLOW");
}
else if(head->next == NULL)
{
head = NULL;
free(head);
printf("\nnode deleted\n");
}
else
{
ptr = head;
head = head -> next;
head -> prev = NULL;
free(ptr);
printf("\nnode deleted\n");
}
}
void deletion_last()
{
struct node *ptr;
if(head == NULL)
{
printf("\n UNDERFLOW");
}
else if(head->next == NULL)
{
head = NULL;
SVC – 11/11/2020
free(head);
printf("\nnode deleted\n");
}
else
{
ptr = head;
if(ptr->next != NULL)
{
ptr = ptr -> next;
}
ptr -> prev -> next = NULL;
free(ptr);
printf("\nnode deleted\n");
}
}
void deletion_specified()
{
struct node *ptr, *temp;
int val;
printf("\n Enter the data after which the node is to be deleted : ");
scanf("%d", &val);
ptr = head;
while(ptr -> data != val)
ptr = ptr -> next;
if(ptr -> next == NULL)
{
printf("\nCan't delete\n");
}
else if(ptr -> next -> next == NULL)
{
ptr ->next = NULL;
}
else
{
temp = ptr -> next;
ptr -> next = temp -> next;
temp -> next -> prev = ptr;
free(temp);
printf("\nnode deleted\n");
}
}
void display()
{
struct node *ptr;
printf("\n printing values...\n");
ptr = head;
SVC – 11/11/2020
while(ptr != NULL)
{
printf("%d\n",ptr->data);
ptr=ptr->next;
}
}
void search()
{
struct node *ptr;
int item,i=0,flag;
ptr = head;
if(ptr == NULL)
{
printf("\nEmpty List\n");
}
else
{
printf("\nEnter item which you want to search?\n");
scanf("%d",&item);
while (ptr!=NULL)
{
if(ptr->data == item)
{
printf("\nitem found at location %d ",i+1);
flag=0;
break;
}
else
{
flag=1;
}
i++;
ptr = ptr -> next;
}
if(flag==1)
{
printf("\nItem not found\n");
}
}
}
23. What is backend?
The backend usually consists of three parts: a server, an application, and a database. If you
book a flight or buy concert tickets, you usually open a website and interact with the
frontend. Once you've entered that information, the application stores it in a database that was
created on a server.
SVC – 11/11/2020
24.What is merge sort?
In Merge sort, we divide the array recursively in two halves, until each sub-array contains a
single element, and then we merge the sub-array in a way that it results into
a sorted array. merge() function merges two sorted sub-arrays into one.
25.What is ACID property?
ACID is an acronym for four interdependent properties: Atomicity, Consistency, Isolation,
and Durability. Much of the architecture of any modern relational database is founded on
these properties. Understanding the ACID properties of a transaction is a prerequisite for
understanding many facets of SQL Server.
26.Explain OOPs concept?
OOPs concepts:
Inheritance
When one object acquires all the properties and behaviors of a parent object, it is known as
inheritance. It provides code reusability. It is used to achieve runtime polymorphism.
Polymorphism
Abstraction
Hiding internal details and showing functionality is known as abstraction. For example phone
call, we don't know the internal processing.
Encapsulation
Binding (or wrapping) code and data together into a single unit are known as encapsulation.
For example, a capsule, it is wrapped with different medicines.
SVC – 11/11/2020
Normalization is a systematic approach of decomposing tables to eliminate data
redundancy(repetition) and undesirable characteristics like Insertion, Update and Deletion
Anomalies. It is a multi-step process that puts data into tabular form, removing duplicated
data from the relation tables.
29.What is server and different types of servers?
In computing, a server is a piece of computer hardware or software (computer program) that
provides functionality for other programs or devices, called "clients".
Typical servers are database servers, file servers, mail servers, print servers, web servers,
game servers, and application servers.
30.Which dbms tools are in use?
The Best Database Management Software Tools
SolarWinds Database Performance Analyzer (FREE TRIAL)
RazorSQL.
Microsoft SQL Server Management Studio.
MySQL Workbench.
TeamDesk.
TablePlus.
Sequel Pro
phpMyAdmin.
SVC – 11/11/2020
Programming Object-Oriented Pure Object Oriented
Procedural language
Paradigm Programming (OOP) Oriented
Based on assembly
Origin Based on C language Based on C and C++
language
Dennis Ritchie in BjarneStroustrup in James Gosling in
Developer
1972 1979 1991
Interpreted language
Translator Compiler only Compiler only (Compiler +
interpreter)
Platform
Platform Dependency Platform Dependent Platform Dependent
Independent
Executed by JVM
Code execution Direct Direct (Java Virtual
Machine)
Approach Top-down approach Bottom-up approach Bottom-up approach
File generation .exe files .exe files .class files
Pre-processor Support header files Supported (#header, Use Packages
directives (#include, #define) #define) (import)
Support 32
keywords Supports 63 keywords 50 defined keywords
keywords
Datatypes(union,
Supported Supported Not supported
structure)
Supported except
Inheritance No inheritance Supported
Multiple inheritance
Support Function
Operator overloading
Overloading No overloading overloading
is not supported
(Polymorphism)
Pointers Supported Supported Not supported
Allocation Use malloc, calloc Use new, delete Garbage collector
Exception Handling Not supported Supported Supported
Templates Not supported Supported Not supported
SVC – 11/11/2020
Each table row is defined with a <tr> tag. Each table header is defined with a <th> tag. Each
table data/cell is defined with a <td> tag.
The copy constructor is a constructor which creates an object by initializing it with an object
of the same class, which has been created previously.
We can copy the values of one object into another by using copy constructor.
Static variables have a property of preserving their value even after they are out of their scope!
Hence, static variables preserve their previous value in their previous scope and are not
initialized again in the new scope. A static int variable remains in memory while the program is
running. A normal or auto variable is destroyed when a function call where the variable was
declared is over.
If subclass (child class) has the same method as declared in the parent class, it is known
as method overriding in Java.
In other words, If a subclass provides the specific implementation of the method that has been
declared by one of its parent class, it is known as method overriding.
Call by reference:
SVC – 11/11/2020
o In call by reference, the address of the variable is passed into the function call as the
actual parameter.
o The value of the actual parameters can be modified by changing the formal
parameters since the address of the actual parameters is passed.
o In call by reference, the memory allocation is similar for both formal parameters and
actual parameters. All the operations in the function are performed on the value stored
at the address of the actual parameters, and the modified value gets stored at the same
address.
SVC – 11/11/2020
QuickSort is a Divide and Conquer algorithm. It picks an element as pivot and partitions the
given array around the picked pivot. There are many different versions of quickSort that pick
pivot in different ways.
1. Always pick first element as pivot.
2. Always pick last element as pivot (implemented below)
3. Pick a random element as pivot.
4. Pick median as pivot.
45.What is polymorphism?
Polymorphism in Java is a concept by which we can perform a single action in different
ways.
46.What is the difference between java and oracle?
Oracle Database is a relational database that you can use to store, use, and modify data.
The Java Database Connectivity (JDBC) standard is used by Java applications to access and
manipulate data in relational databases.
47.How to rename a file in UNIX?
Unix does not have a command specifically for renaming files. Instead, the mv command is
used both to change the name of a file and to move a file into a different directory.
48. What is v-model?
The V-model is an SDLC model where execution of processes happens in a sequential
manner in a V-shape. It is also known as Verification and Validation model.This means that
for every single phase in the development cycle, there is a directly associated testing phase.
49.what is the structure of link list?
A linked list is a linear data structure where each element is a separate object. Each element
(we will call it a node) of a list is comprising of two items - the data and a reference to the
next node. The last node has a reference to null. The entry point into a linked list is called the
head of the list.
50. what is primary key and unique key?
Primary Key is a column that is used to uniquely identify each tuple of the table. It is used to
add integrity constraints to the table. Only one primary key is allowed to be used in a table.
Unique key is a constraint that is used to uniquely identify a tuple in a table.
51.Types of testing?
Types of Functional Testing:
Unit Testing.
Component Testing.
Smoke Testing.
Integration Testing.
Regression Testing.
SVC – 11/11/2020
Sanity Testing.
System Testing.
User Acceptance Testing.
52. What is B+ Tree?
B+ Tree is an extension of B Tree which allows efficient insertion, deletion and search
operations.
In B Tree, Keys and records both can be stored in the internal as well as leaf nodes. Whereas,
in B+ tree, records (data) can only be stored on the leaf nodes while internal nodes can only
store the key values.
The leaf nodes of a B+ tree are linked together in the form of a singly linked lists to make the
search queries more efficient.
B+ Tree are used to store the large amount of data which can not be stored in the main
memory. Due to the fact that, size of main memory is always limited, the internal nodes (keys
to access records) of the B+ tree are stored in the main memory whereas, leaf nodes are
stored in the secondary memory.
53.what is tunneling?
In computer networks, a tunneling protocol is a communications protocol that allows for the
movement of data from one network to another. It involves allowing private network
communications to be sent across a public network (such as the Internet) through a process
called encapsulation.
54. Difference between Firewall and Proxy Server?
1. Firewall :
Firewall is software program that prevents unauthorized access to or from a private network.
All data packets in it are entering or dropping network passes through the firewall and after
checking whether the firewall allows it or not. All traffic must pass through the firewall and
only authorized traffic must pass. It is a system located between two networks where it
implements an access control policy between those networks. It works on network layer of
the OSI model and uses encryption to encrypt the data before transmission.
2. Proxy Server :
Proxy Server is a server that acts as a gateway or intermediary between any device and the rest
of the internet. A proxy accepts and forwards connection requests, then returns data for those
requests
SVC – 11/11/2020
2. In a binary search tree, the value of all the nodes in the left sub-tree is less than the
value of the root.
3. Similarly, value of all the nodes in the right sub-tree is greater than or equal to the
value of the root.
4. This rule will be recursively applied to all the left and right sub-trees of the root.
SVC – 11/11/2020
select *from employee where salary in (selectdistincttop5 salary from employee orderby
salary desc)
58.What is page fault?
A page fault is a type of exception raised by computer hardware when a running program
accesses a memory page that is not currently mapped by the memory management unit into
the virtual address space of a process.
59.What is java collection framework?
The Java collections framework is a set of classes and interfaces that implement commonly
reusable collection data structures. Although referred to as a framework, it works in a manner
of a library.
60. What is interface?
An interface in Java is a blueprint of a class. It has static constants and abstract methods.
The interface in Java is a mechanism to achieve abstraction. There can be only abstract
methods in the Java interface, not method body. It is used to achieve abstraction and
multiple inheritance in Java.
SVC – 11/11/2020
Second and third element are compared and swapped, and this comparing and swapping go
on to the end of the list.
Selection sort:
The selection sort algorithm sorts an array by repeatedly finding the minimum element
(considering ascending order) from unsorted part and putting it at the beginning. The algorithm
maintains two subarrays in a given array.
1) The subarray which is already sorted.
2) Remaining subarray which is unsorted.
SVC – 11/11/2020