Thursday, January 28, 2010

IT Fundamental-IV

1. A group of interrelated or interacting elements forming a unified whole can be best defined as:
a. Communication technologies.
b. An information system.
c. A company network.
d. Interorganizational system.

2. The majority of organizations today would be classified as:
a. Open nonadaptive systems.
b. Closed nonadaptive systems.
c. Open adaptive systems.
d. Closed adaptive systems.

3. Which one of the following would NOT be considered a good example of information?
a. The company's forklift operator's social security number is 456-38-1276.
b. The retail price of blue widgets is $28.99.
c. The company owes $3,847 to vendor number 10782.
d. The numbers 12367892, 436897458, and 837621984.

4. In the internetworked e-business enterprise, an extranet refers to:
a. A network inside the enterprise.
b. A network between an enterprise and its trading partners.
c. A local area network within the enterprise.
d. A wide area network within the enterprise.

5. A manager needs to have summary sales information by product line available to her on a timely basis when purchasing decisions need to be made. The type of information system most likely to provide this information is a:
a. Management information system.
b. Decision support system.
c. Transaction processing system.
d. Process control system.

6. A physician wants an information system that can help in the diagnosis of rare diseases by suggesting diagnostic procedures and help in interpreting the symptoms that are found. This type of information system is called a(n):
a. End user information system.
b. Integrated information system.
c. Executive information system.
d. Expert system.

7. Developing new products and services that are fundamentally different from the way business has been conducted in an industry would be considered a(n):
a. Cost leadership strategy.
b. Innovation strategy.
c. Product differentiation strategy.
d. Strategic dominance strategy.

8. Establishing new business linkages and alliances with customers, suppliers, and competitors is an example of a(n):
a. Alliance strategy.
b. Differentiation strategy.
c. Innovation strategy.
d. Gowth strategy.

9. Charles Schwab & Company's use of online discount stock trading is an example of the way in which a firm can use strategic information system technology. Their primary competitive strategy was to:
a. Establish cost leadership.
b. Improve operational efficiency.
c. Promote business innovation.
d. Build strategic information resources.

10. The value chain views a series, chain, or network of basic activities that add value to products and services. One of the primary activities in a firm's "value chain" typically includes:
a. Outbound logistics.
b. Procurement of resources.
c. Human resource management.
d. Technology development.

Saturday, January 16, 2010

Points about OOPS

1. Abstraction is the process of highlighting the essential, inherent aspects of an entity while ignoring irrelevant details.
2. Encapsulation (or information hiding) is the process of separating the external aspects of an objects from the internal implementation details which should be hidden from other objects.
3. Modularity is the process of dividing a problem into smaller pieces so that each smaller module can be dealt with individually.
4. Organizing a set of abstractions from most general to least is known as inheritance hierarchy.
5. Object-oriented programming is a paradigm in which a system is modeled as a set of objects that interact with each other.
6. In C++ an abstraction is formed by creating a class. A class encapsulates the attributes and behaviors of an object.
7. The data members of a class represent the attributes of a class. And the member functions of a class represents the behaviors of a class.
8. Polymorphism is the capability of something to assumediferent forms. In an object-oriented language, polymorphism is provided by allowing a message or member function to mean different things depending on the type of object that receives the message.
9. All C++ program begin executing from the main. Function main returns an integer value that indicates whether the program executed successfullly or not. A value of ) indicates successful execution, while the value 1 indicates that a problem or error occurred during the execution of the program.
10. A variable must be defined before it can be used. Smart programmers give a variable an initial value when it is defined.
11. A pointer is a variable whose value is the address of another variable.
12. Pointers should be different type for each type of variable. There are even pointer types whose variable are pointers to other pointers.
13. The location of a variable can be obtained using the address operator &.
14. Pointer operators may be compared using the equality and relational operators.
15. The increment and decrement operators may be applied to pointer objects.
16. Pointers can be passed as reference parameters by using the indirection operator.
17. Command-line parameters are communicated to programs using pointers.
18. We can define variables that are pointers to functions. Such variables are typically used as function parameters. This type of parameter enables the function that uses it to have greater flexibility in accomplishing its task.
19. A reference variable must be initialized when it is declared.
20. When a reference parameter is used, instead of passing a copy of the variable, a reference to the original variable is passed. Any modifications made to the parameter by the called function change the original variable.
21. A reason to use reference parameter is for efficiency. When a class object is passed by value, a copy of the object is passed. If the object is large, making a copy of it can be expensive in terms of execution time and memory space. thus, objects that are large, or objects whose size is not known are often passed by reference. We can ensure that the objects are not modified by using the const modifier.
22. Constructors initialize objects of the class type. It is standard practice to ensure that every object has all of its data members appropriately initializes.
23. A default constructor is a constructor that requires no parameters.
24. A copy constructor initialize a new object to be a duplicate of a previously defined source object. If a class does not define a copy constructor, the compiler automatically supplies version.
25. A class constructor, if defined, is called whenever a program creates an object of that class.
26. An inline function must be defined before it is called.
27. An inline function reduces the function call overhead. Small functions are best declared inline within a class.

