Monday, March 10, 2008

Java Interview QuestionsLatest Placement papers

What is the protocol used by server and client ?

Can I modify an object in CORBA ?

What is the functionality stubs and skeletons ?

What is the mapping mechanism used by Java to identify IDL language ?

Diff between Application and Applet ?

What is serializable Interface ?

What is the difference between CGI and Servlet ?

What is the use of Interface ?

Why Java is not fully objective oriented ?

Why does not support multiple Inheritance ?

What it the root class for all Java classes ?

What is polymorphism ?

Suppose If we have variable ' I ' in run method, If I can create one or more thread each thread will occupy a separate copy or same variable will be shared ?

In servlets, we are having a web page that is invoking servlets username and password ? which is checked in the database ? Suppose the second page also If we want to verify the same information whether it will connect to the database or it will be used previous information?

What are virtual functions ?

Write down how will you create a binary Tree ?

What are the traverses in Binary Tree ?

Write a program for recursive Traverse ?

What are session variable in Servlets ?

What is client server computing ?

What is Constructor and Virtual function? Can we call Virtual function in a constructor ?

Why we use OOPS concepts? What is its advantage ?

What is the middleware ? What is the functionality of Webserver ?

Why Java is not 100 % pure OOPS ? ( EcomServer )

When we will use an Interface and Abstract class ?

What is an RMI?

How will you pass parameters in RMI ? Why u serialize?

What is the exact difference in between Unicast and Multicast object ? Where we will use ?

What is the main functionality of the Remote Reference Layer ?

How do you download stubs from a Remote place ?

What is the difference in between C++ and Java ? can u explain in detail ?

I want to store more than 10 objects in a remote server ? Which methodology will follow ?

What is the main functionality of the Prepared Statement ?

What is meant by static query and dynamic query ?

What are the Normalization Rules ? Define the Normalization ?

What is meant by Servlet? What are the parameters of the service method ?

What is meant by Session ? Tell me something about HTTPSession Class ?

How do you invoke a Servlet? What is the difference in between doPost and doGet methods ?

What is the difference in between the HTTPServlet and Generic Servlet ? Explain their methods ? Tell me their parameter names also ?

Have you used threads in Servlet ?

Write a program on RMI and JDBC using StoredProcedure ?

How do you sing an Applet ?

In a Container there are 5 components. I want to display the all the components names, how will you do that one ?

Why there are some null interface in java ? What does it mean ? Give me some null interfaces in JAVA ?

Tell me the latest versions in JAVA related areas ?

What is meant by class loader ? How many types are there? When will we use them ?

How do you load an Image in a Servlet ?

What is meant by flickering ?

What is meant by distributed Application ? Why we are using that in our applications ?

What is the functionality of the stub ?

Have you used any version control ?

What is the latest version of JDBC ? What are the new features are added in that ?

Explain 2 tier and 3 -tier Architecture ?

What is the role of the webserver ?

How have you done validation of the fields in your project ?

What is the main difficulties that you are faced in your project ?

What is meant by cookies ? Explain ?

Java database Placement Papers Interview Questions

  • What is the difference between an Abstract class and Interface ?
  • What is user defined exception ?
    • What do you know about the garbage collector ?
  • What is the difference between C++ & Java ?
  • Explain RMI Architecture?
  • How do you communicate in between Applets & Servlets ?
  • What is the use of Servlets ?
  • What is JDBC? How do you connect to the Database ?
  • In an HTML form I have a Button which makes us to open another page in 15 seconds. How will do you that ?
  • What is the difference between Process and Threads ?
  • What is the difference between RMI & Corba ?
  • What are the services in RMI ?
  • How will you initialize an Applet ?
  • What is the order of method invocation in an Applet ?
  • When is update method called ?
  • How will you pass values from HTML page to the Servlet ?
  • Have you ever used HashTable and Dictionary ?
  • How will you communicate between two Applets ?
  • What are statements in JAVA ?
  • What is JAR file ?
  • What is JNI ?
  • What is the base class for all swing components ?
  • What is JFC ?
  • What is Difference between AWT and Swing ?
  • Considering notepad/IE or any other thing as process, What will happen if you start notepad or IE 3 times? Where 3 processes are started or 3 threads are started ?
  • How does thread synchronization occurs inside a monitor ?
  • How will you call an Applet using a Java Script function ?
  • Is there any tag in HTML to upload and download files ?
  • Why do you Canvas ?
  • How can you push data from an Applet to Servlet ?
  • What are 4 drivers available in JDBC ?
  • How you can know about drivers and database information ?
  • If you are truncated using JDBC, How can you know ..that how much data is truncated ?
  • And What situation , each of the 4 drivers used ?
  • How will you perform transaction using JDBC ?
  • In RMI, server object first loaded into the memory and then the stub reference is sent to the client ? or whether a stub reference is directly sent to the client ?
  • Suppose server object is not loaded into the memory, and the client request for it , what will happen?
  • What is serialization ?
  • Can you load the server object dynamically? If so, what are the major 3 steps involved in it ?
  • What is difference RMI registry and OSAgent ?
  • To a server method, the client wants to send a value 20, with this value exceeds to 20,. a message should be sent to the client ? What will you do for achieving for this ?
  • What are the benefits of Swing over AWT ?
  • Where the CardLayout is used ?
  • What is the Layout for ToolBar ?
  • What is the difference between Grid and GridbagLayout ?
  • How will you add panel to a Frame ?
  • What is the corresponding Layout for Card in Swing ?
  • What is light weight component ?
  • Can you run the product development on all operating systems ?
  • What is the webserver used for running the Servlets ?
  • What is Servlet API used for connecting database ?
  • What is bean ? Where it can be used ?
  • What is difference in between Java Class and Bean ?
  • Can we send object using Sockets ?
  • What is the RMI and Socket ?
  • How to communicate 2 threads each other ?
  • What are the files generated after using IDL to Java Compilet ?

