Pages

Wednesday, July 21, 2010

Difference b/w Aim & Objectives

- Aims are actually Goals which you set for yourself in life.
- Objectives are the measures which you Undertaken to achieve your Aims.


In Short
Aims are what you want to achieve, Objectives are what you will do to achieve them.
So, an Aim would be the overall thing you want to eventually achieve.
-------------

A Goal is something you work toward, a setpoint.
An Aim is a focal point, something to keep your eye on.
An Objective is a more strategic goal, and usually indicates more planning or organization

Friday, June 18, 2010

p-7





Answer : D
Explanation : The number of black dots in each grid increases by 1 each time, starting with the top left grid and working to the right, top row then bottom row.

V-2

Find Synonyms:

INDICT

A.Condemn
B.Reprimand
C.Accuse
D.Allege



Answer: Option C
Explanation:
Meanings: formally accuse of a crime (Law); accuse, charge, criticize
-Page-1

Authentication and Authorization

Authentication
An authentication system is how you identify yourself to the computer. The goal behind an authentication system is to verify that the user is actually who they say they are. There are many ways of authenticating a user. Any combination of the following are good examples.
Password based authentication
Requires the user to know some predetermined quantity (their password).
  • Advantages: Easy to impliemnt, requires no special equipemnt.
  • Disadvantages: Easy to forget password. User can tell another user their password. Password can be written down. Password can be reused.
  • Device based authentication
    Requires the user to posses some item such as a key, mag strip, card, s/key device, etc.
  • Advantages: Difficult to copy. Cannot forget password. If used with a PIN is near useless if stolen.
  • Disadvantages: Must have device to use service so the user might forget it at home. Easy target for theft. Still doesn't actually actively identify the user.

  • Biometric Authentication
  • My voice is my passport. Verify me. This is from the movie sneakers and demonstrates one type of biometric authentication device. It identifies some physical charactistic of the user that cannot be seperated from their body.


    Retina Scanners:
  • Advantages: Accurately identifies the user when it works.
  • Disadvantages: New technology that is still evolving. Not perfect yet.



  • Hand Scanners:
  • Advantages: Difficult to seperate from the user. Accurately identifies the user.
  • Disadvantages: Getting your hand stolen to break into a vault sucks a lot more than getting your ID card stolen.





  • Authorization
    Once the system knows who the user is through authentication, authorization is how the system decides what the user can do. A good example of this is using group permissions or the difference between a normal user and the superuser on a unix system. There are other more compicated ACL (Access Control Lists) available to decide what a user can do and how they can do it. Most unix systems don't impliment this very well (if at all.)
    _______________ 
    In Short:
    Identification: Who are you?  Authentication: Prove it.   Authorization: Here is what you can do.

    Thursday, June 17, 2010

    A-2


    A person crosses a 600 m long street in 5 minutes. What is his speed in km per hour?


    A. 3.6
    B. 7.2
    C. 8.4
    D. 10

    Answer: Option B

    Explanation:

    Speed = [600/(5 x 60)]m/sec.= 2 m/sec.

    Converting m/sec to km/hr (see important formulas section)

    = [2 x (18/5)]km/hr

    = 7.2 km/hr.

    Thursday, June 10, 2010

    AJ-1:

    What is a transient variable?
    A transient variable is a variable that may not be serialized.

    Which containers use a border Layout as their default layout?
    The Window, Frame and Dialog classes use a border layout as their default layout.

    Why do threads block on I/O?
    Threads block on I/O (that is enters the waiting state) so that other threads may execute while the I/O Operation is performed.

    How are Observer and Observable used?
    Objects that subclass the Observable class maintain a list of observers. When an Observable object is updated it invokes the update() method of each of its observers to notify the observers that it has changed state. The Observer interface is implemented by objects that observe Observable objects.

    What is synchronization and why is it important?
    With respect to multithreading, synchronization is the capability to control the access of multiple threads to shared resources. Without synchronization, it is possible for one thread to modify a shared object while another thread is in the process of using or updating that object's value. This often leads to significant errors.

    Can a lock be acquired on a class?
    Yes, a lock can be acquired on a class. This lock is acquired on the class's Class object..

    Database


    Advanced Java

    -Page-1

    -Page-2

    JB-1:

    What is the difference between a constructor and a method?A constructor is a member function of a class that is used to create objects of that class. It has the same name as the class itself, has no return type, and is invoked using the new operator.
    A method is an ordinary member function of a class. It has its own name, a return type (which may be void), and is invoked using the dot operator.

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

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

    What is an abstract class?
    Abstract class must be extended/subclassed (to be useful). It serves as a template. A class that is abstract may not be instantiated (ie. you may not call its constructor), abstract class may contain static data.
    Any class with an abstract method is automatically abstract itself, and must be declared as such. A class may be declared abstract even if it has no abstract methods. This prevents it from being instantiated.

    What is the difference between an Interface and an Abstract class?
    An abstract class can have instance methods that implement a default behavior. An Interface can only declare constants and instance methods, but cannot implement default behavior and all methods are implicitly abstract.
    An interface has all public members and no implementation. An abstract class is a class which may have the usual flavors of class members (private, protected, etc.), but has some abstract methods.

    Explain different way of using thread?
    The thread could be implemented by using runnable interface or by inheriting from the Thread class. The former is more advantageous, 'cause when you are going for multiple inheritance, the only interface can help.

    Java Basics

    Page-1

    CJ-2:

    What is the base class of all classes?
    java.lang.Object

    Does Java support multiple inheritance?
    Java doesn't support multiple inheritance.

    Is Java a pure object oriented language?
    Java uses primitive data types and hence is not a pure object oriented language.

    Are arrays primitive data types?
    In Java, Arrays are objects.

    What is difference between Path and Classpath?
    Path and Classpath are operating system level environment variales. Path is used define where the system can find the executables(.exe) files and classpath is used to specify the location .class files.

    What are local variables?
    Local varaiables are those which are declared within a block of code like methods. Local variables should be initialised before accessing them.

    Core java

    -Page-1

    -Page-2

    -page-3

    CJ-1:

    What is the most important feature of Java?
    Java is a platform independent language.

    What do you mean by platform independence?
    Platform independence means that we can write and compile the java code in one platform (eg Windows) and can execute the class in any other supported platform eg (Linux,Solaris,etc).

    What is a JVM?
    JVM is Java Virtual Machine which is a run time environment for the compiled java class files.

    Are JVM's platform independent?
    JVM's are not platform independent. JVM's are platform specific run time implementation provided by the vendor.

    What is the difference between a JDK and a JVM?
    JDK is Java Development Kit which is for development purpose and it includes execution environment also. But JVM is purely a run time environment and hence you will not be able to compile your source files using a JVM.

    6. What is a pointer and does Java support pointers?
    Pointer is a reference handle to a memory location. Improper handling of pointers leads to memory leaks and reliability issues hence Java doesn't support the usage of pointers.

    V-1:

    Read the each sentence to find out whether there is any grammatical error in it. The error, if any will be in one part of the sentence.

    A. The brakes and steering failed
    B. and the bus ran down the hill
    C.
    without anyone being able control it.
    D. No error.


    Answer: Option C
    Explanation:
    without being controlled by anyone

    A-1:


    A train 360 m long is running at a speed of 45 km/hr. In what time will it pass a bridge 140 m long?
    A.
    40 sec
    B. 42 sec
    C. 45 secD. 48 sec



    Answer: Option A
    Explanation:


    Formula for converting from km/hr to m/s:   X km/hr = X x 5 m/s.
    18

    Therefore, Speed = 45 x 5 m/sec = 25 m/sec.
    18 2
    Total distance to be covered = (360 + 140) m = 500 m.

    Formula for finding Time = Distance
    -----------
    Speed
    Required time = 500 x 2
    ---------
    sec = 40 sec.
    25

    P-4:



    Answer : 16
    Explanation : Starting bottom left and moving clockwise around the triangle, numbers follow the sequence of Square Numbers.

    p-3:



    Answer: 19


    Explanation: As you move diagonally down, numbers follow the sequence of Prime Numbers.

    P-2:





    Answer : 9
    Explanation : The number at the centre of each triangle equals the sum of the lower two numbers minus the top number.

    P-1:




    Answer : 6
    Explanation : Looking at the diagram in rows, the central circle equals half the sum of the numbers in the other circles to the left and right of the centre.

    Tuesday, May 11, 2010

    P-6:

    Question:
    This one was recently given on Car Talk, and it's been making the rounds right now also...

    The warden meets with 23 new prisoners when they arrive. He tells them, "You may meet today and plan a strategy. But after today, you will be in isolated cells and will have no communication with one another.
    "In the prison is a switch room, which contains two light switches labeled A and B, each of which can be in either the 'on' or the 'off' position. I am not telling you their present positions. The switches are not connected to anything.
    "After today, from time to time whenever I feel so inclined, I will select one prisoner at random and escort him to the switch room. This prisoner will select one of the two switches and reverse its position. He must move one, but only one of the switches. He can't move both but he can't move none either. Then he'll be led back to his cell.

    "No one else will enter the switch room until I lead the next prisoner there, and he'll be instructed to do the same thing. I'm going to choose prisoners at random. I may choose the same guy three times in a row, or I may jump around and come back.
    "But, given enough time, everyone will eventually visit the switch room as many times as everyone else. At any time anyone of you may declare to me, 'We have all visited the switch room.' and be 100% sure.
    "If it is true, then you will all be set free. If it is false, and somebody has not yet visited the switch room, you will be fed to the alligators."
    What is the strategy they come up with so that they can be free?

    Answer:

     This can be solved in following manner - State 0 means off, State 1 means On. Henceforth
    00 - A is Off, B is Off
    01 - A is Off, B is On
    10 - A is On, B is Off.

    Let us have two categories of states :-
    1) Valid - 00 & 01
    2) Invalid - 10 & 11

    Also have a variable "Count" maintained by every prisoner that is local to each prisoner. The "Count" indicates total prisoners that have visited the switch room.

    Process :-
    1) Now whenever prisoner enters the switch room and encounters "Valid" state he increments his variable "Count" by one.
    2) Whenever prisoner enters the switch room and encounters "InValid" state his variable "Count" remains same.
    3) If the prisoner visited the switch room for the first time he will change the current state of switch to "Valid".
    4) If the prisoner didn't visit the switch room for the first time he will change the current state of switch to "InValid".
    5) If at any time a prisoner find his variable "Count" equal to total prisoners +1 i.e. 24 in current problem, he will declare that everyone has visited the Switch Room.

    P-5:

    Question:
    Four people need to cross a rickety rope bridge to get back to their camp at night. Unfortunately, they only have one flashlight and it only has enough light left for seventeen minutes. The bridge is too dangerous to cross without a flashlight, and it’s only strong enough to support two people at any given time.
    Each of the campers walks at a different speed. One can cross the bridge in 1 minute, another in 2 minutes, the third in 5 minutes, and the slow poke takes 10 minutes to cross. How do the campers make it across in 17 minutes?

    Answer:
    To get everyone across in 17 minutes, we need get the two slowest people across together; otherwise we are wasting too much time. Once we get them across, how do we not make one of them walk back with the flashlight? Just have one of the faster people already there waiting to sprint the flashlight back across.

    person A: 1 minute
    person B: 2 minutes
    person C: 5 minutes
    person D:10 minutes
    
    1. A & B cross.  total time:  2 minutes.
     
     C |==========================| A
     D |                          | B
       |==========================| flashlight
     
    2. B comes back. total time:  4 minutes.
     
     C |==========================| A
     D |                          | 
     B |==========================| 
    flashlight
     
    3. C & D cross.  total time: 14 minutes.
     
     B |==========================| A
       |                          | C
       |==========================| D
                                   flashlight
     
    4. A comes back. total time: 15 minutes.
     
     A |==========================| C
     B |                          | D
       |==========================| 
    flashlight
     
    5. A & B cross.  total time: 17 minutes.
     
       |==========================| A
       |                          | B
       |==========================| C D
                                  flashlight 
     
    Another valid solution is to have A bring the flashlight back in step 2.