Thursday, January 14, 2010

Database System-III

1. What is a "primary key"?
Ans : 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.

2. What is a "functional dependency"? How does it relate to database table design?
Ans : 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.

3. What is a "trigger"?
Ans : 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.

4. Why can a "group by" or "order by" clause be expensive to process?
Ans : 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.

5. What is "index covering" of a query?
Ans : Index covering means that "Data can be found only using indexes, without touching the tables"


6. What is a SQL view?
Ans : 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.


7. What are two methods of retrieving SQL?
Ans : Use SELECT Query and Projection Relational Algebra to retrieve SQL.


8. What cursor type do you use to retrieve multiple recordsets?
Ans : Explicit Cursor has been used to retrieve multiple records at a time.


9. What types of join algorithms can you have?
Ans : Natural Join, Equi Join, Inner Join, Outer Join (Left Outer Join ,Right Outer Join, Full Outer Join), Cross Join, Self Join, etc.

Database System-II

1. What is the difference between a "where" clause and a "having" clause?
Ans : "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.

2. What is the basic form of a SQL statement to read data out of a table?
Ans : 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.

3. What structure can you implement for the database to speed up table reads?
Ans :  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 …)
4. What are the tradeoffs with having indexes?
Ans : 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.

5. What is a "join"?
Ans : ‘join’ used to connect two or more tables logically with or without common field.

6. What is "normalization"?
Ans : "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.

7. What is a "constraint"?
Ans : 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.

8. What types of index data structures can you have?
Ans :  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.

Tuesday, January 12, 2010

Java Fundmental-VII

1. Do I need to use synchronized on setValue(int)?
Ans : It depends whether the method affects method local variables, class static or instance variables. If only method local variables are changed, the value is said to be confined by the method and is not prone to threading issues.
2. Do I need to use synchronized on setValue(int)?
Ans : It depends whether the method affects method local variables, class static or instance variables. If only method local variables are changed, the value is said to be confined by the method and is not prone to threading issues.
3. What is the SwingUtilities.invokeLater(Runnable) method for?
Ans : The static utility method invokeLater(Runnable) is intended to execute a new runnable thread from a Swing application without disturbing the normal sequence of event dispatching from the Graphical User Interface (GUI). The method places the runnable object in the queue of Abstract Windowing Toolkit (AWT) events that are due to be processed and returns immediately. The runnable objectâۉ„¢s run() method is only called when it reaches the front of the queue. The deferred effect of the invokeLater(Runnable) method ensures that any necessary updates to the user interface can occur immediately, and the runnable work will begin as soon as those high priority events are dealt with. The invoke later method might be used to start work in response to a button click that also requires a significant change to the user interface, perhaps to restrict other activities, while the runnable thread executes.
4. What is the volatile modifier for?
Ans : The volatile modifier is used to identify variables whose values should not be optimized by the Java Virtual Machine, by caching the value for example. The volatile modifier is typically used for variables that may be accessed or modified by numerous independent threads and signifies that the value may change without synchronization.
5. Which class is the wait() method defined in?
Ans : The wait() method is defined in the Object class, which is the ultimate superclass of all others. So the Thread class and any Runnable implementation inherit this method from Object. The wait() method is normally called on an object in a multi-threaded program to allow other threads to run. The method should should only be called by a thread that has ownership of the objectâۉ„¢s monitor, which usually means it is in a synchronized method or statement block.
6. Which class is the wait() method defined in?
Ans : I get incompatible return type for my threadâۉ„¢s getState( ) method! - It sounds like your application was built for a Java software development kit before Java 1.5. The Java API Thread class method getState() was introduced in version 1.5. Your thread method has the same name but different return type. The compiler assumes your application code is attempting to override the API method with a different return type, which is not allowed, hence the compilation error.
7. What is a working thread?
Ans : A working thread, more commonly known as a worker thread is the key part of a design pattern that allocates one thread to execute one task. When the task is complete, the thread may return to a thread pool for later use. In this scheme a thread may execute arbitrary tasks, which are passed in the form of a Runnable method argument, typically execute(Runnable). The runnable tasks are usually stored in a queue until a thread host is available to run them. The worker thread design pattern is usually used to handle many concurrent tasks where it is not important which finishes first and no single task needs to be coordinated with another. The task queue controls how many threads run concurrently to improve the overall performance of the system. However, a worker thread framework requires relatively complex programming to set up, so should not be used where simpler threading techniques can achieve similar results.
8. What is a green thread?
Ans : A green thread refers to a mode of operation for the Java Virtual Machine (JVM) in which all code is executed in a single operating system thread. If the Java program has any concurrent threads, the JVM manages multi-threading internally rather than using other operating system threads. There is a significant processing overhead for the JVM to keep track of thread states and swap between them, so green thread mode has been deprecated and removed from more recent Java implementations. Current JVM implementations make more efficient use of native operating system threads.
9. What are native operating system threads?
Ans : Native operating system threads are those provided by the computer operating system that plays host to a Java application, be it Windows, Mac or GNU/Linux. Operating system threads enable computers to run many programs simultaneously on the same central processing unit (CPU) without clashing over the use of system resources or spending lots of time running one program at the expense of another. Operating system thread management is usually optimised to specific microprocessor architecture and features so that it operates much faster than Java green thread processing.