Recent Placement Papers & Technical Interview Questions

Q1: What are the advantages of OOPL?

Ans: Object oriented programming languages directly represent the real life objects. The features of OOPL as inhreitance, polymorphism, encapsulation makes it powerful.

Q2: What do mean by polymorphisum, inheritance, encapsulation?

Ans: Polymorhisum: is a feature of OOPl that at run time depending upon the type of object the appropriate method is called.
Inheritance: is a feature of OOPL that represents the "is a" relationship between different objects(classes). Say in real life a manager is a employee. So in OOPL manger class is inherited from the employee class.
Encapsulation: is a feature of OOPL that is used to hide the information.

Q3: What do you mean by static methods?

Ans: By using the static method there is no need creating an object of that class to use that method. We can directly call that method on that class. For example, say class A has static function f(), then we can call f() function as A.f(). There is no need of creating an object of class A.

Q4: What do you mean by virtual methods?

Ans: virtual methods are used to use the polymorhism feature in C++. Say class A is inherited from class B. If we declare say fuction f() as virtual in class B and override the same function in class A then at runtime appropriate method of the class will be called depending upon the type of the object.

Q5: Given two tables Student(SID, Name, Course) and Level(SID, level) write the SQL statement to get the name and SID of the student who are taking course = 3 and at freshman level.

Ans: SELECT Student.name, Student.SID
FROM Student, Level
WHERE Student.SID = Level.SID
AND Level.Level = "freshman"
AND Student.Course = 3;

Q6: What are the disadvantages of using threads?

Ans: DeadLock.

 
 

Q1: Write the Java code to declare any constant (say gravitational constant) and to get its value

Ans: Class ABC
{
static final float GRAVITATIONAL_CONSTANT = 9.8;
public void getConstant()
{
system.out.println("Gravitational_Constant: " + GRAVITATIONAL_CONSTANT);
}
}
Q2: What do you mean by multiple inheritance in C++ ?

Ans: Multiple inheritance is a feature in C++ by which one class can be of different types. Say class teachingAssistant is inherited from two classes say teacher and Student.

Q3: Can you write Java code for declaration of multiple inheritance in Java ?

Ans: Class C extends A implements B
{
}

Placement Papers JAVAJ interview questions

Q1: How can we store the information returned from querying the database? and if it is too big, how does it affect the performance?     

 In Java the return information will be stored in the ResultSet object. Yes, if the ResultSet is getting big, it will slow down the process and the performance as well. We can prevent this situation by give the program a simple but specific query statement.


Q2: What is index table and why we use it?                        

 Index table are based on a sorted ordering of the values. Index table provides fast access time when searching.


Q3: In Java why we use exceptions?                                             

Java uses exceptions as a way of signaling serious problems when you execute a program. One major benefit of having an error signaled by an exception is that it separates the code that deals with errors from the code that is executed when things are moving along smoothly. Another positive aspect of exceptions is that they provide a way of enforcing a response to particular errors.


Q4: Write a code in Perl that makes a connection to Database.

#!/usr/bin/perl
#makeconnection.pl

use DBI;
my $dbh = DBI->connect('dbi:mysql:test','root','foo')||die "Error opening database:
$DBI::errstrn";
print"Successful connect to databasen";

$dbh->disconnect || die "Failed to disconnectn";


Q5: Write a code in Perl that select all data from table Foo?

#!usr/bin/perl
#connect.pl

use DBI;
my ($dbh, $sth, $name, $id);
$dbh= DBI->connect('dbi:mysql:test','root','foo')
|| die "Error opening database: $DBI::errstrn";
$sth= $dbh->prepare("SELECT * from Foo;")
|| die "Prepare failed: $DBI::errstrn";
$sth->execute()
|| die "Couldn't execute query: $DBI::errstrn";
while(( $id, $name) = $sth->fetchrow_array)
{
print "$name has ID $idn";
}
$sth->finish();

$dbh->disconnect
|| die "Failed to disconnectn";
 

JAVA software engineering interview question Papers

