Home Interview Questions and AnswersPlacement Papers with Answers TCS Interview Questions and Answers For Graduates Part-3

tcs img21.What are the differences between structures and arrays?

Arrays is a group of similar data types but Structures can be group of different data types

22.What is data structure?

A data structure is a way of organizing data that considers not only the items stored, but also their relationship to each other. Advance knowledge about the relationship between data items allows designing of efficient algorithms for the manipulation of data.

23. Can you list out the areas in which data structures are applied extensively?

Compiler Design,

Operating System,

Database Management System,

Statistical analysis package,

Numerical Analysis,

Graphics,

Artificial Intelligence,

Simulation

24.What are the advantages of inheritance?

It permits code reusability. Reusability saves time in program development. It encourages the reuse of proven and debugged high-quality software, thus reducing problem after a system becomes functional.

25. what are the two integrity rules used in DBMS?
The two types of  integrity rules are referential integrity rules and entity integrity rules. Referential integrity rules dictate that a database does not contain orphan foreign key values. This means that
A primary key value cannot be modified if the value is used as a foreign key in a child table. Entity integrity dictates that the primary key value cannot be Null.

26. Tell something about deadlock and how can we prevent dead lock?

In an operating system, a deadlock is a situation which occurs when a process enters a waiting state because a resource requested by it is being held by another waiting process, which in turn is waiting for another resource. If a process is unable to change its state indefinitely because the resources requested by it are being used by other waiting process, then the system is said to be in a deadlock.

Mutual Exclusion: At least one resource must be non-shareable.[1] Only one process can use the resource at any given instant of time.
Hold and Wait or Resource Holding: A process is currently holding at least one resource and requesting additional resources which are being held by other processes.
No Preemption: The operating system must not de-allocate resources once they have been allocated; they must be released by the holding process voluntarily.
Circular Wait: A process must be waiting for a resource which is being held by another process, which in turn is waiting for the first process to release the resource. In general, there is a set of waiting processes, P = {P1, P2, …, PN}, such that P1 is waiting for a resource held by P2, P2 is waiting for a resource held by P3 and so on till PN is waiting for a resource held by P1.[1][7]

Thus prevention of deadlock is possible by ensuring that at least one of the four conditions cannot hold.

28. What is Doubly link list?

A doubly linked list is a linked data structure that consists of a set of sequentially linked records called nodes. Each node contains two fields, called links, that are references to the previous and to the next node in the sequence of nodes. The beginning and ending nodes’ previous and next links, respectively, point to some kind of terminator, typically a sentinel node or null, to facilitate traversal of the list. If there is only one sentinel node, then the list is circularly linked via the sentinel node. It can be conceptualized as two singly linked lists formed from the same data items, but in opposite sequential orders.

29.What is data abstraction?  what are the three levels of data abstraction with Example?

Abstraction is the process of recognizing and focusing on important characteristics of a situation or object and leaving/filtering out the un-wanted characteristics of that situation or object.

Lets take a person as example and see how that person is abstracted in various situations

A doctor sees (abstracts) the person as patient. The doctor is interested in name, height, weight, age, blood group, previous or existing diseases etc of a person
An employer sees (abstracts) a person as Employee. The employer is interested in name, age, health, degree of study, work experience etc of a person.

Abstraction is the basis for software development. Its through abstraction we define the essential aspects of a system. The process of identifying the abstractions for a given system is called as Modeling (or object modeling).

Three levels of data abstraction are:
1. Physical level : how the data is stored physically and where it is stored in database.
2. Logical level : what information or data is stored in the database. eg: Database administrator
3.View level : end users work on view level. if any amendment is made it can be saved by other name.

30.What is command line argument?

Getting the arguments from command prompt in c is known as command line arguments. In c main function has three arguments.They are:

Argument counter
Argument vector
Environment vector

You may also like

Leave a Comment