Monday, January 11, 2010

Java Fundmental-II

1. The Java language is:
a. Interpreted at run time.
b. Compiled to obtain executable target files.
c. Designed for recursive string processing.
d. Designed for matrix algorithm processing.

2. The Java language is designed to:
a. Run on a simulated Java machine.
b. Run directly on Intel microprocessors.
c. Designed for RISC computing architectures.
d. Designed for CISC computing architectures.

3. The Java language will run:
a. On any computer where the Java simulated machine is installed.
b. On any computer attached to the Internet.
c. On any computer with a Web browser installed.
d. On any computer which will also run C++.

4. The Java language provides the programmer with:
a. No ability to access or manipulate memory.
b. Protected access to machine memory.
c. Dynamically created data structures linked with pointers.
d. Access to the memory of a local machine through a network.

5. The Java language is:
a. An object oriented programming language.
b. A structured programming language.
c. A procedural programming language.
d. A stack oriented programming language.

6. The Java language was designed:
a. To create event driven programs with graphical interfaces.
b. To unify all different approaches to object orientation.
c. To provide a learning tool for beginning programmers.
d. To force programmers to implement all needed program elements themselves.

7. The Java language has most in common with the following language:
a. C#.                      b. C.                  c. C++.                 d. Basic.
8. The basis for object oriented programming can be found in which of the following?
a. All of the items listed.
b. It is an outgrowth of the availability of powerful hardware.
c. It is useful in the development of graphical user interfaces.
d. It solved some of the problems associated with structured programming.

9. That unit of code in Java that contains the specifications for objects is:
a. A class.          b. A method.         c. An instance variable.      d. A constructor.

10. Which of the following is true?
a. An object receives copies of all instance variables, but shares method code.
b. An object receives copies of all instance variables and all methods.
c. An object receives copies of all methods, but shares instance variables.
d. An object shares both instance variables and methods with other objects.

11. Encapsulation refers to the idea that:
a. Instance variables can only be accessed by means of methods.
b. Methods can only be accessed by means of instance variables.
c. All other methods must be defined within the main() method.
d. Instance variables can only be declared within methods.

12. In order to use objects of a given class the programmer needs to:
a. Know what the methods do, but not how they do it.
b. Know all of the instance variables of the class.
c. Know how the method algorithms were implemented.
d. Know the types of all of the instance variables of the class.

13. Java programs have to be saved with the following extension:
a. .java               b. .txt           c. .doc             d. .xls

14. In Java programs, the name of the class has to:
a. Be the same as the name of the file it is saved in.
b. Be different from the name of the file it is saved in.
c. Be all capital letters.
d. Be all small letters.

Friday, January 01, 2010

Java Fundamental-VI

1. What is the purpose of finalization?
The purpose of finalization is to give an unreachable object the opportunity to perform any cleanup processing before the object is garbage collected.


2. What is the difference between the Boolean & operator and the && operator?
- If an expression involving the Boolean & operator is evaluated, both operands are evaluated. Then the & operator is applied to the operand. When an expression involving the && operator is evaluated, the first operand is evaluated. If the first operand returns a value of true then the second operand is evaluated. The && operator is then applied to the first and second operands. If the first operand evaluates to false, the evaluation of the second operand is skipped.


3. How many times may an object's finalize() method be invoked by the garbage collector?
An object's finalize() method may only be invoked once by the garbage collector.


4. What is the purpose of the finally clause of a try-catch-finally statement?
The finally clause is used to provide the capability to execute code no matter whether or not an exception is thrown or caught.


5. What is the argument type of a program s main() method?
A program's main() method takes an argument of the String[] type.


6. Which Java operator is right associative?
The = operator is right associative.


7. Can a double value be cast to a byte?
Yes, a double value can be cast to a byte.


8. What is the difference between a break statement and a continue statement?
A break statement results in the termination of the statement to which it applies (switch, for, do, or while). A continue statement is used to end the current loop iteration and return control to the loop statement.


9. What must a class do to implement an interface?
It must provide all of the methods in the interface and identify the interface in its implements clause.


10. What is the advantage of the event-delegation model over the earlier event-inheritance model?
The event-delegation model has two advantages over the event-inheritance model. First, it enables event handling to be handled by objects other than the ones that generate the events (or their containers). This allows a clean separation between a component s design and its use. The other advantage of the event-delegation model is that it performs much better in applications where many events are generated. This performance improvement is due to the fact that the event-delegation model does not have to repeatedly process unhandled events, as is the case of the event-inheritance model.

Search Aptipedia