Question 1: What is the three tier model?
Answer: It is the presentation, logic, backend
Question 2: Why do we have index table in the database?
Answer: Because the index table contain the information of the other tables. It will
be faster if we access the index table to find out what the other contain.
Question 3: Give an example of using JDBC access the database.


Answer:
try
{
Class.forName("register the driver");
Connection con = DriverManager.getConnection("url of db", "username","password");
Statement state = con.createStatement();
state.executeUpdate("create table testing(firstname varchar(20), lastname varchar(20))");
state.executeQuery("insert into testing values('phu','huynh')");
state.close();
con.close();
}
catch(Exception e)
{
System.out.println(e);
}
Question 4: What is the different of an Applet and a Java Application
Answer: The applet doesn't have the main function
Question 5: How do we pass a reference parameter to a function in Java?
Answer: Even though Java doesn't accept reference parameter, but we can
pass in the object for the parameter of the function.
For example in C++, we can do this:

void changeValue(int& a)
{
a++;
}
void main()
{
int b=2;
changeValue(b);
}

however in Java, we cannot do the same thing. So we can pass the
the int value into Integer object, and we pass this object into the
the function. And this function will change the object.

Latest JAVA software engineering interview questions

Question 1: What is the three tier model?
Answer: It is the presentation, logic, backend
Question 2: Why do we have index table in the database?
Answer: Because the index table contain the information of the other tables. It will
be faster if we access the index table to find out what the other contain.
Question 3: Give an example of using JDBC access the database.


Answer:
try
{
Class.forName("register the driver");
Connection con = DriverManager.getConnection("url of db", "username","password");
Statement state = con.createStatement();
state.executeUpdate("create table testing(firstname varchar(20), lastname varchar(20))");
state.executeQuery("insert into testing values('phu','huynh')");
state.close();
con.close();
}
catch(Exception e)
{
System.out.println(e);
}
Question 4: What is the different of an Applet and a Java Application
Answer: The applet doesn't have the main function
Question 5: How do we pass a reference parameter to a function in Java?
Answer: Even though Java doesn't accept reference parameter, but we can
pass in the object for the parameter of the function.
For example in C++, we can do this:

void changeValue(int& a)
{
a++;
}
void main()
{
int b=2;
changeValue(b);
}

however in Java, we cannot do the same thing. So we can pass the
the int value into Integer object, and we pass this object into the
the function. And this function will change the object

JSP interview questions Placement Papers

Q: What are the most common techniques for reusing functionality in object-oriented systems?
A: The two most common techniques for reusing functionality in object-oriented systems are class inheritance and object composition.

Class inheritance lets you define the implementation of one class in terms of another's. Reuse by subclassing is often referred to as white-box reuse.
Object composition is an alternative to class inheritance. Here, new functionality is obtained by assembling or composing objects to get more complex functionality. This is known as black-box reuse.

Q: Why would you want to have more than one catch block associated with a single try block in Java?
A: Since there are many things can go wrong to a single executed statement, we should have more than one catch(s) to catch any errors that might occur.

Q: What language is used by a relational model to describe the structure of a database?
A: The Data Definition Language.

Q: What is JSP? Describe its concept.
A: JSP is Java Server Pages. The JavaServer Page concept is to provide an HTML document with the ability to plug in content at selected locations in the document. (This content is then supplied by the Web server along with the rest of the HTML document at the time the document is downloaded).

Q: What does the JSP engine do when presented with a JavaServer Page to process?
A: The JSP engine builds a servlet. The HTML portions of the JavaServer Page become Strings transmitted to print methods of a PrintWriter object. The JSP tag portions result in calls to methods of the appropriate JavaBean class whose output is translated into more calls to a println method to place the result in the HTML document

Java Technical Interview Questions

QUESTION: What is a JavaBean? (asked by Lifescan inc)

ANSWER: JavaBeans are reusable software components written in the Java programming language, designed to be manipulated visually by a software development environment, like JBuilder or VisualAge for Java. They are similar to Microsoft's ActiveX components, but designed to be platform-neutral, running anywhere there is a Java Virtual Machine (JVM).

QUESTION: What are the seven layers(OSI model) of networking? (asked by Caspio.com)

ANSWER: 1.Physical, 2.Data Link, 3.Network, 4.Transport, 5.Session, 6.Presentation and 7.Application Layers.

QUESTION: What are some advantages and disadvantages of Java Sockets? (asked by Arashsoft.com)

ANSWER:
Advantages of Java Sockets:

Sockets are flexible and sufficient. Efficient socket based programming can be easily implemented for general communications.

Sockets cause low network traffic. Unlike HTML forms and CGI scripts that generate and transfer whole web pages for each new request, Java applets can send only necessary updated information.

Disadvantages of Java Sockets:

Security restrictions are sometimes overbearing because a Java applet running in a Web browser is only able to establish connections to the machine where it came from, and to nowhere else on the network

Despite all of the useful and helpful Java features, Socket based communications allows only to send packets of raw data between applications. Both the client-side and server-side have to provide mechanisms to make the data useful in any way.

Since the data formats and protocols remain application specific, the re-use of socket based implementations is limited.

 
 

