Wednesday, August 6, 2008

IBM Placement Papers of 2008 10th May

hello everyone, this is the pattern of placement paper for ibm global which came to my campus on 10th May . 192 out of 390 were selected for GD round and 34 got eliminated after GD. In all 114 were finally selected which was a record for them as well as for my college.

written test consisted of three section first one was verbal reasoning which consisted of some articles n prepositions. A reading comprehension was also asked, this was tricky one and no question could be answered directly. there were 10 questions in all.

second section was aptitude related. Believe me it was the easiest test i ever gave. there were different sections. in all 35 questions were to be answered.5 were related to venn diagram prob,there was a section about binary nos.$ denoted 1 and @ denoted 0.all we had to do was turn each given relation to its binary equivalent and then replace each 1 by $ and each 0 by @.5 questions were about logical reasoning,20 questions were general questions like time, man power n probability questions, very simple u can do them at one go if u hav average iq.

The third section consisted of technical questions,3 were c lang related,3 on unix,2 on data structure n 2 on dbms specially sql.

GD was more of elimination rather than selection, make it a point to speak some good points and do speak fr some time . just speak and u r thru.

Personal interview
hr: wats ur name
me: sir abhinav

hr: hav a seat mr.abhinav
me: thank u sir

hr: so mr. abhinav u r frm electrical stream and u r having such a good cgpa then y u want to go to IT sector
me: sir before coming to this col i was not knowing wats good for me and where my interest lies.after coming here i tried my hands on programming n found tht i m quite good at it and it intersts me very much,i think u can only grow in tht field in which u hav interest.

hr: ok wat all subjects hav u read
me: sir i hv read fundamental of c prog,8085 microprocessor, digital circuits…(always mak it a point to tel only those subjects which involve logic or programming, try to skip core subjects lik power sys n control sys fr electrical…he will stop u after u tel him 3 , 4 subjects)

hr: so u know c lang..
me: yes sir

hr: okk ,so how much u rate urself in c
me: sir i m the best in this col regarding algorithm development, infact i m sure i can compete with any comp. science student regarding logic development(believe me u shld b confident enough to say tht, it was a risk n i took it but if u r not tht good in c just say tht u knw basics of c…or whatever u feel is appropriate)

hr: really,so can u tel me algorithm used by google search engine…
me:( was bit nervous) sir i dont knw exactly bt i can try..

hr: ya sure try try
me:blah blah blah

hr: so u knw wats binary search
me:(tht was very easy) blah blah blah

hr: tel me if i giv u a array of 1000 nos,all in ascending order in hw many iterations will binary search b completed?
me: sir 10 because 2 to pwr 10 is 1024 …

hr: yes thts good ,i m impressed
me: thank u sir

hr: u told me u r very good in prog… can u supprt ur claim.
me: yes sir i hav won one c programming contest n was 11 in c online comp.. out of 200 odd teams.

hr: good so what all programs u did..
me: told him and then he asked me to explain one of the prog..was quite easy

hr: wats diff btwn do while n while
me: (told was easy)

hr: wats pointer
me: (easy)

hr: ok so do u want to ask us any question..
me: askd 1-2 questions,(if thy ask u this questions its quite sure u r thru…)

