Home » Technical Interview

Fresher Interview Questions

19 December 2010 1 comment Posted By:LG

A few days back i got a chance to take mock interviews for some students.All of them where engineering final year students, and are planning to attend some placement drives. I don’t know how effective i could convey my ideas to them. But as a preparation before the interview i spend some time searching basic questions that i should be asking. That is how i am writing down this small article. Hopefully this will be of some help to those who are attending interviews. Very basic stuff only and i don’t think i have covered all of them. Just brushed all topics, that is all. But this is a generic pattern followed if you are being interviewed for the post of rookie. Answers are also given to some of the questions.
—————————-C and C++————————————-
1.Difference between arrays and linked list?

2. What do the ‘c’ and ‘v’ in argc and argv stand for?
The letter “c” in argc stands for count. The letter “v” in argv stands for vector.

3. What is the difference between NULL and NUL?
NULL is a macro defined in for the null pointer.
NUL is the name of the first character in the ASCII character set. It corresponds to a zero value.

4. Is using exit() the same as using return?
No. The exit() function is used to exit your program and return control to the operating system. The return statement is used to return from a function and return control to the calling function. If you issue a return from the main() function, you are essentially returning control to the calling function, which is the operating system. In this case, the return statement and exit() function are similar.

5.Structure & Union
There is a difference in the way the structure members and union members are stored. Each member within a structure is assigned its own memory location. But the union members, all share a common memory location. Thus, unions are used to save memory.

6.Type Modifiers
The basic data types except void can be modified using a series of type modifiers to fit the requirement of a particular program more closely.These modifiers are called qualifiers.They are signed, unsigned, short, long.

7. C was developed By Dennis Ritchie & Brian Kerninghan

8.An array subscipt must be an unsigned positive integer.

9.Arguements and Parameters – are the variables used in a program and a function respectively.
Variables used in the function call are called arguements.Variables used in the function definition are called parameters.

10. Storage classes are used to define the scope(visibility) and the life-time of the variables and/or functions.Four storage classes in C – auto, static, extern, register.

11.Recursion – is a technique that defines a function in terms of itself.

12.Compare strcmp() and strncmp():strcmp() function – This function compares two strings character by character.Return zero, if they are equal; 1 if the string1 is greater than the second; and -1 the string1 is less than the string2.
strncmp() function – This compares the first n characters of two input strings.Syntax – strncmp(string1,string2,n);

13. C++ was developed by Bjarne Stroustrup

14.What is the purpose of a function prototype?
A function prototype tells the compiler to expect a given function to be used in a given way. i.e, it tells the compiler the nature of the parameters passed to the function and the nature of the value returned by the function.

15.What is the difference between: #include and #include “stdio.h”
They both specify a file for inclusion into the current source file. The difference is where the file stdio.h is expected to be. In the case of the brackets, the compiler will look in all the default locations. In the case of the quotes, the compiler will only look in the current directory.

16.Contrast procedural and object oriented programming.
The procedural paradigm performs computation through a step-by-step manipulation of data items.The object oriented model, in contrast, combines related data and procedural information into a single package called an object. Objects are meant to represent logically separate entities . Objects are grouped together as classes.

17.What are the access privileges in C++ ? What is the default access level ?
The access privileges in C++ are private, public and protected. The default access level assigned to members of a class is private. Private members of a class are accessible only within the class and by friends of the class. Protected members are accessible by the class itself and it’s sub-classes. Public members of a class can be accessed by anyone.

18.What is multiple inheritance & multi-level inheritance ?
Multiple Inheritance is the process whereby a sub-class can be derived from more than one super class.
Multi-level: different levels of inheritance.

19. Complexity of Insertion & Selection sort.
Both has O(N^2).
Selection sort is inefficient on large lists, and generally performs worse than the similar insertion sort.

20.Explain Quicksort & what is its complexity?
O(n log n) complexity on Average
O(n^2) comparisons,In the worst case.

21. Merge sort & complexity.
O(nlogn)

————————————-DBMS——————————————
1. What is a database? And why databases.why not files??
2. What is DBMS?
Is a computerised record keeping system.Which can handle massive amounts of data.It provides for STORAGE, RETRIEVAL,UPDATION of data in an organised manner.

3. Concurrent access control and example.
4.Tuple,attributes in RDBMS.

5.Candidate Key:There may be 2 or more attributes or there combinations which can uniquely identify a record.These attributes or combinations are called CANDIDATE KEYS.Eg:-(Eid,Email Id,CUBICLE ID+CUBICLE PHONE).These are candidates for the primary key.