QUESTION: What is the difference between a NULL pointer and a void pointer? (asked by Lifescan inc)

ANSWER: A NULL pointer is a pointer of any type whose value is zero. A void pointer is a pointer to an object of an unknown type, and is guaranteed to have enough bits to hold a pointer to any object. A void pointer is not guaranteed to have enough bits to point to a function (though in general practice it does).

 
 

QUESTION: What is encapsulation technique? (asked by Microsoft)

ANSWER: Hiding data within the class and making it available only through the methods. This technique is used to protect your class against accidental changes to fields, which might leave the class in an inconsistent state.

Java Placement Papers & Technical Interview Questions

1) What is the purpose of garbage collection in Java, and when is it used?

The purpose of garbage collection is to identify and discard objects that are no longer needed by a program so that their resources can be reclaimed and reused. A Java object is subject to garbage collection when it becomes unreachable to the program in which it is used.

2) Describe synchronization in respect to multithreading.

With respect to multithreading, synchronization is the capability to control the access of multiple threads to shared resources. Without synchonization, it is possible for one thread to modify a shared variable while another thread is in the process of using or updating same shared variable. This usually leads to significant errors.

>

3) How is JavaBeans differ from Enterprise JavaBeans?

The JavaBeans architecture is meant to provide a format for general-purpose components. On the other hand, the Enterprise JavaBeans architecture provides a format for highly specialized business logic components.

4) In what ways do design patterns help build better software?

Design patterns helps software developers to reuse successful designs and architectures. It helps them to choose design alternatives that make a system reusuable and avoid alternatives that compromise reusability through proven techniques as design patterns.

 
 

5) Describe 3-Tier Architecture in enterprise application development.

In 3-tier architecture, an application is broken up into 3 separate logical layers, each with a well-defined set of interfaces. The presentation layer typically consists of a graphical user interfaces. The business layer consists of the application or business logic, and the data layer contains the data that is needed for the application.

Advanced JAVA Interview Questions

Q:In Java, what is the difference between an Interface and an Abstract class?

A: An Abstract class declares have at least one instance method that is declared abstract which will be implemented by the subclasses. An abstract class can have instance methods that implement a default behavior. An Interface can only declare constants and instance methods, but cannot implement default behavior.

Q: Can you have virtual functions in Java? Yes or No. If yes, then what are virtual functions?

A: Yes, Java class functions are virtual by default. Virtual functions are functions of subclasses that can be invoked from a reference to their superclass. In other words, the functions of the actual object are called when a function is invoked on the reference to that object.

Q:Write a function to reverse a linked list p in C++?

A:

Link* reverse_list(Link* p)
{
if (p == NULL)
return NULL;

Link* h = p;
p = p->next;
h->next = NULL;
while (p != null)
{
Link* t = p->next;
p->next = h;
h = p;
p = t;
}

return h;
}

Q:In C++, what is the usefulness of Virtual destructors?

A:Virtual destructors are neccessary to reclaim memory that were allocated for objects in the class hierarchy. If a pointer to a base class object is deleted, then the compiler guarantees the various subclass destructors are called in reverse order of the object construction chain.

Q:What are mutex and semaphore? What is the difference between them?

A:A mutex is a synchronization object that allows only one process or thread to access a critical code block. A semaphore on the other hand allows one or more processes or threads to access a critial code block. A semaphore is a multiple mutex

Java Placement Papers & Technical Interview Questions

What advantages does CMOS have over TTL(transitor transitor logic)? (ALCATEL)

Answer:

  • low power dissipation
  • pulls up to rail
  • easy to interface

How is Java unlike C++? (Asked by Sun)

Answer:

Some language features of C++ have been removed. String manipulations in Java do not allow for buffer overflows and other typical attacks. OS-specific calls are not advised, but you can still call native methods. Everything is a class in Java. Everything is compiled to Java bytecode, not executable (although that is possible with compiler tools).

Question4:

What is HTML (Hypertext Markup Language)?

Answer:

HTML (HyperText Markup Language) is the set of "markup" symbols or tags inserted in a file intended for display on a World Wide Web browser. The markup tells the Web browser how to display a Web page's words and images for the user.

Question5:

Define class.

Answer: A class describes a set of properties (primitives and objects) and behaviors (methods).

Most FAQ Common HR Interview Questions

Tell me about yourself: - The most often asked question in interviews. You need to have a short statement prepared in your mind. Be careful that it does not sound rehearsed. Limit it to work-related items unless instructed otherwise. Talk about things you have done and jobs you have held that relate to the position you are interviewing for. Start with the item farthest back and work up to the present.

Why did you leave your last job? - Stay positive regardless of the circumstances. Never refer to a major problem with management and never speak ill of supervisors, co-workers or the organization. If you do, you will be the one looking bad. Keep smiling and talk about leaving for a positive reason such as an opportunity, a chance to do something special or other forward-looking reasons.

What experience do you have in this field? - Speak about specifics that relate to the position you are applying for. If you do not have specific experience, get as close as you can.