hr: u gav bangalore as ur preference can u tel y?
me: gave sm funda(never say thers more oppurtunity or smthng lik tht.

hr: thank u abhinav it was very nice meeting u
me: thank u sir ,it was mine pleasure.

see clearing ibm is very easy if u hav good pointer or if hav good marks in their written test, mine score was 43 out of 55 ,highest ws 48 (can b higher this is best to my knowledge) and i think cut off was 35(can b lower also). its easy fr girls ,if girls r in interview its vry rare they will b eliminated (they prefer girls). I don't think they had sectional cut off, they will make u write essay but its hardly ever read bfr interview.

all the best ,believe me they hav easiest written test if u comp with othrs, wipro recruitment process is very tough, infy takes nearly all who clear their written n accenture pattern is same as tht of ibm(exactly same)

Monday, August 4, 2008

Oracle on Linux/Unix questionsDatabase Interview FAQs

  1. How many memory layers are in the shared pool?
  2. How do you find out from the RMAN catalog if a particular archive log has been backed-up?
  3. How can you tell how much space is left on a given file system and how much space each of the file system's subdirectories take-up?
  4. Define the SGA and how you would configure SGA for a mid-sized OLTP environment? What is involved in tuning the SGA?
  5. What is the cache hit ratio, what impact does it have on performance of an Oracle database and what is involved in tuning it?
  6. Other than making use of the statspack utility, what would you check when you are monitoring or running a health check on an Oracle 8i or 9i database?
  7. How do you tell what your machine name is and what is its IP address?
  8. How would you go about verifying the network name that the local_listener is currently using?
  9. You have 4 instances running on the same UNIX box. How can you determine which shared memory and semaphores are associated with which instance?
  10. What view(s) do you use to associate a user's SQLPLUS session with his o/s process?
  11. What is the recommended interval at which to run statspack snapshots, and why?
  12. What spfile/init.ora file parameter exists to force the CBO to make the execution path of a given statement use an index, even if the index scan may appear to be calculated as more costly?
  13. Assuming today is Monday, how would you use the DBMS_JOB package to schedule the execution of a given procedure owned by SCOTT to start Wednesday at 9AM and to run subsequently every other day at 2AM.
  14. How would you edit your CRONTAB to schedule the running of /test/test.sh to run every other day at 2PM?
  15. What do the 9i dbms_standard.sql_txt() and dbms_standard.sql_text() procedures do?
  16. In which dictionary table or view would you look to determine at which time a snapshot or MVIEW last successfully refreshed?
  17. How would you best determine why your MVIEW couldn't FAST REFRESH?
  18. How does propagation differ between Advanced Replication and Snapshot Replication (read-only)?
  19. Which dictionary view(s) would you first look at to understand or get a high-level idea of a given Advanced Replication environment?
  20. How would you begin to troubleshoot an ORA-3113 error?
  21. Which dictionary tables and/or views would you look at to diagnose a locking issue?
  22. An automatic job running via DBMS_JOB has failed. Knowing only that "it's failed", how do you approach troubleshooting this issue?
  23. How would you extract DDL of a table without using a GUI tool?
  24. You're getting high "busy buffer waits" - how can you find what's causing it?
  25. What query tells you how much space a tablespace named "test" is taking up, and how much space is remaining?
  26. Database is hung. Old and new user connections alike hang on impact. What do you do? Your SYS SQLPLUS session IS able to connect.
  27. Database crashes. Corruption is found scattered among the file system neither of your doing nor of Oracle's. What database recovery options are available? Database is in archive log mode.
  28. Illustrate how to determine the amount of physical CPUs a Unix Box possesses (LINUX and/or Solaris).
  29. How do you increase the OS limitation for open files (LINUX and/or Solaris)?
  30. Provide an example of a shell script which logs into SQLPLUS as SYS, determines the current date, changes the date format to include minutes & seconds, issues a drop table command, displays the date again, and finally exits.
  31. Explain how you would restore a database using RMAN to Point in Time?
  32. How does Oracle guarantee data integrity of data changes?
  33. Which environment variables are absolutely critical in order to run the OUI?
  34. What SQL query from v$session can you run to show how many sessions are logged in as a particular user account?
  35. Why does Oracle not permit the use of PCTUSED with indexes?
  36. What would you use to improve performance on an insert statement that places millions of rows into that table?
  37. What would you do with an "in-doubt" distributed transaction?
  38. What are the commands you'd issue to show the explain plan for "select * from dual"?
  39. In what script is "snap$" created? In what script is the "scott/tiger" schema created?
  40. If you're unsure in which script a sys or system-owned object is created, but you know it's in a script from a specific directory, what UNIX command from that directory structure can you run to find your answer?
  41. How would you configure your networking files to connect to a database by the name of DSS which resides in domain icallinc.com?
  42. You create a private database link and upon connection, fails with: ORA-2085: connects to . What is the problem? How would you go about resolving this error?
  43. I have my backup RMAN script called "backup_rman.sh". I am on the target database. My catalog username/password is rman/rman. My catalog db is called rman. How would you run this shell script from the O/S such that it would run as a background process?
  44. Explain the concept of the DUAL table.
  45. What are the ways tablespaces can be managed and how do they differ?
  46. From the database level, how can you tell under which time zone a database is operating?
  47. What's the benefit of "dbms_stats" over "analyze"?
  48. Typically, where is the conventional directory structure chosen for Oracle binaries to reside?
  49. You have found corruption in a tablespace that contains static tables that are part of a database that is in NOARCHIVE log mode. How would you restore the tablespace without losing new data in the other tablespaces?
  50. How do you recover a datafile that has not been physically been backed up since its creation and has been deleted. Provide syntax example.

SQL interview questions DAC interview questions

 What is the IC numbers for DAC that you have used in the lab?

 Define resolution. What is the resolution of DAC that you have used in the lab?

 How many pins does DAC IC have?

 What are the types of DAC?

 Which technique you have used for DAC interfacing

 Which type of DAC you have used in the lab?

 Define all the specifications of DAC.

 What are the advantages of binary ladder type DAC over weighted resistance type DAC?

 What are the applications of DAC?

 Explain block diagram IC 0808?

 Explain the logic of DAC program.

 Explain the interfacing of DAC with 8086

DBA Interview Questions

Sean Hull wrote a few interview questions for Database Journal dealing mostly with Oracle:
- Why is a UNION ALL faster than a UNION?
- What are some advantages to using Oracle's CREATE DATABASE statement to create a new database manually?
- What are three rules of thumb to create good passwords? How would a DBA enforce those rules in Oracle? What business challenges might you encounter?
- Describe the Oracle Wait Interface, how it works, and what it provides. What are some limitations? What do the db_file_sequential_read and db_file_scattered_read events indicate?
- How do you return the top-N results of a query in Oracle? Why doesn't the obvious method work?
- Can Oracle's Data Guard be used on Standard Edition, and if so how? How can you test that the standby database is in sync?
- What is a database link? What is the difference between a public and a private database link? What is a fixed user database link?

The database interview answers are all listed on Database Journal Web site

MySQL management interview questions

  1. How do you show the currently running queries? - SHOW FULL PROCESSLIST;
  2. How do you kill a MySQL query? - See the ID of it from the question above, then KILL id. You can separate multiple IDs by space.
  3. I need to find out how many client connections were aborted by MySQL server. - It's displayed in SHOW STATUS query, alternatively accessible via mysqladmin extended-status.
  4. What does SET SQL_AUTO_IS_NULL =1 do? - you can find the last inserted row for a table that contains an AUTO_INCREMENT column by issuing WHERE auto_increment_column IS NULL

Faq C C++ Interview Questions

  1. What is the most efficient way to reverse a linklist?
  2. How to sort & search a single linklist?
  3. Which is more convenient - single or double-linked linklist? Discuss the trade-offs? What about XOR-linked linklist?
  4. How does indexing work?
  5. char s[10];
    s="Hello";
    printf(s);

    What will be the output? Is there any error with this code?
  6. What is the difference between
    char s[]="Hello";
    char *s="Hello";

    Please give a clear idea on this?
  7. Why do we pass a reference for copy constructors? If it does shallow copy for pass by value (user defined object), how will it do the deep copy?
  8. What is the difference between shallow copy & deep copy?
  9. What is the difference between strcpy and memcpy? What rule should we follow when choosing between these two?
  10. If we declare two variable and two applications are using the same variable, then what will its value be, will it be the same?

TOP 10 questions on MySQL speed-up and optimizations

Jay Pipes, author of Pro MySQL, on his blog posts 10 questions and answers dealing with MySQL speed optimizations.

  1. Which will be faster out of these two queries - one with OR or one with IN?
  2. Where does MyISAM cache table records?
  3. Which will be faster out of queries with explicit INNER JOIN and implicit one?
  4. Is InnoDB faster/better than MyISAM?
  5. Is CHAR faster than VARCHAR?
  6. Is VARCHAR(80) faster than VARCHAR(255)?
  7. Are there performance issues when joining tables from different storage engines?
  8. If I change a derived table to a view, will performance increase?
  9. If I see Using temporary; Using filesort" in the Extra column of EXPLAIN output, does that mean a temporary table is created on disk?
  10. Is it possible to do a FULL OUTER JOIN in MySQL?

Does Java have destructors

Does Java have destructors?

Garbage collector does the job working in the background
Java does not have destructors; but it has finalizers that does a similar job.
the syntax is
public void finalize(){
}
if an object has a finalizer, the method is invoked before the system garbage collects the object

What does the "abstract" keyword mean in front of a method? A class?

Abstract keyword declares either a method or a class.
If a method has a abstract keyword in front of it,it is called abstract method.Abstract method hs no body.It has only arguments and return type.Abstract methods act as placeholder methods that are implemented in the subclasses.
Abstract classes can't be instantiated.If a class is declared as abstract,no objects of that class can be created.If a class contains any abstract method it must be declared as abstract

Are Java constructors inherited ? If not, why not?

You cannot inherit a constructor. That is, you cannot create a instance of a subclass using a constructor of one of it's superclasses. One of the main reasons is because you probably don't want to overide the superclasses constructor, which would be possible if they were inherited. By giving the developer the ability to override a superclasses constructor you would erode the encapsulation abilities of the language.

FAQ How many different types of JDBC drivers are present

How many different types of JDBC drivers are present? Discuss them.

There are four JDBC driver types.
Type 1: JDBC-ODBC Bridge plus ODBC Driver:
The first type of JDBC driver is the JDBC-ODBC Bridge. It is a driver that provides JDBC access to databases through ODBC drivers. The ODBC driver must be configured on the client for the bridge to work. This driver type is commonly used for prototyping or when there is no JDBC driver available for a particular DBMS.
Type 2: Native-API partly-Java Driver:
The Native to API driver converts JDBC commands to DBMS-specific native calls. This is much like the restriction of Type 1 drivers. The client must have some binary code loaded on its machine. These drivers do have an advantage over Type 1 drivers because they interface directly with the database.
Type 3: JDBC-Net Pure Java Driver:
The JDBC-Net drivers are a three-tier solution. This type of driver translates JDBC calls into a database-independent network protocol that is sent to a middleware server. This server then translates this DBMS-independent protocol into a DBMS-specific protocol, which is sent
to a particular database. The results are then routed back through the middleware server and sent back to the client. This type of solution makes it possible to implement a pure Java client. It also makes it possible to swap databases without affecting the client.
Type 4: Native-Protocol Pure Java Driver
These are pure Java drivers that communicate directly with the vendor's database. They do this by converting JDBC commands directly into the database engine's native protocol. This driver has no additional translation or middleware layer, which improves performance tremendously.
What does the "static" keyword mean in front of a variable? A method? A class? Curly braces {}?
static variable
- means a class level variable
static method:
-does not have "this". It is not allowed to access the not static members of the class.
can be invoked enev before a single instance of a class is created.
eg: main
static class:
no such thing.
static free floating block:
is executed at the time the class is loaded. There can be multiple such blocks. This may be useful to load native libraries when using native methods.
eg:
native void doThis(){
static{
System.loadLibrary("myLibrary.lib");
}

Access specifiers: "public", "protected", "private", nothing?

In the case of Public, Private and Protected, that is used to describe which programs can access that class or method: Public – any other class from any package can instantiate and execute the classes and methods. Protected – only subclasses and classes inside of the package can access the classes and methods. Private – the original class is the only class allowed to executed the methods.

What does the "final" keyword mean in front of a variable? A method? A class?

FINAL for a variable : value is constant
FINAL for a method : cannot be overridden
FINAL for a class : cannot be derived
A final variable cannot be reassigned,
but it is not constant. For instance,
final StringBuffer x = new StringBuffer()
x.append("hello");
is valid. X cannot have a new value in it,but nothing stops operations on the object
that it refers, including destructive operations. Also, a final method cannot be overridden
or hidden by new access specifications.This means that the compiler can choose
to in-line the invocation of such a method.(I don't know if any compiler actually does
this, but it's true in theory.) The best example of a final class is
String, which defines a class that cannot be derived.

Does Java have "goto"?

No.

What synchronization constructs does Java provide? How do they work?

The two common features that are used are:
1. Synchronized keyword - Used to synchronize a method or a block of code. When you synchronize a method, you are in effect synchronizing the code within the method using the monitor of the current object for the lock.
The following have the same effect.
synchronized void foo() {
}
and
void foo() {
synchronized(this) {
}
If you synchronize a static method, then you are synchronizing across all objects of the same class, i.e. the monitor you are using for the lock is one per class, not one per object.
2. wait/notify. wait() needs to be called from within a synchronized block. It will first release the lock acquired from the synchronization and then wait for a signal. In Posix C, this part is equivalent to the pthread_cond_wait method, which waits for an OS signal to continue. When somebody calls notify() on the object, this will signal the code which has been waiting, and the code will continue from that point. If there are several sections of code that are in the wait state, you can call notifyAll() which will notify all threads that are waiting on the monitor for the current object. Remember that both wait() and notify() have to be called from blocks of code that are synchronized on the monitor for the current object.

Does Java have multiple inheritance?

Java does not support multiple inheritence directly but it does thru the concept of interfaces.
We can make a class implement a number of interfaces if we want to achieve multiple inheritence type of functionality of C++.

How does exception handling work in Java?

1.It separates the working/functional code from the error-handling code by way of try-catch clauses.
2.It allows a clean path for error propagation. If the called method encounters a situation it can't manage, it can throw an exception and let the calling method deal with it.
3.By enlisting the compiler to ensure that "exceptional" situations are anticipated and accounted for, it enforces powerful coding.
4.Exceptions are of two types: Compiler-enforced exceptions, or checked exceptions. Runtime exceptions, or unchecked exceptions. Compiler-enforced (checked) exceptions are instances of the Exception class or one of its subclasses — excluding the RuntimeException branch. The compiler expects all checked exceptions to be appropriately handled. Checked exceptions must be declared in the throws clause of the method throwing them — assuming, of course, they're not being caught within that same method. The calling method must take care of these exceptions by either catching or declaring them in its throws clause. Thus, making an exception checked forces the us to pay heed to the possibility of it being thrown. An example of a checked exception is java.io.IOException. As the name suggests, it throws whenever an input/output operation is abnormally terminated.

FAQ How many different types of JDBC drivers are present

How many different types of JDBC drivers are present? Discuss them.

There are four JDBC driver types.
Type 1: JDBC-ODBC Bridge plus ODBC Driver:
The first type of JDBC driver is the JDBC-ODBC Bridge. It is a driver that provides JDBC access to databases through ODBC drivers. The ODBC driver must be configured on the client for the bridge to work. This driver type is commonly used for prototyping or when there is no JDBC driver available for a particular DBMS.
Type 2: Native-API partly-Java Driver:
The Native to API driver converts JDBC commands to DBMS-specific native calls. This is much like the restriction of Type 1 drivers. The client must have some binary code loaded on its machine. These drivers do have an advantage over Type 1 drivers because they interface directly with the database.
Type 3: JDBC-Net Pure Java Driver:
The JDBC-Net drivers are a three-tier solution. This type of driver translates JDBC calls into a database-independent network protocol that is sent to a middleware server. This server then translates this DBMS-independent protocol into a DBMS-specific protocol, which is sent
to a particular database. The results are then routed back through the middleware server and sent back to the client. This type of solution makes it possible to implement a pure Java client. It also makes it possible to swap databases without affecting the client.
Type 4: Native-Protocol Pure Java Driver
These are pure Java drivers that communicate directly with the vendor's database. They do this by converting JDBC commands directly into the database engine's native protocol. This driver has no additional translation or middleware layer, which improves performance tremendously.
What does the "static" keyword mean in front of a variable? A method? A class? Curly braces {}?
static variable
- means a class level variable
static method:
-does not have "this". It is not allowed to access the not static members of the class.
can be invoked enev before a single instance of a class is created.
eg: main
static class:
no such thing.
static free floating block:
is executed at the time the class is loaded. There can be multiple such blocks. This may be useful to load native libraries when using native methods.
eg:
native void doThis(){
static{
System.loadLibrary("myLibrary.lib");
}

Access specifiers: "public", "protected", "private", nothing?

In the case of Public, Private and Protected, that is used to describe which programs can access that class or method: Public – any other class from any package can instantiate and execute the classes and methods. Protected – only subclasses and classes inside of the package can access the classes and methods. Private – the original class is the only class allowed to executed the methods.

What does the "final" keyword mean in front of a variable? A method? A class?

FINAL for a variable : value is constant
FINAL for a method : cannot be overridden
FINAL for a class : cannot be derived
A final variable cannot be reassigned,
but it is not constant. For instance,
final StringBuffer x = new StringBuffer()
x.append("hello");
is valid. X cannot have a new value in it,but nothing stops operations on the object
that it refers, including destructive operations. Also, a final method cannot be overridden
or hidden by new access specifications.This means that the compiler can choose
to in-line the invocation of such a method.(I don't know if any compiler actually does
this, but it's true in theory.) The best example of a final class is
String, which defines a class that cannot be derived.

Does Java have "goto"?

No.

What synchronization constructs does Java provide? How do they work?

The two common features that are used are:
1. Synchronized keyword - Used to synchronize a method or a block of code. When you synchronize a method, you are in effect synchronizing the code within the method using the monitor of the current object for the lock.
The following have the same effect.
synchronized void foo() {
}
and
void foo() {
synchronized(this) {
}
If you synchronize a static method, then you are synchronizing across all objects of the same class, i.e. the monitor you are using for the lock is one per class, not one per object.
2. wait/notify. wait() needs to be called from within a synchronized block. It will first release the lock acquired from the synchronization and then wait for a signal. In Posix C, this part is equivalent to the pthread_cond_wait method, which waits for an OS signal to continue. When somebody calls notify() on the object, this will signal the code which has been waiting, and the code will continue from that point. If there are several sections of code that are in the wait state, you can call notifyAll() which will notify all threads that are waiting on the monitor for the current object. Remember that both wait() and notify() have to be called from blocks of code that are synchronized on the monitor for the current object.

Does Java have multiple inheritance?

Java does not support multiple inheritence directly but it does thru the concept of interfaces.
We can make a class implement a number of interfaces if we want to achieve multiple inheritence type of functionality of C++.

How does exception handling work in Java?

1.It separates the working/functional code from the error-handling code by way of try-catch clauses.
2.It allows a clean path for error propagation. If the called method encounters a situation it can't manage, it can throw an exception and let the calling method deal with it.
3.By enlisting the compiler to ensure that "exceptional" situations are anticipated and accounted for, it enforces powerful coding.
4.Exceptions are of two types: Compiler-enforced exceptions, or checked exceptions. Runtime exceptions, or unchecked exceptions. Compiler-enforced (checked) exceptions are instances of the Exception class or one of its subclasses — excluding the RuntimeException branch. The compiler expects all checked exceptions to be appropriately handled. Checked exceptions must be declared in the throws clause of the method throwing them — assuming, of course, they're not being caught within that same method. The calling method must take care of these exceptions by either catching or declaring them in its throws clause. Thus, making an exception checked forces the us to pay heed to the possibility of it being thrown. An example of a checked exception is java.io.IOException. As the name suggests, it throws whenever an input/output operation is abnormally terminated.

Interview Questions And Answers C,C++,JAVA,DOTNET,Oracle

What is the difference between an Applet and an Application?

A Java application is made up of a main() method declared as public static void that accepts a string array argument, along with any other classes that main() calls. It lives in the environment that the host OS provides. A Java applet is made up of at least one public class that has to be subclassed from java.awt.Applet. The applet is confined to living in the user's Web browser, and the browser's security rules, (or Sun's appletviewer, which has fewer restrictions).  The differences between an applet and an application are as follows:
1. Applets can be embedded in HTML pages and downloaded over the Internet whereas Applications have no special support in HTML for embedding or downloading.
2. Applets can only be executed inside a java compatible container, such as a browser or appletviewer whereas Applications are executed at command line by java.exe or jview.exe.
3. Applets execute under strict security limitations that disallow certain operations(sandbox model security) whereas Applications have no inherent security restrictions.
4. Applets don't have the main() method as in applications. Instead they operate on an entirely different mechanism where they are initialized by init(),started by start(),stopped by stop() or destroyed by destroy().

Java says "write once, run anywhere". What are some ways this isn't quite true?

As long as all implementaions of java are certified by sun as 100% pure java this promise of "Write once, Run everywhere" will hold true. But as soon as various java core implemenations start digressing from each other, this won't be true anymore. A recent example of a questionable business tactic is the surreptitious behavior and interface modification of some of Java's core classes in their own implementation of Java. Programmers who do not recognize these undocumented changes can build their applications expecting them to run anywhere that Java can be found, only to discover that their code works only on Microsoft's own Virtual Machine, which is only available on Microsoft's own operating systems.

What is the difference between a Vector and an Array. Discuss the advantages and disadvantages of both?

Vector can contain objects of different types whereas array can contain objects only of a single type.
- Vector can expand at run-time, while array length is fixed.
- Vector methods are synchronized while Array methods are not

What are java beans?

JavaBeans is a portable, platform-independent component model written in the Java programming language, developed in collaboration with industry leaders. It enables developers to write reusable components once and run them anywhere — benefiting from the platform-independent power of Java technology. JavaBeans acts as a Bridge between proprietary component models and provides a seamless and powerful means for developers to build components that run in ActiveX container applications. JavaBeans are usual Java classes which adhere to certain coding conventions:
1. Implements java.io.Serializable interface
2. Provides no argument constructor
3. Provides getter and setter methods for accessing it's properties

What is RMI?

RMI stands for Remote Method Invocation. Traditional approaches to executing code on other machines across a network have been confusing as well as tedious and error-prone to implement. The nicest way to think about this problem is that some object happens to live on another machine, and that you can send a message to the remote object and get a result as if the object lived on your local machine. This simplification is exactly what Java Remote Method Invocation (RMI) allows you to do. Above excerpt is from "Thinking in java". For more information refer to any book on Java.

What does the keyword "synchronize" mean in java. When do you use it? What are the disadvantages of synchronization?

Synchronize is used when you want to make your methods thread safe. The disadvantage of synchronize is it will end up in slowing down the program. Also if not handled properly it will end up in dead lock.

What gives java it's "write once and run anywhere" nature?

Java is compiled to be a byte code which is the intermediate language between source code and machine code. This byte code is not platorm specific and hence can be fed to any platform. After being fed to the JVM, which is specific to a particular operating system, the code platform specific machine code is generated thus making java platform independent.

What are native methods? How do you use them?

Native methods are methods written in other languages like C, C++, or even assembly language. You can call native methods from Java using JNI. Native methods are used when the implementation of a particular method is present in language other than Java say C, C++. To use the native methods in java we use the keyword native
public native method_a(). This native keyword is signal to the java compiler that the implementation of this method is in a language other than java. Native methods are used when we realize that it would take up a lot of rework to write that piece of already existing code in other language to Java.

What is JDBC? Describe the steps needed to execute a SQL query using JDBC.

We can connect to databases from java using JDBC. It stands for Java DataBase Connectivity.
Here are the steps:
1. Register the jdbc driver with the driver manager
2. Establish jdbc connection
3. Execute an sql statement
4. Process the results
5. Close the connection
Before doing these do import java.sql.*
JDBC is java based API for accessing data from the relational databases. JDBC provides a set of classes and interfaces for doing various database operations. The steps are:
Register/load the jdbc driver with the driver manager.
Establish the connection thru DriverManager.getConnection();
Fire a SQL thru conn.executeStatement();
Fetch the results in a result set
Process the results
Close statement/result set and connection object.

FQA Interview Questions And Answers C,C++,JAVA,DOTNET,Oracle

What is the difference between an Applet and an Application?

A Java application is made up of a main() method declared as public static void that accepts a string array argument, along with any other classes that main() calls. It lives in the environment that the host OS provides. A Java applet is made up of at least one public class that has to be subclassed from java.awt.Applet. The applet is confined to living in the user's Web browser, and the browser's security rules, (or Sun's appletviewer, which has fewer restrictions).  The differences between an applet and an application are as follows:
1. Applets can be embedded in HTML pages and downloaded over the Internet whereas Applications have no special support in HTML for embedding or downloading.
2. Applets can only be executed inside a java compatible container, such as a browser or appletviewer whereas Applications are executed at command line by java.exe or jview.exe.
3. Applets execute under strict security limitations that disallow certain operations(sandbox model security) whereas Applications have no inherent security restrictions.
4. Applets don't have the main() method as in applications. Instead they operate on an entirely different mechanism where they are initialized by init(),started by start(),stopped by stop() or destroyed by destroy().

Java says "write once, run anywhere". What are some ways this isn't quite true?

As long as all implementaions of java are certified by sun as 100% pure java this promise of "Write once, Run everywhere" will hold true. But as soon as various java core implemenations start digressing from each other, this won't be true anymore. A recent example of a questionable business tactic is the surreptitious behavior and interface modification of some of Java's core classes in their own implementation of Java. Programmers who do not recognize these undocumented changes can build their applications expecting them to run anywhere that Java can be found, only to discover that their code works only on Microsoft's own Virtual Machine, which is only available on Microsoft's own operating systems.

What is the difference between a Vector and an Array. Discuss the advantages and disadvantages of both?

Vector can contain objects of different types whereas array can contain objects only of a single type.
- Vector can expand at run-time, while array length is fixed.
- Vector methods are synchronized while Array methods are not

What are java beans?

JavaBeans is a portable, platform-independent component model written in the Java programming language, developed in collaboration with industry leaders. It enables developers to write reusable components once and run them anywhere — benefiting from the platform-independent power of Java technology. JavaBeans acts as a Bridge between proprietary component models and provides a seamless and powerful means for developers to build components that run in ActiveX container applications. JavaBeans are usual Java classes which adhere to certain coding conventions:
1. Implements java.io.Serializable interface
2. Provides no argument constructor
3. Provides getter and setter methods for accessing it's properties

What is RMI?

RMI stands for Remote Method Invocation. Traditional approaches to executing code on other machines across a network have been confusing as well as tedious and error-prone to implement. The nicest way to think about this problem is that some object happens to live on another machine, and that you can send a message to the remote object and get a result as if the object lived on your local machine. This simplification is exactly what Java Remote Method Invocation (RMI) allows you to do. Above excerpt is from "Thinking in java". For more information refer to any book on Java.

What does the keyword "synchronize" mean in java. When do you use it? What are the disadvantages of synchronization?

Synchronize is used when you want to make your methods thread safe. The disadvantage of synchronize is it will end up in slowing down the program. Also if not handled properly it will end up in dead lock.

What gives java it's "write once and run anywhere" nature?

Java is compiled to be a byte code which is the intermediate language between source code and machine code. This byte code is not platorm specific and hence can be fed to any platform. After being fed to the JVM, which is specific to a particular operating system, the code platform specific machine code is generated thus making java platform independent.

What are native methods? How do you use them?

Native methods are methods written in other languages like C, C++, or even assembly language. You can call native methods from Java using JNI. Native methods are used when the implementation of a particular method is present in language other than Java say C, C++. To use the native methods in java we use the keyword native
public native method_a(). This native keyword is signal to the java compiler that the implementation of this method is in a language other than java. Native methods are used when we realize that it would take up a lot of rework to write that piece of already existing code in other language to Java.

What is JDBC? Describe the steps needed to execute a SQL query using JDBC.

We can connect to databases from java using JDBC. It stands for Java DataBase Connectivity.
Here are the steps:
1. Register the jdbc driver with the driver manager
2. Establish jdbc connection
3. Execute an sql statement
4. Process the results
5. Close the connection
Before doing these do import java.sql.*
JDBC is java based API for accessing data from the relational databases. JDBC provides a set of classes and interfaces for doing various database operations. The steps are:
Register/load the jdbc driver with the driver manager.
Establish the connection thru DriverManager.getConnection();
Fire a SQL thru conn.executeStatement();
Fetch the results in a result set
Process the results
Close statement/result set and connection object.

Recent Interview Questions And Answers(C,C++,JAVA,DOTNET,Oracle,SAP)

What is the difference between StringBuffer and String class?

A string buffer implements a mutable sequence of characters. A string buffer is like a String, but can be modified. At any point in time it contains some particular sequence of characters, but the length and content of the sequence can be changed through certain method calls. The String class represents character strings. All string literals in Java programs, such as "abc" are constant and implemented as instances of this class; their values cannot be changed after they are created. Strings in Java are known to be immutable. What it means is that every time you need to make a change to a String variable, behind the scene, a "new" String is actually being created by the JVM. For an example: if you change your String variable 2 times, then you end up with 3 Strings: one current and 2 that are ready for garbage collection. The garbage collection cycle is quite unpredictable and these additional unwanted Strings will take up memory until that cycle occurs. For better performance, use StringBuffers for string-type data that will be reused or changed frequently. There is more overhead per class than using String, but you will end up with less overall classes and consequently consume less memory. Describe, in general, how java's garbage collector works? The Java runtime environment deletes objects when it determines that they are no longer being used. This process is known as garbage collection. The Java runtime environment supports a garbage collector that periodically frees the memory used by objects that are no longer needed. The Java garbage collector is a mark-sweep garbage collector that scans Java's dynamic memory areas for objects, marking those that are referenced. After all possible paths to objects are investigated, those objects that are not marked (i.e. are not referenced) are known to be garbage and are collected. (A more complete description of our garbage collection algorithm might be "A compacting, mark-sweep collector with some conservative scanning".) The garbage collector runs synchronously when the system runs out of memory, or in response to a request from a Java program. Your Java program can ask the garbage collector to run at any time by calling System.gc(). The garbage collector requires about 20 milliseconds to complete its task so, your program should only run the garbage collector when there will be no performance impact and the program anticipates an idle period long enough for the garbage collector to finish its job. Note: Asking the garbage collection to run does not guarantee that your objects will be garbage collected. The Java garbage collector runs asynchronously when the system is idle on systems that allow the Java runtime to note when a thread has begun and to interrupt another thread (such as Windows 95). As soon as another thread becomes active, the garbage collector is asked to get to a consistent state and then terminate.

What's the difference between == and equals method?

equals checks for the content of the string objects while == checks for the fact that the two String objects point to same memory location ie they are same references.

What are abstract classes, abstract methods?

Simply speaking a class or a method qualified with "abstract" keyword is an abstract class or abstract method. You create an abstract class when you want to manipulate a set of classes through a common interface. All derived-class methods that match the signature of the base-class declaration will be called using the dynamic binding mechanism. If you have an abstract class, objects of that class almost always have no meaning. That is, abstract class is meant to express only the interface and sometimes some default method implementations, and not a particular implementation, so creating an abstract class object makes no sense and are not allowed ( compile will give you an error message if you try to create one). An abstract method is an incomplete method. It has only a declaration and no method body. Here is the syntax for an abstract method declaration: abstract void f(); If a class contains one or more abstract methods, the class must be qualified an abstract. (Otherwise, the compiler gives you an error message.). It's possible to create a class as abstract without including any abstract methods. This is useful when you've got a class in which it doesn't make sense to have any abstract methods, and yet you want to prevent any instances of that class. Abstract classes and methods are created because they make the abstractness of a class explicit, and tell both the user and the compiler how it was intended to be used.
For example:
abstract class Instrument {
int i; // storage allocated for each
public abstract void play();
public String what() {
return "Instrument";
public abstract void adjust();
}
class Wind extends Instrument {
public void play() {
System.out.println("Wind.play()");
}
public String what() { return "Wind"; }
public void adjust() {}
Abstract classes are classes for which there can be no instances at run time. i.e. the implementation of the abstract classes are not complete. Abstract methods are methods which have no defintion. i.e. abstract methods have to be implemented in one of the sub classes or else that class will also become Abstract.

Recent Interview Questions And Answers(C,C++,JAVA,DOTNET,Oracle,SAP)

What is the difference between StringBuffer and String class?

A string buffer implements a mutable sequence of characters. A string buffer is like a String, but can be modified. At any point in time it contains some particular sequence of characters, but the length and content of the sequence can be changed through certain method calls. The String class represents character strings. All string literals in Java programs, such as "abc" are constant and implemented as instances of this class; their values cannot be changed after they are created. Strings in Java are known to be immutable. What it means is that every time you need to make a change to a String variable, behind the scene, a "new" String is actually being created by the JVM. For an example: if you change your String variable 2 times, then you end up with 3 Strings: one current and 2 that are ready for garbage collection. The garbage collection cycle is quite unpredictable and these additional unwanted Strings will take up memory until that cycle occurs. For better performance, use StringBuffers for string-type data that will be reused or changed frequently. There is more overhead per class than using String, but you will end up with less overall classes and consequently consume less memory. Describe, in general, how java's garbage collector works? The Java runtime environment deletes objects when it determines that they are no longer being used. This process is known as garbage collection. The Java runtime environment supports a garbage collector that periodically frees the memory used by objects that are no longer needed. The Java garbage collector is a mark-sweep garbage collector that scans Java's dynamic memory areas for objects, marking those that are referenced. After all possible paths to objects are investigated, those objects that are not marked (i.e. are not referenced) are known to be garbage and are collected. (A more complete description of our garbage collection algorithm might be "A compacting, mark-sweep collector with some conservative scanning".) The garbage collector runs synchronously when the system runs out of memory, or in response to a request from a Java program. Your Java program can ask the garbage collector to run at any time by calling System.gc(). The garbage collector requires about 20 milliseconds to complete its task so, your program should only run the garbage collector when there will be no performance impact and the program anticipates an idle period long enough for the garbage collector to finish its job. Note: Asking the garbage collection to run does not guarantee that your objects will be garbage collected. The Java garbage collector runs asynchronously when the system is idle on systems that allow the Java runtime to note when a thread has begun and to interrupt another thread (such as Windows 95). As soon as another thread becomes active, the garbage collector is asked to get to a consistent state and then terminate.

What's the difference between == and equals method?

equals checks for the content of the string objects while == checks for the fact that the two String objects point to same memory location ie they are same references.

What are abstract classes, abstract methods?

Simply speaking a class or a method qualified with "abstract" keyword is an abstract class or abstract method. You create an abstract class when you want to manipulate a set of classes through a common interface. All derived-class methods that match the signature of the base-class declaration will be called using the dynamic binding mechanism. If you have an abstract class, objects of that class almost always have no meaning. That is, abstract class is meant to express only the interface and sometimes some default method implementations, and not a particular implementation, so creating an abstract class object makes no sense and are not allowed ( compile will give you an error message if you try to create one). An abstract method is an incomplete method. It has only a declaration and no method body. Here is the syntax for an abstract method declaration: abstract void f(); If a class contains one or more abstract methods, the class must be qualified an abstract. (Otherwise, the compiler gives you an error message.). It's possible to create a class as abstract without including any abstract methods. This is useful when you've got a class in which it doesn't make sense to have any abstract methods, and yet you want to prevent any instances of that class. Abstract classes and methods are created because they make the abstractness of a class explicit, and tell both the user and the compiler how it was intended to be used.
For example:
abstract class Instrument {
int i; // storage allocated for each
public abstract void play();
public String what() {
return "Instrument";
public abstract void adjust();
}
class Wind extends Instrument {
public void play() {
System.out.println("Wind.play()");
}
public String what() { return "Wind"; }
public void adjust() {}
Abstract classes are classes for which there can be no instances at run time. i.e. the implementation of the abstract classes are not complete. Abstract methods are methods which have no defintion. i.e. abstract methods have to be implemented in one of the sub classes or else that class will also become Abstract.

C C++,Java,RDBMS,Data Structures,OS,Unix,Linux

How can you achieve Multiple Inheritance in Java?

Java's interface mechanism can be used to implement multiple inheritance, with one important difference from c++ way of doing MI: the inherited interfaces must be abstract. This obviates the need to choose between different implementations, as with interfaces there are no implementations.

interface CanFight {
void fight();
interface CanSwim {
void swim();
interface CanFly {
void fly();
class ActionCharacter {
public void fight() {}
class Hero extends ActionCharacter implements CanFight, CanSwim, CanFly {
public void swim() {}
public void fly() {}
}

You can even achieve a form of multiple inheritance where you can use the *functionality* of classes rather than just the interface:

interface A {
void methodA();
}
class AImpl implements A {
void methodA() { //do stuff }
}
interface B {
void methodB();
}
class BImpl implements B {
void methodB() { //do stuff }
}
class Multiple implements A, B {
private A a = new A();
private B b = new B();
void methodA() { a.methodA(); }
void methodB() { b.methodB(); }
}
This completely solves the traditional problems of multiple inheritance in C++ where name clashes occur between multiple base classes. The coder of the derived class will have to explicitly resolve any clashes. Don't you hate people who point out minor typos? Everything in the previous example is correct, except you need to instantiate an AImpl and BImpl. So class Multiple would look like this:
class Multiple implements A, B {
private A a = new AImpl();
private B b = new BImpl();
void methodA() { a.methodA(); }
void methodB() { b.methodB(); }
}

C C++,Java,RDBMS,Data Structures,OS,Unix,Linux

How can you achieve Multiple Inheritance in Java?

Java's interface mechanism can be used to implement multiple inheritance, with one important difference from c++ way of doing MI: the inherited interfaces must be abstract. This obviates the need to choose between different implementations, as with interfaces there are no implementations.

interface CanFight {
void fight();
interface CanSwim {
void swim();
interface CanFly {
void fly();
class ActionCharacter {
public void fight() {}
class Hero extends ActionCharacter implements CanFight, CanSwim, CanFly {
public void swim() {}
public void fly() {}
}

You can even achieve a form of multiple inheritance where you can use the *functionality* of classes rather than just the interface:

interface A {
void methodA();
}
class AImpl implements A {
void methodA() { //do stuff }
}
interface B {
void methodB();
}
class BImpl implements B {
void methodB() { //do stuff }
}
class Multiple implements A, B {
private A a = new A();
private B b = new B();
void methodA() { a.methodA(); }
void methodB() { b.methodB(); }
}
This completely solves the traditional problems of multiple inheritance in C++ where name clashes occur between multiple base classes. The coder of the derived class will have to explicitly resolve any clashes. Don't you hate people who point out minor typos? Everything in the previous example is correct, except you need to instantiate an AImpl and BImpl. So class Multiple would look like this:
class Multiple implements A, B {
private A a = new AImpl();
private B b = new BImpl();
void methodA() { a.methodA(); }
void methodB() { b.methodB(); }
}

Java and C++ interview questions Papers

What are the main differences between Java and C++?

Everything is an object in Java( Single root hierarchy as everything gets derived from java.lang.Object). Java does not have all the complicated aspects of C++ ( For ex: Pointers, templates, unions, operator overloading, structures etc..)  The Java language promoters initially said "No pointers!", but when many programmers questioned how you can work without pointers, the promoters began saying "Restricted pointers." You can make up your mind whether it's really a pointer or not. In any event, there's no pointer arithmetic. There are no destructors in Java. (automatic garbage collection),  Java does not support conditional compile (#ifdef/#ifndef type). Thread support is built into java but not in C++. Java does not support default arguments. There's no scope resolution operator :: in Java. Java uses the dot for everything, but can get away with it since you can define elements only within a class. Even the method definitions must always occur within a class, so there is no need for scope resolution there either. There's no "goto " statement in Java. Java doesn't provide multiple inheritance (MI), at least not in the same sense that C++ does. Exception handling in Java is different because there are no destructors. Java has method overloading, but no operator overloading. The String class does use the + and += operators to concatenate strings and String expressions use automatic type conversion, but that's a special built-in case. Java is interpreted for the most part and hence platform independent

What are interfaces?

Interfaces provide more sophisticated ways to organize and control the objects in your system.
The interface keyword takes the abstract concept one step further. You could think of it as a "pure" abstract class. It allows the creator to establish the form for a class: method names, argument lists, and return types, but no method bodies. An interface can also contain fields, but The interface keyword takes the abstract concept one step further. You could think of it as a "pure" abstract class. It allows the creator to establish the form for a class: method names, argument lists, and return types, but no method bodies. An interface can also contain fields, but an interface says: "This is what all classes that implement this particular interface will look like." Thus, any code that uses a particular interface knows what methods might be called for that interface, and that's all. So the interface is used to establish a "protocol" between classes. (Some object-oriented programming languages have a keyword called protocol to do the same thing.)  Typical example from "Thinking in Java":

import java.util.*;
interface Instrument {
int i = 5; // static & final
// Cannot have method definitions:
void play(); // Automatically public
String what();
void adjust();
}
class Wind implements Instrument {
public void play() {
System.out.println("Wind.play()");
public String what() { return "Wind"; }
public void adjust() {}
}

Latest C C++ Java interview questions

Describe what happens when an object is created in Java?

Several things happen in a particular order to ensure the object is constructed properly:
1. Memory is allocated from heap to hold all instance variables and implementation-specific data of the object and its superclasses. Implementation-specific data includes pointers to class and method data.
2. The instance variables of the objects are initialized to their default values.
3. The constructor for the most derived class is invoked. The first thing a constructor does is call the constructor for its uppercase. This process continues until the constructor for java.lang.Object is called, as java.lang.Object is the base class for all objects in java.
4. Before the body of the constructor is executed, all instance variable initializers and initialization blocks are executed. Then the body of the constructor is executed. Thus, the constructor for the base class completes first and constructor for the most derived class completes last.

In Java, you can create a String object as below : String str = "abc"; & String str = new String("abc");  Why cant a button object be created as : Button bt = "abc"? Why is it compulsory to create a button object as: Button bt = new Button("abc"); Why this is not compulsory in String's case?

Button bt1= "abc"; It is because "abc" is a literal string (something slightly different than a String object, by-the-way) and bt1 is a Button object. That simple. The only object in Java that can be assigned a literal String is java.lang.String. Important to not that you are NOT calling a java.lang.String constuctor when you type String s = "abc"; For example String x = "abc"; String y = "abc"; refer to the same object. While String x1 = new String("abc");
String x2 = new String("abc"); refer to two different objects.

What is the advantage of OOP?

You will get varying answers to this question depending on whom you ask. Major advantages of OOP are:
1. Simplicity: software objects model real world objects, so the complexity is reduced and the program structure is very clear;
2. Modularity: each object forms a separate entity whose internal workings are decoupled from other parts of the system;
3. Modifiability: it is easy to make minor changes in the data representation or the procedures in an OO program. Changes inside a class do not affect any other part of a program, since the only public interface that the external world has to a class is through the use of methods;
4. Extensibility: adding new features or responding to changing operating environments can be solved by introducing a few new objects and modifying some existing ones;
5. Maintainability: objects can be maintained separately, making locating and fixing problems easier;
6. Re-usability: objects can be reused in different programs

Recent SQL interview questions

  1. What are two methods of retrieving SQL?
  2. What cursor type do you use to retrieve multiple recordsets?
  3. What is the difference between a "where" clause and a "having" clause? - "Where" is a kind of restiriction statement. You use where clause to restrict all the data from DB.Where clause is using before result retrieving. But Having clause is using after retrieving the data.Having clause is a kind of filtering command.
  4. What is the basic form of a SQL statement to read data out of a table? The basic form to read data out of table is 'SELECT * FROM table_name; ' An answer: 'SELECT * FROM table_name WHERE xyz= 'whatever';' cannot be called basic form because of WHERE clause.

  5. What structure can you implement for the database to speed up table reads? - Follow the rules of DB tuning we have to: 1] properly use indexes ( different types of indexes) 2] properly locate different DB objects across different tablespaces, files and so on.3] create a special space (tablespace) to locate some of the data with special datatype ( for example CLOB, LOB and …)
  6. What are the tradeoffs with having indexes? - 1. Faster selects, slower updates. 2. Extra storage space to store indexes. Updates are slower because in addition to updating the table you have to update the index.
  7. What is a "join"? - 'join' used to connect two or more tables logically with or without common field.
  8. What is "normalization"? "Denormalization"? Why do you sometimes want to denormalize? - Normalizing data means eliminating redundant information from a table and organizing the data so that future changes to the table are easier. Denormalization means allowing redundancy in a table. The main benefit of denormalization is improved performance with simplified data retrieval and manipulation. This is done by reduction in the number of joins needed for data processing.
  9. What is a "constraint"? - A constraint allows you to apply simple referential integrity checks to a table. There are four primary types of constraints that are currently supported by SQL Server: PRIMARY/UNIQUE - enforces uniqueness of a particular table column. DEFAULT - specifies a default value for a column in case an insert operation does not provide one. FOREIGN KEY - validates that every value in a column exists in a column of another table. CHECK - checks that every value stored in a column is in some specified list. Each type of constraint performs a specific type of action. Default is not a constraint. NOT NULL is one more constraint which does not allow values in the specific column to be null. And also it the only constraint which is not a table level constraint.
  10. What types of index data structures can you have? - An index helps to faster search values in tables. The three most commonly used index-types are: - B-Tree: builds a tree of possible values with a list of row IDs that have the leaf value. Needs a lot of space and is the default index type for most databases. - Bitmap: string of bits for each possible value of the column. Each bit string has one bit for each row. Needs only few space and is very fast.(however, domain of value cannot be large, e.g. SEX(m,f); degree(BS,MS,PHD) - Hash: A hashing algorithm is used to assign a set of characters to represent a text string such as a composite of keys or partial keys, and compresses the underlying data. Takes longer to build and is supported by relatively few databases.
  11. What is a "primary key"? - A PRIMARY INDEX or PRIMARY KEY is something which comes mainly from
    database theory. From its behavior is almost the same as an UNIQUE INDEX, i.e. there may only be one of each value in this column. If you call such an INDEX PRIMARY instead of UNIQUE, you say something about
    your table design, which I am not able to explain in few words. Primary Key is a type of a constraint enforcing uniqueness and data integrity for each row of a table. All columns participating in a primary key constraint must possess the NOT NULL property.
  12. What is a "functional dependency"? How does it relate to database table design? - Functional dependency relates to how one object depends upon the other in the database. for example, procedure/function sp2 may be called by procedure sp1. Then we say that sp1 has functional dependency on sp2.
  13. What is a "trigger"? - Triggers are stored procedures created in order to enforce integrity rules in a database. A trigger is executed every time a data-modification operation occurs (i.e., insert, update or delete). Triggers are executed automatically on occurance of one of the data-modification operations. A trigger is a database object directly associated with a particular table. It fires whenever a specific statement/type of statement is issued against that table. The types of statements are insert,update,delete and query statements. Basically, trigger is a set of SQL statements A trigger is a solution to the restrictions of a constraint. For instance: 1.A database column cannot carry PSEUDO columns as criteria where a trigger can. 2. A database constraint cannot refer old and new values for a row where a trigger can.
  14. Why can a "group by" or "order by" clause be expensive to process? - Processing of "group by" or "order by" clause often requires creation of Temporary tables to process the results of the query. Which depending of the result set can be very expensive.
  15. What is "index covering" of a query? - Index covering means that "Data can be found only using indexes, without touching the tables"
  16. What types of join algorithms can you have?
  17. What is a SQL view? - An output of a query can be stored as a view. View acts like small table which meets our criterion. View is a precomplied SQL query which is used to select data from one or more tables. A view is like a table but it doesn't physically take any space. View is a good way to present data in a particular format if you use that query quite often. View can also be used to restrict users from accessing the tables directly.

TOP ASP.NET interview questions

  1. Describe the difference between a Thread and a Process?
  2. What is a Windows Service and how does its lifecycle differ from a "standard" EXE?
  3. What is the maximum amount of memory any single process on Windows can address? Is this different than the maximum virtual memory for the system? How would this affect a system design?
  4. What is the difference between an EXE and a DLL?
  5. What is strong-typing versus weak-typing? Which is preferred? Why?
  6. What's wrong with a line like this? DateTime.Parse(myString
  7. What are PDBs? Where must they be located for debugging to work?
  8. What is cyclomatic complexity and why is it important?
  9. Write a standard lock() plus double check to create a critical section around a variable access.
  10. What is FullTrust? Do GAC'ed assemblies have FullTrust?
  11. What benefit does your code receive if you decorate it with attributes demanding specific Security permissions?
  12. What does this do? gacutil /l | find /i "about"
  13. What does this do? sn -t foo.dll
  14. What ports must be open for DCOM over a firewall? What is the purpose of Port 135?
  15. Contrast OOP and SOA. What are tenets of each
  16. How does the XmlSerializer work? What ACL permissions does a process using it require?
  17. Why is catch(Exception) almost always a bad idea?
  18. What is the difference between Debug.Write and Trace.Write? When should each be used?
  19. What is the difference between a Debug and Release build? Is there a significant speed difference? Why or why not?
  20. Does JITting occur per-assembly or per-method? How does this affect the working set?
  21. Contrast the use of an abstract base class against an interface?
  22. What is the difference between a.Equals(b) and a == b?
  23. In the context of a comparison, what is object identity versus object equivalence?
  24. How would one do a deep copy in .NET?
  25. Explain current thinking around IClonable.
  26. What is boxing?
  27. Is string a value type or a reference type?

Saturday, August 2, 2008

Placement Paperon 15th march 2008

Hello frends... this is Sonali Jindal
Written test was held on 15th march 2008
Recruitment process-->
1)Written test
2)Group discussion
3)HR interview
4)Technical inteview
1) Written test
English (easy). this section includes prepositions, synonyms, etc. u need not prepare anythin 4 this section. it's just, whtever english u hav learnt in ur life. Then comes the passage reading part. u wil b given 2 comprehension passages(easy). on the basis of these passages u hav 2 answer the questions. its very TIME CONSUMING. my suggestion wud b read them in the end.
Analytical ability . u must prepare wel 4 this sections. go for Quantitave RS Aggarwal(best buk). don leav chapters like average, time and work, percentage, profit loss, etc. my suggestion wud b 2 study almost all the chapters there in the buk.
Attention to detail(very easy). no need 2 prepare anythin. just needs concentration. u wil b given 3 options wich r very similar 2 each other. u hav 2 find whether they all r exactly same or 2 of them r same or none. 4 example- JJJJEEESCHG JJJJEESCHG JJJJEEESCHG
Then also there r some questions like 0 means * and 1 means $... Thus u hav 2 calculate ($*$)x$**.... (Dont remember exactly). these questions r easy but again TIME CONSUMING. so do them in the end. also questions like if * stands for +, / stands for *, + stands for - and - stands for / then calculate 20/2*2+20-5.
Essay. In 10min u hav 2 write an essay(around 100words). i don think essays r chekd, rest don know. essay topic was "Education system in india".
All in all written test is easy.. but u really need 2 take care of TIME. In the last 5min... i was stil left wit 2 passages and + stands for - type questions. i was so tensed. then first i started reading the questions in the passage an then lookin 4 answers in the passage. i managed 2 do 3-4 questions. then 2min were left,an no time 2 solve questions or read another passgae so i just ticked the left over options. so i blindly attempted 12-15 questions(no negative marking). wen i came out of the room, i was sad that i cudnt read passages neither i cud solve some questions. but i think i did rite by leavin passages 4 the end. bcoz i cud attempt quantitave part. wich other students cudnt. Out of around 5000 students, 600 students cud clear the written test.
2) Group discussion(held on 12 april)
This is an elimination round. many people say it's the most difficult round, but it is not. All u need 2 do is be LOUD and clear. the moderator shud hear ur voice. there were 15 students in 1 grup. an the modertaor askd us 2 choose a topic. but he gav his own topic. my topic was "Role of media". amongst the 15students only 2(includin me) were against the role of media. i said that media is very important so as 2 make people aware abt whts happenin around u, but 2day media is not playin its role properly as it is entering into people's personal lives(kareena an shahid case)....bla bla....
To be different in crowd sometimes u hav 2 be against all the students, aftr all u hav 2 come in limelight. also this helps in carryin on the GD, bcoz if every1 wud hav the same thots then... GD wont continue as no one is against anyone. i read somewhere tht u shud try 2 initiate the gd. i did not initiate, but i was the 2nd person 2 speak. and if u want 2 initiate the GD, make a STRONG point. by just starting u wont get thru. in my grup the person who initiated dint get thru, coz he dint hav strong point an also he dint say a single word aftrwards. try 2 speak in the beginning coz later u mite not get chance 2 speak as it becomes a fish market. its a gud point if u try 2 calm every1. In GD only speakin is not important, u must listen also. there was one student who spoke a alot but dint let others speak. so he was not selectd. also don't point finger or aggressive, u wont get selectd. wenevr u want 2 speak, raise ur hand.. this shows courtsy.
other GD topics were Cinema, Black, Tea or coffee, Reservation.
Around 300 students were elimintaed.
3) HR interview
one can hav HR interview 1st or Tech interview 1st. in my case HR first. my interview went GREAT!! this round is very easy 2 get thru. u need 2 qualitites..GOOD COMMUNICATION SKILLS and CONFIDENCE. don think u cannot get rejectd in this round. if u don hav either of these 2 qualities.. u r out.
4) Tech Interview
pheeewww...!!! last round. being a computer science student u must knw C++ and DBMS. if he asks abt ur project and u don knw much abt it then speak abt ur project continuously so tht u don stop, in fact he asks u 2 stop. make him sure that u knw everythin abt ur project, so tht he doesnt asks u any further questions on project. he mite ask u ur favourite subject. Prepare ur subject wel.
he askd me:- wich languages u knw?
me:- C++ but i hav interst in DBMS also (as i dint want him 2 ask me on c++)
He:- wich database u hav been workin on?
Me:- sql server 2005
He:- wht do u do on tht?
Me:- fire simple queries.. learnin in colg thz days.. i knw basics (i wantd him 2 ask me basics an not RDBMS--cursors, triggers, etc)
He:- askd me 2 rite select command syntax, all operators, some functions, an gave me one query in wich i had 2 tel whether it was correct or not.
Me:- i gav all answers, but got stuck a lil in the last question in wich i had 2 tel it's corrct or not.
He:- Ok. any queries regardin accenture??
Me:- i askd 2-3 questions, wich intimated me tht perhaps i m in..
So finally i made it. i was so happy.. so relieved. 100 students(round of) finally cleard. i had sat in Wipro, but cudnt clear tech round. an now this company was my next target. Just take care tht if u clear written.. don let the company go off ur hands. coz 2 clear written amongst 1000s is very difficult. an also DON loose hope. If not this company then may b next. "somethin better is waitin 4 u.." and yes LUCK matters alotttttt. u mite come across some strict interviewer, or u mite not hav come in the site of moderator durin GD. LUCK PLAYS A BIG ROLE.
anyways gudluk..!!!! never loose hope :)

           

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 ?