6.Attribute or group which refers to some other table is called a FORIEGN KEY.

7.Mention various DDL,DML statements.
DML- SELECT , INSERT , UPDATE, DELETE
DDL-CREATE, ALTER, DROP, TRUNCATE

8. DML statements can be rollbacked where as DDL are autocommit.

9.Transaction Control (TCL) statements are used to manage the changes made by DML statements. It allows statements to be grouped together into logical transactions.
* COMMIT – save work done
* SAVEPOINT – identify a point in a transaction to which you can later roll back
* ROLLBACK – restore database to original since the last COMMIT

10. Differentiate DELETE & TRUNCATE statements.

11. write a query to retrieve all names and corresponding orders, from 2 tables, person and orders, both related with the help of person Id(primary key of person table).

12.INNER JOIN- keyword return rows when there is at least one match in both tables.
Syntax:SELECT column_name(s) FROM table_name1 INNER JOIN table_name2 ON table_name1.column_name=table_name2.column_name

13. what does Codd’s rule’s says?
Designed to define what is required from a database management system in order for it to be considered relational.

14. Logical Data Independence.
Changes to the logical level (tables, columns, rows, and so on) must not require a change to an application based on the structure.

15.Normalisation?
A method to avoid problems due to duplication of data values, modification of structure etc.

16. Explain 3NF??
* It should already be in Second Normal Form.
* There should be no transitive dependency, i.e. we shouldn’t have any non-key column depending on any other non-key column.
For second normal form our database should already be in first normal form and every non-key column must depend on entire primary key.

————————————————HTML & Web related stuff————————————————————
1.The correct HTML tag for the largest heading??
<h6>

2. Differentiate <br> and <hr> tags
The <hr /> tag creates a horizontal line in an HTML page.

3. URL – Uniform Resource Locator.Web browsers request pages from web servers by using a URL.

4.What is URL encoding?
URL encoding replaces unsafe ASCII characters with “%” followed by two hexadecimal digits.

5. What does a URL contains?
The URL has 3 parts:
The protocol (“http”) ,The server name (“www.three2tango.com”), The file name (“simple-notes-on-java-concepts.html”) .
A name server converts the server name into an IP.This IP is used to connect to the server machine.

6. What is an IP address?
Each machine on a network is assigned a unique address called an IP address. IP stands for Internet protocol, and these addresses are 32-bit numbers.Each octet can have values between 0 and 255.Every machine on the Internet has a unique IP address.

7. What is a domain name and DNS?
A set of servers called domain name servers (DNS) maps the human-readable names(domain names) to the IP addresses.

8. Eg: for WAN- usage.
Internet, MNC having large networks.

9. What is OSI-reference model?
Open System Interconnection.The OSI model defines the exact stages that a data must undergo when it travels from one device to another through a network.
Application, Presentation, Session, Transport, Network, Datalink, Physical.

10. which layer in OSI is closest to the user??
The application layer is said to be the closest layer to the user. eg:- FTP,TELNET, SMTP are examples.

11. AJAX, XML, Javascripts.

12 Can we replace HTML with XML.

13. Default Ports
HTTP-80.
HTTPS-443
FTP-21
SMTP-25

——————————————-Operating System Concepts————————————–
1. Various states of a Process??
new, running, waiting, ready, terminated

2.What is a context switch?
A context switch is the computing process of storing and restoring state (context) of a CPU so that execution can be resumed from the same point at a later time. This enables multiple processes to share a single CPU. The context switch is an essential feature of a multitasking operating system.

3. two different models of IPC.
Shared memory, Message passing.

4. Shortest Job First (SJF) CPU scheduling.Give an eg and find the average waiting time.
p1-6, p2-8,p3-7,p4-3
Avg waiting time = (3+16+9+0)/4 = 7

5.Non-Preemptive Vs Preemptive Scheduling
Non-preemptive algorithms are designed so that once a process enters the running state, it is not removed from the processor until it has completed its service time.
Preemptive algorithms are driven by the notion of prioritized computation. The process with the highest priority should always be the one currently using the processor.

6.Round robin scheduling.
Round Robin calls for the distribution of the processing time equitably among all processes requesting the processor.Run process for one time slice, then move to back of queue. Each process gets equal share of the CPU.

7. Name the conditions which lead to a deadlock.
Mutual exclusion,Hold & wait, No preemption, circular wait.

8.Denial of Service
Overload the targeted computer preventing it from doing any useful work.

Good luck  folks for your interviews..

One Comment »

  • Matt said:

    I printed a lot of your blog out thanks my friend