Do you consider yourself successful? - You should always answer yes and briefly explain why. A good explanation is that you have set goals, and you have met some and are on track to achieve the others.

What do co-workers say about you? - Be prepared with a quote or two from co-workers. Either a specific statement or a paraphrase will work. Jill Clark, a co-worker at Smith Company, always said I was the hardest workers she had ever known. It is as powerful as Jill having said it at the interview herself.

What do you know about this organization? - This question is one reason to do some research on the organization before the interview. Find out where they have been and where they are going. What are the current issues and who are the major players?

What have you done to improve your knowledge in the last year? - Try to include improvement activities that relate to the job. A wide variety of activities can be mentioned as positive self-improvement. Have some good ones handy to mention.

Are you applying for other jobs? - Be honest but do not spend a lot of time in this area. Keep the focus on this job and what you can do for this organization. Anything else is a distraction.

Why do you want to work for this organization? - This may take some thought and certainly, should be based on the research you have done on the organization. Sincerity is extremely important here and will easily be sensed. Relate it to your long-term career goals.

Do you know anyone who works for us? - Be aware of the policy on relatives working for the organization. This can affect your answer even though they asked about friends not relatives. Be careful to mention a friend only if they are well thought of.

What kind of salary do you need? - A loaded question. A nasty little game that you will probably lose if you answer first. So, do not answer it. Instead, say something like, That's a tough question. Can you tell me the range for this position? In most cases, the interviewer, taken off guard, will tell you. If not, say that it can depend on the details of the job. Then give a wide range.

Are you a team player? - You are, of course, a team player. Be sure to have examples ready. Specifics that show you often perform for the good of the team rather than for yourself are good evidence of your team attitude. Do not brag, just say it in a matter-of-fact tone. This is a key point.

How long would you expect to work for us if hired? - Specifics here are not good. Something like this should work: I'd like it to be a long time. Or As long as we both feel I'm doing a good job.

Have you ever had to fire anyone? How did you feel about that? - This is serious. Do not make light of it or in any way seem like you like to fire people. At the same time, you will do it when it is the right thing to do. When it comes to the organization versus the individual who has created a harmful situation, you will protect the organization. Remember firing is not the same as layoff or reduction in force.

What is your philosophy towards work? - The interviewer is not looking for a long or flowery dissertation here. Do you have strong feelings that the job gets done? Yes. That's the type of answer that works best here. Short and positive, showing a benefit to the organization.

If you had enough money to retire right now, would you? - Answer yes if you would. But since you need to work, this is the type of work you prefer. Do not say yes if you do not mean it.

Have you ever been asked to leave a position? - If you have not, say no. If you have, be honest, brief and avoid saying negative things about the people or organization involved.

Explain how you would be an asset to this organization - You should be anxious for this question. It gives you a chance to highlight your best points as they relate to the position being discussed. Give a little advance thought to this relationship.

Why should we hire you? - Point out how your assets meet what the organization needs. Do not mention any other candidates to make a comparison.

Tell me about a suggestion you have made - Have a good one ready. Be sure and use a suggestion that was accepted and was then considered successful. One related to the type of work applied for is a real plus.

What irritates you about co-workers? - This is a trap question. Think real hard but fail to come up with anything that irritates you. A short statement that you seem to get along with folks is great.

What is your greatest strength? - Numerous answers are good, just stay positive. A few good examples: Your ability to prioritize, Your problem-solving skills, Your ability to work under pressure, Your ability to focus on projects, Your professional expertise, Your leadership skills, Your positive attitude .

Tell me about your dream job. - Stay away from a specific job. You cannot win. If you say the job you are contending for is it, you strain credibility. If you say another job is it, you plant the suspicion that you will be dissatisfied with this position if hired. The best is to stay genetic and say something like: A job where I love the work, like the people, can contribute and can't wait to get to work.

Why do you think you would do well at this job? - Give several reasons and include skills, experience and interest.

What kind of person would you refuse to work with? - Do not be trivial. It would take disloyalty to the organization, violence or lawbreaking to get you to object. Minor objections will label you as a whiner.

What is more important to you: the money or the work? - Money is always important, but the work is the most important. There is no better answer.

What would your previous supervisor say your strongest point is? - There are numerous good possibilities: Loyalty, Energy, Positive attitude, Leadership, Team player, Expertise, Initiative, Patience, Hard work, Creativity, Problem solver

Tell me about a problem you had with a supervisor - Biggest trap of all. This is a test to see if you will speak ill of your boss. If you fall for it and tell about a problem with a former boss, you may well below the interview right there. Stay positive and develop a poor memory about any trouble with a supervisor.

What has disappointed you about a job? - Don't get trivial or negative. Safe areas are few but can include: Not enough of a challenge. You were laid off in a reduction Company did not win a contract, which would have given you more responsibility.

Tell me about your ability to work under pressure. - You may say that you thrive under certain types of pressure. Give an example that relates to the type of position applied for.

Do your skills match this job or another job more closely? - Probably this one. Do not give fuel to the suspicion that you may want another job more than this one.

What motivates you to do your best on the job? - This is a personal trait that only you can say, but good examples are: Challenge, Achievement, Recognition

Are you willing to work overtime? Nights? Weekends? - This is up to you. Be totally honest.

How would you know you were successful on this job? - Several ways are good measures: You set high standards for yourself and meet them. Your outcomes are a success.Your boss tell you that you are successful

Would you be willing to relocate if required? - You should be clear on this with your family prior to the interview if you think there is a chance it may come up. Do not say yes just to get the job if the real answer is no. This can create a lot of problems later on in your career. Be honest at this point and save yourself future grief.

Are you willing to put the interests of the organization ahead of your own? - This is a straight loyalty and dedication question. Do not worry about the deep ethical and philosophical implications. Just say yes.

Describe your management style. - Try to avoid labels. Some of the more common labels, like progressive, salesman or consensus, can have several meanings or descriptions depending on which management expert you listen to. The situational style is safe, because it says you will manage according to the situation, instead of one size fits all.

What have you learned from mistakes on the job? - Here you have to come up with something or you strain credibility. Make it small, well intentioned mistake with a positive lesson learned. An example would be working too far ahead of colleagues on a project and thus throwing coordination off.

Do you have any blind spots? - Trick question. If you know about blind spots, they are no longer blind spots. Do not reveal any personal areas of concern here. Let them do their own discovery on your bad points. Do not hand it to them.

If you were hiring a person for this job, what would you look for? - Be careful to mention traits that are needed and that you have.

Do you think you are overqualified for this position? - Regardless of your qualifications, state that you are very well qualified for the position.

How do you propose to compensate for your lack of experience? - First, if you have experience that the interviewer does not know about, bring that up: Then, point out (if true) that you are a hard working quick learner.

What qualities do you look for in a boss? - Be generic and positive. Safe qualities are knowledgeable, a sense of humor, fair, loyal to subordinates and holder of high standards. All bosses think they have these traits.

Tell me about a time when you helped resolve a dispute between others. - Pick a specific incident. Concentrate on your problem solving technique and not the dispute you settled.

What position do you prefer on a team working on a project? - Be honest. If you are comfortable in different roles, point that out.

Describe your work ethic. - Emphasize benefits to the organization. Things like, determination to get the job done and work hard but enjoy your work are good.

What has been your biggest professional disappointment? - Be sure that you refer to something that was beyond your control. Show acceptance and no negative feelings.

Tell me about the most fun you have had on the job. - Talk about having fun by accomplishing something for the organization.

Do you have any questions for me? - Always have some questions prepared. Questions prepared where you will be an asset to the organization are good. How soon will I be able to be productive? and What type of projects will I be able to assist on? are examples.

Fresher Job Interview Questions on OS Concepts

  1. What do the system calls fork(), vfork(), exec(), wait(), waitpid() do? Whats a Zombie process? Whats the difference between fork() and vfork()?
  2. How does freopen() work?
  3. What are threads? What is a lightweight process? What is a heavyweight process? How different is a thread from a process?
  4. How are signals handled?
  5. What is a deadlock?
  6. What are semaphores?
  7. What is meant by context switching in an OS?
  8. What is Belady's anomaly?
  9. What is thrashing?
  10. What are short-, long- and medium-term scheduling?
  11. What are turnaround time and response time?
  12. What is the Translation Lookaside Buffer (TLB)?
  13. What is cycle stealing?
  14. What is a reentrant program?
  15. When is a system in safe state?
  16. What is busy waiting?
  17. What is pages replacement? What are local and global page replacements?
  18. What is meant by latency, transfer and seek time with respect to disk I/O?
  19. What are monitors? How are they different from semaphores?
  20. In the context of memory management, what are placement and replacement algorithms?
  21. What is paging? What are demand- and pre-paging?
  22. What is mounting?
  23. What do you mean by dispatch latency?
  24. What is multi-processing? What is multi-tasking? What is multi-threading?
  25. What is multi-programming?
  26. What is compaction?
  27. What is memory-mapped I/O? How is it different frim I/O mapped I/O?
  28. List out some reasons for process termination.

C++ C Programming Puzzles Papers

76)
#include <stdio.h>
#define MAXI 100
main(){
int x=6,done,i;
done=i=0;
do
{
if((x/=2)>1)
{i++; continue;}
else
done++;
}while ((i < MAXI) && !done);

printf("%d %d\n",i,done);
}

77)
#include <stdio.h>
main()
{
extern int i;
i=20;
printf("%d\n",sizeof(i));
}

78)
#include <stdio.h>
fun()
{
printf("Yes\n");
}

#define fun() printf("No\n")

main()
{
fun();
(fun)();
}

79)
#include <stdio.h>
main()
{
int i = 1;
switch(i) {
printf("\nHello, ");
case 1: printf("One, ");
i++;
break;
case 2: printf("Two");
break;
}
}

80)
#include <stdio.h>
#define DESHAWCURRENTDEBUGLEVEL 1
void main(void)
{
int i = 10 ;
int j = 15 ;

#ifdef DESHAWCURRENTDEBUGLEVEL
printf("%d\n",i);
#else
printf("%d\n",j);
#endif
}

81)
#include <stdio.h>
#define scanf "%s DE Shaw"
main()
{
printf(scanf,scanf);
}

82)
#include <stdio.h>
main()
{
char *p="abc";
char *q="abc123";

while(*p==*q)
{
printf("%c %c",*p,*q);
p++;q++;
}
}

83)
#include <stdio.h>
#define INTPTR int *
main()
{
INTPTR pi, pj;
int i,j;
i=10;j=20;
pi = &j;
pj = &j;
j++;
i= *pi;
printf("%d,",i);
j++;
// i= *pj;
printf("%d",pj);
}

84)
#include <stdio.h>
#include<string.h>
main()
{
char strp[] = "Never ever say no";
char *chp, c='e';
int i,j;
chp = strrchr(strp, c);
i = chp-strp;
for(j=0;j<=i;j++)printf("%c",strp[j]);
}

85)
#include <stdio.h>
main()
{
char str[] ="abcdef";
printf("str is %s",str);
str = "DESIS";
printf("str is %s",str);
}

86)
#include <stdio.h>
main()
{
int i = 10;
printf(" %d %d %d \n", ++i, i++, ++i);
}

87)
#include <stdio.h>
#include<string.h>
main()
{
char *str ="India pvt. ltd.";
char *str1 = "DESIS";
printf("str is %s",str);
printf("str is %s",str1);
strcpy(str,str1);
printf("str is %s",str);
}

88)
#include <stdio.h>
#include<string.h>
main()
{
char str[] ="DESIS India pvt. ltd.";
const char *str1= str;
strcpy(str1,"DESHAW");
printf("str is %s",str);
}

89)
#include <stdio.h>
main()
{
int i=4,j=2,k=0;
char c1='a',c2='b';
if(k==0)printf("k is zero\n");
else if(j==2)printf("j is 2\n");
else if(i==4)printf("i is 4\n");
if(c1!='a')printf("c1 is not a\n");
else if (c2=='a')printf("c2 is b");
else printf("Hello\n");
}

90)
#include <stdio.h>
main()
{
int a[3] = {1,2,3};
int i= 2;
printf("\n %d %d\n", a[i], i[a]);
}

91)
#include <stdio.h>
void fun(int, int*);
main()
{
int j,i;
int * intptr;
printf("enter an integer\n");
scanf("%d",&i);
intptr = &j;
j = i;
printf("i and j are %d %d \n",i,j);
fun(j,intptr);
printf("i is:%d",i);
printf("\n j is:%d",j);
}
void fun(int k, int *iptr)
{
k++;
(*iptr)++;
return;
}

92)
#include <stdio.h>
main()
{
int x;
x = printf("%d\n",x=printf("%d\n",100));
printf("%d\n",x);
}

93)
#include <stdio.h>
main()
{
int i;
char c;
for (i=0;i<5;i++){
scanf("%d",&c);
printf("%d",i);
}
}

94)
#include <stdio.h>
main()
{
int x = 10,y=2,z;
z=x/*y+y*/+y;
printf("%d\n",z);
}

95)
#include <stdio.h>
main()
{
int a[] = {0,1,2,3,4};
int *p[] = {a,a+1,a+2,a+3,a+4};
int **pp = p;

printf("%d, %d, %d ", *pp-a, pp-p, **pp);
pp++; pp++;;++pp;*++pp;
printf("%d, %d, %d ", pp-p, *pp-a, **pp);
}

96)
#include <stdio.h>
#include<stdlib.h>
#include<ctype.h>
main()
{
int *p, *c, i;
i = 5;
p = malloc(sizeof(i));
printf("\n%d",*p);
*p = 10;
printf("\n%d %d",i,*p);
c = calloc(2,i);
printf("\n%d\n",*c);
}

97)
#include <stdio.h>
main()
{
char input[] = "SSSWILTECH1\1\1";
int i, c;
for ( i=2; (c=input[i])!='\0'; i++)
{
switch(c)
{
case 'a': putchar ('i'); continue;
case '1': break;
case 1: while (( c = input[++i]) != '\1' && c!= '\0');
case 9: putchar('S');
case 'E': case 'L': continue;
default: putchar(c);continue;
}
putchar(' ');
}
putchar('\n');
}

98)
#include <stdio.h>
main()
{
unsigned int k = 987 , i = 0;
char trans[10];

do
{
trans[i++] = (k%16 > 9) ? (k%16 - 10 + 'a') : (k%16 - '0' );

} while(k /= 16);

for(i=0;i<10;i++)
printf("%c", trans[i]);
}

99)
#include <stdio.h>

main()
{
unsigned int k = 987 , i = 0;
char trans[10];

do {
trans[i++] = (k%16 > 9 ? k%16 - 10 + 'a' : k%16 - '0' );
printf("%d %d\n",k,k%16);

} while(k /= 16);

printf("%s\n", trans);
}

100)
#include <stdio.h>
main()
{
char *pk;
const char* p;
const char c = 'a';
char c1='b';
p=&c1;
pk = &c;
printf("%c %c",*pk,*p);
}

C++ C Programming Puzzles

101)
#include <stdio.h>
main()
{

int i=4;

if (i>5) printf("Hi");

else f(i);
}

f(
int j)
{

if (j>=4) f(j-1);

else
if(j==0)return;
printf(
"Hi");

return;
}

102)
#include <stdio.h>
int *NEXT(register
int i)
{

int *ipt;
ipt = &i;
ipt++;

return ipt;
}

main ()
{

int j;
printf(
"%d",(NEXT(j)));
}

103)
#include <stdio.h>
#define PRINT(int) printf("int = %d ",int)
main()
{

int x,y,z;
x=
03;y=02;z=01;
PRINT(x^x);
z<<=
3;PRINT(x);
y>>=
3;PRINT(y);
}

104)
#include <stdio.h>
#define PRINT(int) printf( "int = %d ", int)
main()
{

int x=03,y=02,z=01;
PRINT (x | y & ~z);
PRINT (x & y && z);
PRINT (x ^ y & ~z);
}

105)
#include <stdio.h>
main()
{

int p;

for(p = 1; p<=10,--p; p=p+2)
puts(
"Hello");
}

106)
#include <stdio.h>
int n, R;
main()
{
R =
0;
scanf(
"%d",&n);
printf(
"\n
%d, %d",fun(n),R);
}

int fun(int n)
{

if (n>3) return R = 5;
R =
6;

return(1);
}

107)
#include <stdio.h>
main()
{

int arr[3][3] = {1,2,3,4,5,6,7,8,9};

int i,j;

for (j=2;j>=0;j--){

for(i=2;i>=0;i--){
printf(
"\n%d",*(*(arr+i)+j));
printf(
"\n TATATATA");
}
}
}

108)
#include <stdio.h>
main()
{

int a = 10, b = 5,c = 3,d = 3;


if ((a<b) && (c = d++))
printf(
" %d
%d
%d
%d ", a, b, c, d);

else
printf(
" %d
%d
%d
%d ", a, b, c, d);

}

109)
#include <stdio.h>
main()
{

struct test
{

char c;

int i;

char m;
} t1;
printf(
"%d
%d\n",sizeof(t1), sizeof(t1.c));
}

110)
#include <stdio.h>
main()
{

int a,b;
scanf(
"%d
%d", &a, &b);
printf(
"%d\n", a+++b);
printf(
"%d
%d\n",a,b);
}

111)
#include <stdio.h>
int i;
main()
{

char a[] = "Shiva";
printf(
"%c\n",i[a]);
}

112)
#include <stdio.h>
myread(a,b)
{
printf(
"%d
%d",a,b);
}

main()
{
myread(
2,4);
}

113)
#include <stdio.h>
funct(
char* str)
{
printf(
"%s\n",str);
}

main()
{

static
int ii = 1;

int jj = 5;
ii+=++jj;
funct(ii+++
"Campus Interview");
}

114)
#include <stdio.h>
funct(str)
{
printf(
"%s\n",str);
}

main()
{
funct(
'-'-'-'+"DEShaw");
}

115)
#include <stdio.h>
main()
{
printf(
" %d\n",'-'-'-'+'/'/'/');
}

116)
#include <stdio.h>
static
int a = 6;
extern
int a;

main()
{
printf(
"%d",a);
}

117)
#include <stdio.h>
main()
{

int i=6,j=4;
printf(
"NO\n");

switch(i)
{

do{

case
1: printf("yes\n");


case
2:


case
3:


case
4:


case
5:


case
6:
j--;
}
while (j);
}
}

118)
#include <stdio.h>
abc(
int *i, int *j)
{
*i = *i + *j;
*j = *i - *j;
*i = *i - *j;
}
main()
{

int i = 5, j=10;
abc(&i,&j);
printf(
"%d..%d",i,j);
}

119)
#include<stdio.h>
int main()
{

char c;
c=
255;
printf(
"%d",c);

return(0);
}

120)
#include<stdio.h>
main()
{

int x=5,p=10;
printf(
"%*d",x,p);
}

121)
#include<stdio.h>
main()
{

int a[]={2,3,4,5,6};

int i=0;
printf(
"%d",a[i++]+i[a+1]);
}

122)
#include<stdio.h>
#include<stdlib.h>
main()
{

int *ptr=(int*)malloc(sizeof(int));
*ptr=
4;
printf(
"%d",*ptr++);
}

123)
#include<stdio.h>
main()
{

float x=3.14;
printf(
"%e, %E, %f",x,x,x);
}

124)
#include<stdio.h>
int main(int k)
{

if(k<10)
printf(
"%d ",main(k+1));

return k;
}

125)
#include<stdio.h>
main()
{

int i=4;
printf(
"%d
%d
%d",++i,i++,i*i);
printf(
"\n");
printf(
"%d
%d
%d",i*i,++i,i++);
}