Interview

***************************************************************************************************

VCNR Technologies ( CALL BASED THEOUGH EMPLOYEE REFERNCE 2016, 2017 )

DEVELOPER PROFILE

Address: #135, VCNR Towers, Opp. Binnamangala Nursery, Vinayaka nagar, BH Road,, Nelamangala, Karnataka 562123

***********************************************************************************************
INTERVIEW QUESTION
*************************************************
Commonly asked DBMS interview questions | Set 1
What are advantages of DBMS over traditional file based systems?
Ans: Database management systems were developed to handle the following difficulties of typical file-processing systems supported by conventional operating systems.
1. Data redundancy and inconsistency
2. Difficulty in accessing data
3. Data isolation – multiple files and formats
4. Integrity problems
5. Atomicity of updates
6. Concurrent access by multiple users
7. Security problems
Source: http://cs.nyu.edu/courses/spring01/G22.2433-001/mod1.2.pdf

What are super, primary, candidate and foreign keys?
Ans: A superkey is a set of attributes of a relation schema upon which all attributes of the schema are functionally dependent. No two rows can have the same value of super key attributes.
A Candidate key is minimal superkey, i.e., no proper subset of Candidate key attributes can be a superkey.
A Primary Key is one of the candidate keys. One of the candidate keys is selected as most important and becomes the primary key. There cannot be more that one primary keys in a table.
Foreign key is a field (or collection of fields) in one table that uniquely identifies a row of another table. See this for an example.

What is the difference between primary key and unique constraints?
Ans: Primary key cannot have NULL value, the unique constraints can have NULL values. There is only one primary key in a table, but there can be multiple unique constrains.

What is database normalization?
Ans: It is a process of analyzing the given relation schemas based on their functional dependencies and primary keys to achieve the following desirable properties:
1) Minimizing Redundancy
2) Minimizing the Insertion, Deletion, And Update Anomalies
Relation schemas that do not meet the properties are decomposed into smaller relation schemas that could meet desirable properties.
Source: http://cs.tsu.edu/ghemri/CS346/ClassNotes/Normalization.pdf

What is SQL?
SQL is Structured Query Language designed for inserting and modifying in a relational database system.

What are the differences between DDL, DML and DCL in SQL?
Ans: Following are some details of three.
DDL stands for Data Definition Language. SQL queries like CREATE, ALTER, DROP and RENAME come under this.
DML stands for Data Manipulation Language. SQL queries like SELECT, INSERT and UPDATE come under this.
DCL stands for Data Control Language. SQL queries like GRANT and REVOKE come under this.

What is the difference between having and where clause?
Ans: HAVING is used to specify a condition for a group or an aggregate function used in select statement. The WHERE clause selects before grouping. The HAVING clause selects rows after grouping. Unlike HAVING clause, the WHERE clause cannot contain aggregate functions. (See this for examples).
See Having vs Where Clause? for more details

How to print duplicate rows in a table?
Ans: See http://quiz.geeksforgeeks.org/how-to-print-duplicate-rows-in-a-table/

What is Join?
Ans: An SQL Join is used to combine data from two or more tables, based on a common field between them. For example, consider the following two tables.

Student Table

ENROLLNO STUDENTNAME ADDRESS
1000 geek1 geeksquiz1
1001 geek2 geeksquiz2
1002 geek3 geeksquiz3
StudentCourse Table

COURSEID ENROLLNO
1 1000
2 1000
3 1000
1 1002
2 1003
Following is join query that shows names of students enrolled in different courseIDs.

SELECT StudentCourse.CourseID, Student.StudentName
FROM StudentCourse
INNER JOIN Customers
ON StudentCourse.EnrollNo = Student.EnrollNo
ORDER BY StudentCourse.CourseID;
The above query would produce following result.

COURSEID STUDENTNAME
1 geek1
1 geek2
2 geek1
2 geek3
3 geek1

What is Identity?
Ans: Identity (or AutoNumber) is a column that automatically generates numeric values. A start and increment value can be set, but most DBA leave these at 1. A GUID column also generates numbers; the value of this cannot be controlled. Identity/GUID columns do not need to be indexed.

What is a view in SQL? How to create one
Ans: A view is a virtual table based on the result-set of an SQL statement. We can create using create view syntax.

CREATE VIEW view_name AS
SELECT column_name(s)
FROM table_name
WHERE condition

What are the uses of view?
1. Views can represent a subset of the data contained in a table; consequently, a view can limit the degree of exposure of the underlying tables to the outer world: a given user may have permission to query the view, while denied access to the rest of the base table.
2. Views can join and simplify multiple tables into a single virtual table
3. Views can act as aggregated tables, where the database engine aggregates data (sum, average etc.) and presents the calculated results as part of the data
4. Views can hide the complexity of data; for example a view could appear as Sales2000 or Sales2001, transparently partitioning the actual underlying table
5. Views take very little space to store; the database contains only the definition of a view, not a copy of all the data which it presentsv.
6. Depending on the SQL engine used, views can provide extra security
Source: Wiki Page

What is a Trigger?
Ans: A Trigger is a code that associated with insert, update or delete operations. The code is executed automatically whenever the associated query is executed on a table. Triggers can be useful to maintain integrity in database.

What is a stored procedure?
Ans: A stored procedure is like a function that contains a set of operations compiled together. It contains a set of operations that are commonly used in an application to do some common database tasks.

What is the difference between Trigger and Stored Procedure?
Ans: Unlike Stored Procedures, Triggers cannot be called directly. They can only be associated with queries.

What is a transaction? What are ACID properties?
Ans: A Database Transaction is a set of database operations that must be treated as whole, means either all operations are executed or none of them.
An example can be bank transaction from one account to another account. Either both debit and credit operations must be executed or none of them.
ACID (Atomicity, Consistency, Isolation, Durability) is a set of properties that guarantee that database transactions are processed reliably.

What are indexes?
Ans: A database index is a data structure that improves the speed of data retrieval operations on a database table at the cost of additional writes and the use of more storage space to maintain the extra copy of data.
Data can be stored only in one order on disk. To support faster access according to different values, faster search like binary search for different values is desired, For this purpose, indexes are created on tables. These indexes need extra space on disk, but they allow faster search according to different frequently searched values.

What are clustered and non-clustered Indexes?
Ans: Clustered indexes is the index according to which data is physically stored on disk. Therefore, only one clustered index can be created on a given database table.
Non-clustered indexes don’t define physical ordering of data, but logical ordering. Typically, a tree is created whose leaf point to disk records. B-Tree or B+ tree are used for this purposB

emax for java developer

2016, 2017 batch

drive date 6/4/2018

FOR APPLYING LINKS
**************************************************************
http://my-jobhunter.com/bangalore/bangalore-new-links-2/
****************************************************************

FOR INTERVIEW QUESTION
**********************************************

CHECK THESE

*******************************************************************************************

https://www.glassdoor.co.in/Interview/Emax-Technologies-Interview-Questions-E1597854.htm
*************************************************************************************************

1. Which two method you need to implement for key Object in HashMap ?
In order to use any object as Key in HashMap, it must implements equals and hashcode method in Java. Read How HashMap works in Java for detailed explanation on how equals and hashcode method is used to put and get object from HashMap.

2. What is immutable object? Can you write immutable object?Immutable classes are Java classes whose objects can not be modified once created. Any modification in Immutable object result in new object. For example is String is immutable in Java. Mostly Immutable are also final in Java, in order to prevent sub class from overriding methods in Java which can compromise Immutability. You can achieve same functionality by making member as non final but private and not modifying them except in constructor.

3. What is the difference between creating String as new() and literal?
When we create string with new() Operator, it’s created in heap and not added into string pool while String created using literal are created in String pool itself which exists in PermGen area of heap.

String s = new String(“Test”);

does not put the object in String pool , we need to call String.intern() method which is used to put them into String pool explicitly. its only when you create String object as String literal e.g. String s = “Test” Java automatically put that into String pool.

4. What is difference between StringBuffer and StringBuilder in Java ?

Classic Java questions which some people thing tricky and some consider very easy. StringBuilder in Java is introduced in Java 5 and only difference between both of them is that Stringbuffer methods are synchronized while StringBuilder is non synchronized. See StringBuilder vs StringBuffer for more differences.

5. Write code to find the First non repeated character in the String ?
Another good Java interview question, This question is mainly asked by Amazon and equivalent companies. See first non repeated character in the string : Amazon interview question

6. What is the difference between ArrayList and Vector ?
This question is mostly used as a start up question in Technical interviews on the topic of Collection framework . Answer is explained in detail here Difference between ArrayList and Vector .

7. How do you handle error condition while writing stored procedure or accessing stored procedure from java?
This is one of the tough Java interview question and its open for all, my friend didn’t know the answer so he didn’t mind telling me. my take is that stored procedure should return error code if some operation fails but if stored procedure itself fail than catching SQLException is only choice.

8. What is difference between Executor.submit() and Executer.execute() method ?
There is a difference when looking at exception handling. If your tasks throws an exception and if it was submitted with execute this exception will go to the uncaught exception handler (when you don’t have provided one explicitly, the default one will just print the stack trace to System.err). If you submitted the task with submit any thrown exception, checked exception or not, is then part of the task’s return status. For a task that was submitted with submit and that terminates with an exception, the Future.get will re-throw this exception, wrapped in an ExecutionException.

9. What is the difference between factory and abstract factory pattern?
Abstract Factory provides one more level of abstraction. Consider different factories each extended from an Abstract Factory and responsible for creation of different hierarchies of objects based on the type of factory. E.g. AbstractFactory extended by AutomobileFactory, UserFactory, RoleFactory etc. Each individual factory would be responsible for creation of objects in that genre.
You can also refer What is Factory method design pattern in Java to know more details.

10. What is Singleton? is it better to make whole method synchronized or only critical section synchronized ?
Singleton in Java is a class with just one instance in whole Java application, for example java.lang.Runtime is a Singleton class. Creating Singleton was tricky prior Java 4 but once Java 5 introduced Enum its very easy. see my article How to create thread-safe Singleton in Java for more details on writing Singleton using enum and double checked locking which is purpose of this Java interview question.

11. Can you write critical section code for singleton?
This core Java question is followup of previous question and expecting candidate to write Java singleton using double checked locking. Remember to use volatile variable to make Singleton thread-safe.

12. Can you write code for iterating over hashmap in Java 4 and Java 5 ?
Tricky one but he managed to write using while and for loop.

13. When do you override hashcode and equals() ?
Whenever necessary especially if you want to do equality check or want to use your object as key in HashMap.

14. What will be the problem if you don’t override hashcode() method ?
You will not be able to recover your object from hash Map if that is used as key in HashMap.
See here How HashMap works in Java for detailed explanation.

15. Is it better to synchronize critical section of getInstance() method or whole getInstance() method ?
Answer is critical section because if we lock whole method than every time some one call this method will have to wait even though we are not creating any object)

16. What is the difference when String is gets created using literal or new() operator ?
When we create string with new() its created in heap and not added into string pool while String created using literal are created in String pool itself which exists in Perm area of heap.

17. Does not overriding hashcode() method has any performance implication ?
This is a good question and open to all , as per my knowledge a poor hashcode function will result in frequent collision in HashMap which eventually increase time for adding an object into Hash Map.

18. What’s wrong using HashMap in multithreaded environment? When get() method go to infinite loop ?
Another good question. His answer was during concurrent access and re-sizing.

19. What do you understand by thread-safety ? Why is it required ? And finally, how to achieve thread-safety in Java Applications ?

Java Memory Model defines the legal interaction of threads with the memory in a real computer system. In a way, it describes what behaviors are legal in multi-threaded code. It determines when a Thread can reliably see writes to variables made by other threads. It defines semantics for volatile, final & synchronized, that makes guarantee of visibility of memory operations across the Threads.

Let’s first discuss about Memory Barrier which are the base for our further discussions. There are two type of memory barrier instructions in JMM – read barriers and write barrier.

A read barrier invalidates the local memory (cache, registers, etc) and then reads the contents from the main memory, so that changes made by other threads becomes visible to the current Thread.
A write barrier flushes out the contents of the processor’s local memory to the main memory, so that changes made by the current Thread becomes visible to the other threads.
JMM semantics for synchronized
When a thread acquires monitor of an object, by entering into a synchronized block of code, it performs a read barrier (invalidates the local memory and reads from the heap instead). Similarly exiting from a synchronized block as part of releasing the associated monitor, it performs a write barrier (flushes changes to the main memory)
Thus modifications to a shared state using synchronized block by one Thread, is guaranteed to be visible to subsequent synchronized reads by other threads. This guarantee is provided by JMM in presence of synchronized code block.

JMM semantics for Volatile fields
Read & write to volatile variables have same memory semantics as that of acquiring and releasing a monitor using synchronized code block. So the visibility of volatile field is guaranteed by the JMM. Moreover afterwards Java 1.5, volatile reads and writes are not reorderable with any other memory operations (volatile and non-volatile both). Thus when Thread A writes to a volatile variable V, and afterwards Thread B reads from variable V, any variable values that were visible to A at the time V was written are guaranteed now to be visible to B.

Let’s try to understand the same using the following code

Data data = null;
volatile boolean flag = false;

Thread A
————-
data = new Data();
flag = true; <– writing to volatile will flush data as well as flag to main memory

Thread B
————-
if(flag==true){ <– as=”” barrier=”” data.=”” flag=”” font=”” for=”” from=”” perform=”” read=”” reading=”” volatile=”” well=”” will=””>
use data; <!— data is guaranteed to visible even though it is not declared volatile because of the JMM semantics of volatile flag.
}

20. What will happen if you call return statement or System.exit on try or catch block ? will finally block execute?
This is a very popular tricky Java question and its tricky because many programmer think that finally block always executed. This question challenge that concept by putting return statement in try or catch block or calling System.exit from try or catch block. Answer of this tricky question in Java is that finally block will execute even if you put return statement in try block or catch block but finally block won’t run if you call System.exit form try or catch.

19. Can you override private or static method in Java ?
Another popular Java tricky question, As I said method overriding is a good topic to ask trick questions in Java. Anyway, you can not override private or static method in Java, if you create similar method with same return type and same method arguments that’s called method hiding.

20. What will happen if we put a key object in a HashMap which is already there ?
This tricky Java questions is part of How HashMap works in Java, which is also a popular topic to create confusing and tricky question in Java. well if you put the same key again than it will replace the old mapping because HashMap doesn’t allow duplicate keys.

21. If a method throws NullPointerException in super class, can we override it with a method which throws RuntimeException?
One more tricky Java questions from overloading and overriding concept. Answer is you can very well throw super class of RuntimeException in overridden method but you can not do same if its checked Exception.

22. What is the issue with following implementation of compareTo() method in Java

public int compareTo(Object o){
Employee emp = (Employee) emp;
return this.id – o.id;
}

23. How do you ensure that N thread can access N resources without deadlock
If you are not well versed in writing multi-threading code then this is real tricky question for you. This Java question can be tricky even for experienced and senior programmer, who are not really exposed to deadlock and race conditions. Key point here is order, if you acquire resources in a particular order and release resources in reverse order you can prevent deadlock.

24. What is difference between CyclicBarrier and CountDownLatch in Java
Relatively newer Java tricky question, only been introduced form Java 5. Main difference between both of them is that you can reuse CyclicBarrier even if Barrier is broken but you can not reuse CountDownLatch in Java. See CyclicBarrier vs CountDownLatch in Java for more differences.

25. Can you access non static variable in static context?
Another tricky Java question from Java fundamentals. No you can not access static variable in non static context in Java. Read why you can not access non-static variable from static method to learn more about this tricky Java questions.

Q1. Explain JVM, JRE and JDK?
JVM (Java Virtual Machine): It is an abstract machine. It is a specification that provides run-time environment in which java bytecode can be executed. It follows three notations:

Specification: It is a document that describes the implementation of the Java virtual machine. It is provided by Sun and other companies.
Implementation: It is a program that meets the requirements of JVM specification.
Runtime Instance: An instance of JVM is created whenever you write a java command on the command prompt and run the class.
JRE (Java Runtime Environment) : JRE refers to a runtime environment in which java bytecode can be executed. It implements the JVM (Java Virtual Machine) and provides all the class libraries and other support files that JVM uses at runtime. So JRE is a software package that contains what is required to run a Java program. Basically, it’s an implementation of the JVM which physically exists.

JDK(Java Development Kit) : It is the tool necessary to compile, document and package Java programs. The JDK completely includes JRE which contains tools for Java programmers. The Java Development Kit is provided free of charge. Along with JRE, it includes an interpreter/loader, a compiler (javac), an archiver (jar), a documentation generator (javadoc) and other tools needed in Java development. In short, it contains JRE + development tools.

Refer to this below image and understand how exactly these components reside:

Components – Java Interview Questions – Edureka

Q2. Explain public static void main(String args[]).
public : Public is an access modifier, which is used to specify who can access this method. Public means that this Method will be accessible by any Class.
static : It is a keyword in java which identifies it is class based i.e it can be accessed without creating the instance of a Class.

void : It is the return type of the method. Void defines the method which will not return any value.

main: It is the name of the method which is searched by JVM as a starting point for an application with a particular signature only. It is the method where the main execution occurs.

String args[] : It is the parameter passed to the main method.

Q3. Why Java is platform independent?
Platform independent practically means “write once run anywhere”. Java is called so because of its byte codes which can run on any system irrespective of its underlying operating system.

Q4. Why java is not 100% Object-oriented?
Java is not 100% Object-oriented because it makes use of eight primitive datatypes such as boolean, byte, char, int, float, double, long, short which are not objects.

Q5. What are wrapper classes?
Wrapper classes converts the java primitives into the reference types (objects). Every primitive data type has a class dedicated to it. These are known as wrapper classes because they “wrap” the primitive data type into an object of that class. Refer to the below image which displays different primitive type, wrapper class and constructor argument.

WrapperClass – Java Interview Questions – Edureka

Q6. What are constructors in Java?
In Java, constructor refers to a block of code which is used to initialize an object. It must have the same name as that of the class. Also, it has no return type and it is automatically called when an object is created.

There are two types of constructors:

Default constructor
Parameterized constructor
Q7. What is singleton class and how can we make a class singleton?
Singleton class is a class whose only one instance can be created at any given time, in one JVM. A class can be made singleton by making its constructor private.

Q8. What is the difference between Array list and vector?
Array List Vector
Array List is not synchronized. Vector is synchronized.
Array List is fast as it’s non-synchronized. Vector is slow as it is thread safe.
If an element is inserted into the Array List, it increases its Array size by 50%. Vector defaults to doubling size of its array.
Array List does not define the increment size. Vector defines the increment size.
Array List can only use Iterator for traversing an Array List. Except Hashtable, Vector is the only other class which uses both Enumeration and Iterator.
Q9. What is the difference between equals() and == ?
Equals() method is defined in Object class in Java and used for checking equality of two objects defined by business logic.
“==” or equality operator in Java is a binary operator provided by Java programming language and used to compare primitives and objects. public boolean equals(Object o) is the method provided by the Object class. The default implementation uses == operator to compare two objects. For example: method can be overridden like String class. equals() method is used to compare the values of two objects.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
public class Equaltest {
public static void main(String[] args) {
String str1= new String(“ABCD”);
String str2= new String(“ABCD”);
if(Str1 == str2)
{
System.out.println(“String 1 == String 2 is true”);
}
else
{
System.out.println(“String 1 == String 2 is false”);
String Str3 = Str2;
if( Str2 == Str3)
{
System.out.println(“String 2 == String 3 is true”);
}
else
{
System.out.println(“String 2 == String 3 is false”);
}
if(Str1.equals(str2))
{
System.out.println(“String 1 equals string 2 is true”);
}
else
{
System.out.prinltn(“String 1 equals string 2 is false”);
}
}}
Q10. What are the differences between Heap and Stack Memory?
The major difference between Heap and Stack memory are:

Features Stack Heap
Memory Stack memory is used only by one thread of execution. Heap memory is used by all the parts of the application.
Access Stack memory can’t be accessed by other threads. Objects stored in the heap are globally accessible.
Memory Management Follows LIFO manner to free memory. Memory management is based on generation associated to each object.
Lifetime Exists until the end of execution of the thread. Heap memory lives from the start till the end of application execution.
Usage Stack memory only contains local primitive and reference variables to objects in heap space. Whenever an object is created, it’s always stored in the Heap space.

In case you are facing any challenges with these java interview questions, please comment your problems in the section below. Apart from this Java Interview Questions Blog, if you want to get trained from professionals on this technology, you can opt for a structured training from edureka! Click below to know more.

Get Started with Java

OOPS Java Interview Questions:
Q1. What is Polymorphism?

Polymorphism is briefly described as “one interface, many implementations”. Polymorphism is a characteristic of being able to assign a different meaning or usage to something in different contexts – specifically, to allow an entity such as a variable, a function, or an object to have more than one form. There are two types of polymorphism:

Compile time polymorphism
Run time polymorphism

Compile time polymorphism is method overloading whereas Runtime time polymorphism is done using inheritance and interface.

Q2. What is runtime polymorphism or dynamic method dispatch?
In Java, runtime polymorphism or dynamic method dispatch is a process in which a call to an overridden method is resolved at runtime rather than at compile-time. In this process, an overridden method is called through the reference variable of a superclass. Let’s take a look at the example below to understand it better.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
class Car {
void run()
{
System.out.println(“car is running”);
}
}
class Audi extends Car {
void run()
{
System.out.prinltn(“Audi is running safely with 100km”);
}
public static void main(String args[])
{
Car b= new Audi(); //upcasting
b.run();
}
}
Q3. What is the difference between abstract classes and interfaces?
Abstract Class Interfaces
An abstract class can provide complete, default code and/or just the details that have to be overridden. An interface cannot provide any code at all,just the signature.
In case of abstract class, a class may extend only one abstract class. A Class may implement several interfaces.
An abstract class can have non-abstract methods. All methods of an Interface are abstract.
An abstract class can have instance variables. An Interface cannot have instance variables
An abstract class can have any visibility: public, private, protected. An Interface visibility must be public (or) none.
If we add a new method to an abstract class then we have the option of providing default implementation and therefore all the existing code might work properly If we add a new method to an Interface then we have to track down all the implementations of the interface and define implementation for the new method
An abstract class can contain constructors An Interface cannot contain constructors
Abstract classes are fast Interfaces are slow as it requires extra indirection to find corresponding method in the actual class
Q4. What is method overloading and method overriding?
Method Overloading :
In Method Overloading, Methods of the same class shares the same name but each method must have different number of parameters or parameters having different types and order.
Method Overloading is to “add” or “extend” more to method’s behavior.
It is a compile time polymorphism.
The methods must have different signature.
It may or may not need inheritance in Method Overloading.
Let’s take a look at the example below to understand it better.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
class Adder {
Static int add(int a, int b)
{
return a+b;
}
Static double add( double a, double b)
{
return a+b;
}
public static void main(String args[])
{
System.out.println(Adder.add(11,11));
System.out.println(Adder.add(12.3,12.6));
}}
Method Overriding:
In Method Overriding, sub class have the same method with same name and exactly the same number and type of parameters and same return type as a super class.
Method Overriding is to “Change” existing behavior of method.
It is a run time polymorphism.
The methods must have same signature.
It always requires inheritance in Method Overriding.
Let’s take a look at the example below to understand it better.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
class Car {
void run(){
System.out.println(“car is running”);
}
Class Audi extends Car{
void run()
{
System.out.prinltn(“Audi is running safely with 100km”);
}
public static void main( String args[])
{
Car b=new Audi();
b.run();
}
}
Q5. Can you override a private or static method in Java?
You cannot override a private or static method in Java. If you create a similar method with same return type and same method arguments in child class then it will hide the super class method; this is known as method hiding. Similarly, you cannot override a private method in sub class because it’s not accessible there. What you can do is create another private method with the same name in the child class. Let’s take a look at the example below to understand it better.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
class Base {
private static void display() {
System.out.println(“Static or class method from Base”);
}
public void print() {
System.out.println(“Non-static or instance method from Base”);
}
class Derived extends Base {
private static void display() {
System.out.println(“Static or class method from Derived”);
}
public void print() {
System.out.println(“Non-static or instance method from Derived”);
}
public class test {
public static void main(String args[])
{
Base obj= new Derived();
obj1.display();
obj1.print();
}
}
Q6. What is multiple inheritance? Is it supported by Java?
MultipleInheritance – Java Interview Questions – EdurekaIf a child class inherits the property from multiple classes is known as multiple inheritance. Java does not allow to extend multiple classes.

The problem with multiple inheritance is that if multiple parent classes have a same method name, then at runtime it becomes difficult for the compiler to decide which method to execute from the child class.

Therefore, Java doesn’t support multiple inheritance. The problem is commonly referred as Diamond Problem.

Q7. What is association?
Association is a relationship where all object have their own lifecycle and there is no owner. Let’s take an example of Teacher and Student. Multiple students can associate with a single teacher and a single student can associate with multiple teachers but there is no ownership between the objects and both have their own lifecycle. These relationship can be one to one, One to many, many to one and many to many.

Q8. What do you mean by aggregation?
Aggregation is a specialized form of Association where all object have their own lifecycle but there is ownership and child object can not belongs to another parent object. Let’s take an example of Department and teacher. A single teacher can not belongs to multiple departments, but if we delete the department teacher object will not destroy.

Q9. What is composition in Java?
Composition is again specialized form of Aggregation and we can call this as a “death” relationship. It is a strong type of Aggregation. Child object dose not have their lifecycle and if parent object deletes all child object will also be deleted. Let’s take again an example of relationship between House and rooms. House can contain multiple rooms there is no independent life of room and any room can not belongs to two different house if we delete the house room will automatically delete.

In case you are facing any challenges with these java interview questions, please comment your problems in the section below. Apart from this Java Interview Questions Blog, if you want to get trained from professionals on this technology, you can opt for a structured training from edureka! Click below to know more.

Learn Java From Experts

Servlets Interview Questions
Q1. What is a servlet?
Java Servlet is server side technologies to extend the capability of web servers by providing support for dynamic response and data persistence.
The javax.servlet and javax.servlet.http packages provide interfaces and classes for writing our own servlets.
All servlets must implement the javax.servlet.Servlet interface, which defines servlet lifecycle methods. When implementing a generic service, we can extend the GenericServlet class provided with the Java Servlet API. The HttpServlet class provides methods, such as doGet() and doPost(), for handling HTTP-specific services.
Most of the times, web applications are accessed using HTTP protocol and thats why we mostly extend HttpServlet class. Servlet API hierarchy is shown in below image.
Servlet – Java Interview Questions – Edureka

Q2. What are the differences between Get and Post methods?
Get Post
Limited amount of data can be sent because data is sent in header. Large amount of data can be sent because data is sent in body.
Not Secured because data is exposed in URL bar. Secured because data is not exposed in URL bar.
Can be bookmarked Cannot be bookmarked
Idempotent Non-Idempotent
It is more efficient and used than Post It is less efficient and used
Q3. What is Request Dispatcher?
RequestDispatcher interface is used to forward the request to another resource that can be HTML, JSP or another servlet in same application. We can also use this to include the content of another resource to the response.

There are two methods defined in this interface:

1.void forward()

2.void include()

ForwardMethod – Java Interview Questions – Edureka
IncludeMethod – Java Interview Questions – Edureka

Q4. What are the differences between forward() method and sendRedirect() methods?
Forward() method SendRedirect() method
forward() sends the same request to another resource. sendRedirect() method sends new request always because it uses the URL bar of the browser.
forward() method works at server side. sendRedirect() method works at client side.
forward() method works within the server only. sendRedirect() method works within and outside the server.
Q5. What is the life-cycle of a servlet?
There are 5 stages in the lifecycle of a servlet:LifeCycleServlet – Java Interview Questions – Edureka

Servlet is loaded
Servlet is instantiated
Servlet is initialized
Service the request
Servlet is destroyed
Q6. How does cookies work in Servlets?
Cookies are text data sent by server to the client and it gets saved at the client local machine.
Servlet API provides cookies support through javax.servlet.http.Cookie class that implements Serializable and Cloneable interfaces.
HttpServletRequest getCookies() method is provided to get the array of Cookies from request, since there is no point of adding Cookie to request, there are no methods to set or add cookie to request.
Similarly HttpServletResponse addCookie(Cookie c) method is provided to attach cookie in response header, there are no getter methods for cookie.
Q7. What are the differences between ServletContext vs ServletConfig?
The difference between ServletContext and ServletConfig in Servlets JSP is in below tabular format.

ServletConfig ServletContext
Servlet config object represent single servlet It represent whole web application running on particular JVM and common for all the servlet
Its like local parameter associated with particular servlet Its like global parameter associated with whole application
It’s a name value pair defined inside the servlet section of web.xml file so it has servlet wide scope ServletContext has application wide scope so define outside of servlet tag in web.xml file.
getServletConfig() method is used to get the config object getServletContext() method is used to get the context object.
for example shopping cart of a user is a specific to particular user so here we can use servlet config To get the MIME type of a file or application session related information is stored using servlet context object.
Q8. What are the different methods of session management in servlets?
Session is a conversational state between client and server and it can consists of multiple request and response between client and server. Since HTTP and Web Server both are stateless, the only way to maintain a session is when some unique information about the session (session id) is passed between server and client in every request and response.

Some of the common ways of session management in servlets are:

User Authentication
HTML Hidden Field
Cookies
URL Rewriting
Session Management API

SessionManagement – Java Interview Questions – Edureka
In case you are facing any challenges with these java interview questions, please comment your problems in the section below. Apart from this Java Interview Questions Blog, if you want to get trained from professionals on this technology, you can opt for a structured training from edureka! Click below to know more.

Get Java Certified

JDBC Interview Questions
Q1. What is JDBC Driver?
JDBC Driver is a software component that enables java application to interact with the database. There are 4 types of JDBC drivers:

JDBC-ODBC bridge driver
Native-API driver (partially java driver)
Network Protocol driver (fully java driver)
Thin driver (fully java driver)
Q2. What are the steps to connect to a database in java?
Registering the driver class
Creating connection
Creating statement
Executing queries
Closing connection
Q3. What are the JDBC API components?
The java.sql package contains interfaces and classes for JDBC API.

Interfaces:
Connection
Statement
PreparedStatement
ResultSet
ResultSetMetaData
DatabaseMetaData
CallableStatement etc.
Classes:
DriverManager
Blob
Clob
Types
SQLException etc.
Q4. What is the role of JDBC DriverManager class?
The DriverManager class manages the registered drivers. It can be used to register and unregister drivers. It provides factory method that returns the instance of Connection.

Q5. What is JDBC Connection interface?
The Connection interface maintains a session with the database. It can be used for transaction management. It provides factory methods that returns the instance of Statement, PreparedStatement, CallableStatement and DatabaseMetaData.

ConnectionInterface – Java Interview Questions – Edureka
Q6. What is the purpose of JDBC ResultSet interface?
The ResultSet object represents a row of a table. It can be used to change the cursor pointer and get the information from the database.

Q7. What is JDBC ResultSetMetaData interface?
The ResultSetMetaData interface returns the information of table such as total number of columns, column name, column type etc.

Q8. What is JDBC DatabaseMetaData interface?
The DatabaseMetaData interface returns the information of the database such as username, driver name, driver version, number of tables, number of views etc.

Q9. What do you mean by batch processing in JDBC?
Batch processing helps you to group related SQL statements into a batch and execute them instead of executing a single query. By using batch processing technique in JDBC, you can execute multiple queries which makes the performance faster.

Q10. What is the difference between execute, executeQuery, executeUpdate?
Statement execute(String query) is used to execute any SQL query and it returns TRUE if the result is an ResultSet such as running Select queries. The output is FALSE when there is no ResultSet object such as running Insert or Update queries. We can use getResultSet() to get the ResultSet and getUpdateCount() method to retrieve the update count.

Statement executeQuery(String query) is used to execute Select queries and returns the ResultSet. ResultSet returned is never null even if there are no records matching the query. When executing select queries we should use executeQuery method so that if someone tries to execute insert/update statement it will throw java.sql.SQLException with message “executeQuery method can not be used for update”.

Statement executeUpdate(String query) is used to execute Insert/Update/Delete (DML) statements or DDL statements that returns nothing. The output is int and equals to the row count for SQL Data Manipulation Language (DML) statements. For DDL statements, the output is 0.

You should use execute() method only when you are not sure about the type of statement else use executeQuery or executeUpdate method.

Markit company ( call based 2016, 2017 batch )

drive date 9th april

SJR I Park
Business park in Bengaluru, India
Address: Road 9, EPIP Zone, Whitefield, Bengaluru, Karnataka 560066
********************************************************************************************************
https://www.glassdoor.co.in/Interview/Markit-Software-Engineer-Interview-Questions-EI_IE222865.0,6_KO7,24.htm
********************************************************************************************************

**************************************************************************************
Read java porgram question
**************************************************

List Of All Interview Programs:
How to reverse Singly Linked List?
Find out duplicate number between 1 to N numbers.
Find out middle index where sum of both ends are equal.
Write a singleton class.
Write a program to create deadlock between two threads.
Write a program to reverse a string using recursive algorithm.
Write a program to reverse a number.
Write a program to convert decimal number to binary format.
Write a program to find perfect number or not.
Write a program to implement ArrayList.
Write a program to find maximum repeated words from a file.
Wrie a program to find out duplicate characters in a string.
Write a program to find top two maximum numbers in a array.
Write a program to sort a map by value.
Write a program to find common elements between two arrays.
How to swap two numbers without using temporary variable?
Write a program to print fibonacci series.
Write a program to find sum of each digit in the given number using recursion.
Write a program to check the given number is a prime number or not?
Write a program to find the given number is Armstrong number or not?
Write a program to convert binary to decimal number.
Write a program to check the given number is binary number or not?
Write a program for Bubble Sort in java.
Write a program for Insertion Sort in java.
Write a program to implement hashcode and equals.
How to get distinct elements from an array by avoiding duplicate elements?
Write a program to get distinct word list from the given file.
Write a program to get a line with max word count from the given file.
Write a program to convert string to number without using Integer.parseInt() method.
Write a program to find two lines with max characters in descending order.
Write a program to find the sum of the first 1000 prime numbers.
Find longest substring without repeating characters.
Write a program to remove duplicates from sorted array.
How to sort a Stack using a temporary Stack?
Write a program to print all permutations of a given string.
Implement Binary Search Tree (BST)
Find min and max value from Binary Search Tree (BST)
Find height of a Binary Search Tree (BST)
Implement Binary Search Tree (BST) Level order traversal (breadth first).
Implement Binary Search Tree (BST) pre-order traversal (depth first).
Implement Binary Search Tree (BST) in-order traversal (depth first).
Implement Binary Search Tree (BST) post-order traversal (depth first).
How to check the given Binary Tree is Binary Search Tree (BST) or not?
How to delete a node from Binary Search Tree (BST)?
*************************************************************************************

Data Structure Important Questions:

1) What is a data structure?
2) What does abstract data type means?
3) Evaluate the following prefix expression ” ++ 26 + – 1324″ (Similar types can be asked)
4) Convert the following infix expression to post fix notation ((a+2)*(b+4)) -1 (Similar types can be asked)
5) How is it possible to insert different type of elements in stack?
6) Stack can be described as a pointer. Explain.
7) Write a Binary Search program
8) Write programs for Bubble Sort, Quick sort
9) Explain about the types of linked lists
10) How would you sort a linked list?
11) Write the programs for Linked List (Insertion and Deletion) operations
12) What data structure would you mostly likely see in a non recursive implementation of a recursive algorithm?
13) What do you mean by Base case, Recursive case, Binding Time, Run-Time Stack and Tail Recursion?
14) Explain quick sort and merge sort algorithms and derive the time-constraint relation for these.
15) Explain binary searching, Fibinocci search.
16) What is the maximum total number of nodes in a tree that has N levels? Note that the root is level (zero)
17) How many different binary trees and binary search trees can be made from three nodes that contain the key values 1, 2 & 3?
18) A list is ordered from smaller to largest when a sort is called. Which sort would take the longest time to execute?
19) A list is ordered from smaller to largest when a sort is called. Which sort would take the shortest time to execute?
20) When will you sort an array of pointers to list elements, rather than sorting the elements themselves?
21) The element being searched for is not found in an array of 100 elements. What is the average number of comparisons needed in a sequential search to determine that the element is not there, if the elements are completely unordered?
22) What is the average number of comparisons needed in a sequential search to determine the position of an element in an array of 100 elements, if the elements are ordered from largest to smallest?
23) Which sort show the best average behavior?
24) What is the average number of comparisons in a sequential search?
25) Which data structure is needed to convert infix notations to post fix notations?
26) What do you mean by:
27) Syntax Error
28) Logical Error
29) Runtime Error
30) How can you correct these errors?
31) In which data structure, elements can be added or removed at either end, but not in the middle?
32) How will inorder, preorder and postorder traversals print the elements of a tree?
33) Parenthesis are never needed in prefix or postfix expressions. Why?
34) Which one is faster? A binary search of an orderd set of elements in an array or a sequential search of the elements.
35) where do you use double linked list. (queing the prosess in cpu).
36) write a program to accept name & sort them.
37) Construct a doubly linked list using a single pointer in each node

******************************************************************************************************************************
op Answers to SQL Interview Questions
1. Compare SQL & PL/SQL
Criteria SQL PL/SQL
What it is Single query or command execution Full programming language
What it comprises Data source for reports, web pages Application language to build, format and display report, web pages
Characteristic Declarative in nature Procedural in nature
Used for Manipulating data Creating applications
2. What is BCP? When is it used?
It is a tool used to duplicate enormous quantity of information from tables and views. It does not facsimile the structures same as foundation to target.
BULK INSERT command helps to bring in a data folder into a record, table or view in a user-specific arrangement.

3. When is the UPDATE_STATISTICS command used?
This command is used, ones the processing of large data is done.
When we delete a large number of files, alteration or reproduction takes place in the tables, to be concerned of these changes we need to restructure the indexes This is done UPDATE_STATISTICS.

4. Explain the steps needed to Create the scheduled job?
Steps to create a Scheduled Job :

Connect to the database of SQL server in SQL Server Management Studio. On the SQL Server Agent, we will find a Jobs folder.
Right click on jobs and choose Add New.
A New Job window will come into view. Give an associated name for the same.
Click next on the “Steps” in the left list of options. An SQL job can have multiple steps either in the form of SQL declaration or a stored practice call.
Click on the “Schedules” in the left list of options. An SQL job can comprise of one or supplementary schedules. It is basically the instance at which SQL job will jog itself. We can spell out returning schedules also.
5. When are we going to use truncate and delete?
TRUNCATE is a DDL command, whereas DELETE is a DML command.
We can’t execute a trigger in case of TRUNCATE whilst with DELETE, we can accomplish a trigger.
TRUNCATE is quicker than DELETE, for the reason that when we use DELETE to delete the data, at that time it store the whole statistics in the rollback gap on or after where we can get the data back after removal. In case of TRUNCATE, it will not store data in rollback gap and will unswervingly rub it out. TRUNCATE do not recover the deleted data.
We can use any condition in WHERE clause using DELETE but it is not possible with TRUNCATE.5.If a table is referenced by any foreign key constraints, then TRUNCATE won’t work.
Go through this SQL tutorial to learn more about SQL commands.

6. Explain correlated query work?
It’s most important to be attentive of the arrange of operations in an interrelated subquery.
First, a row is processed in the outer doubt.
Then, for that exacting row, the subquery is executed – as a result for each row processed by the outer query, the subquery will also be processed. In correlated subquery, each time a line is worked for Emp1, the subquery will also make a decision on the exacting row’s value for Emp1.Salary and run. And the outer query will move on to the next row, and the subquery will execute for that row’s value of Emp1.Salary.
It will persist in anticipation of the “WHERE (1) = (… )” state is pleased.

Read this insightful tutorial to learn usage of SQL Clauses.

7. When is the Explicit Cursor Used ?
If the developer needs to perform the row by row operations for the result set containing more than one row, then he unambiguously declares a pointer with a name. They are managed by OPEN, FETCH and CLOSE.%FOUND, %NOFOUND, %ROWCOUNT and %ISOPEN characteristics are used in all types of pointers.

8. Find What is Wrong in this Query?
SELECT subject_code, AVG (marks) FROM students WHERE AVG(marks) > 75 GROUP BY subject_code; The WHERE clause cannot be used to restrict groups. Instead, the HAVING clause should be used.
SELECT subject_code, AVG (marks)
FROM students
HAVING AVG(marks) > 75
GROUP BY subject_code;
9. Write the Syntax for STUFF function in an SQL server?
STUFF (String1, Position, Length, String2)
String1 – String to be overwritten
Position – Starting location for overwriting
Length – Length of substitute string
String2- String to overwrite.
10. Name some commands that can be used to manipulate text in T-SQL code. For example, a command that obtains only a portion of the text or replace a text string, etc.
CHARINDEX( findTextData, textData, [startingPosition] ) – Returns the starting position of the specified expression in a character string. The starting position is optional.
LEFT( character_expression , integer_expression ) – Returns the left part of a character string with the specified number of characters.
LEN( textData ) – Returns integer value of the length of the string, excluding trailing blanks.
LOWER ( character_expression ) – Returns a character expression after converting uppercase character data to lowercase.
LTRIM( textData) – Removes leading blanks. PATINDEX( findTextData, textData ) – Returns integer value of the starting position of text found in the string.
REPLACE( textData, findTextData, replaceWithTextData ) – Replaces occurrences of text found in the string with a new value.
REPLICATE( character_expression , integer_expression ) – Repeats a character expression for a specified number of times.
REVERSE( character_expression ) – Returns the reverse of a character expression.
RTRIM( textData) – Removes trailing blanks. SPACE( numberOfSpaces ) – Repeats space value specified number of times.
STUFF( textData, start , length , insertTextData ) – Deletes a specified length of characters and inserts another set of characters at a specified starting point.
SUBSTRING( textData, startPosition, length ) – Returns portion of the string.
UPPER( character_expression ) – Returns a character expression with lowercase character data converted to uppercase.
**************************************************************************************************************************************************************

Sentienz Solutions Pvt. Ltd ( call based 2017 batch through fresherworld )

drive date 7th april

Address: 3rd Floor, PR Business Center, Kadubisanahalli, Marathahalli, Landmark: Above Croma Stores , Opposite JP Morgan, Bengaluru, Karnataka 560087

************************************************************************************
https://www.glassdoor.co.in/Overview/Working-at-Sentienz-EI_IE1814194.11,19.htm
***********************************************************************************

Commonly asked DBMS interview questions | Set 1
What are advantages of DBMS over traditional file based systems?
Ans: Database management systems were developed to handle the following difficulties of typical file-processing systems supported by conventional operating systems.
1. Data redundancy and inconsistency
2. Difficulty in accessing data
3. Data isolation – multiple files and formats
4. Integrity problems
5. Atomicity of updates
6. Concurrent access by multiple users
7. Security problems
Source: http://cs.nyu.edu/courses/spring01/G22.2433-001/mod1.2.pdf

What are super, primary, candidate and foreign keys?
Ans: A superkey is a set of attributes of a relation schema upon which all attributes of the schema are functionally dependent. No two rows can have the same value of super key attributes.
A Candidate key is minimal superkey, i.e., no proper subset of Candidate key attributes can be a superkey.
A Primary Key is one of the candidate keys. One of the candidate keys is selected as most important and becomes the primary key. There cannot be more that one primary keys in a table.
Foreign key is a field (or collection of fields) in one table that uniquely identifies a row of another table. See this for an example.

What is the difference between primary key and unique constraints?
Ans: Primary key cannot have NULL value, the unique constraints can have NULL values. There is only one primary key in a table, but there can be multiple unique constrains.

What is database normalization?
Ans: It is a process of analyzing the given relation schemas based on their functional dependencies and primary keys to achieve the following desirable properties:
1) Minimizing Redundancy
2) Minimizing the Insertion, Deletion, And Update Anomalies
Relation schemas that do not meet the properties are decomposed into smaller relation schemas that could meet desirable properties.
Source: http://cs.tsu.edu/ghemri/CS346/ClassNotes/Normalization.pdf

What is SQL?
SQL is Structured Query Language designed for inserting and modifying in a relational database system.

What are the differences between DDL, DML and DCL in SQL?
Ans: Following are some details of three.
DDL stands for Data Definition Language. SQL queries like CREATE, ALTER, DROP and RENAME come under this.
DML stands for Data Manipulation Language. SQL queries like SELECT, INSERT and UPDATE come under this.
DCL stands for Data Control Language. SQL queries like GRANT and REVOKE come under this.

What is the difference between having and where clause?
Ans: HAVING is used to specify a condition for a group or an aggregate function used in select statement. The WHERE clause selects before grouping. The HAVING clause selects rows after grouping. Unlike HAVING clause, the WHERE clause cannot contain aggregate functions. (See this for examples).
See Having vs Where Clause? for more details

How to print duplicate rows in a table?
Ans: See http://quiz.geeksforgeeks.org/how-to-print-duplicate-rows-in-a-table/

What is Join?
Ans: An SQL Join is used to combine data from two or more tables, based on a common field between them. For example, consider the following two tables.

Student Table

ENROLLNO STUDENTNAME ADDRESS
1000 geek1 geeksquiz1
1001 geek2 geeksquiz2
1002 geek3 geeksquiz3
StudentCourse Table

COURSEID ENROLLNO
1 1000
2 1000
3 1000
1 1002
2 1003
Following is join query that shows names of students enrolled in different courseIDs.

SELECT StudentCourse.CourseID, Student.StudentName
FROM StudentCourse
INNER JOIN Customers
ON StudentCourse.EnrollNo = Student.EnrollNo
ORDER BY StudentCourse.CourseID;
The above query would produce following result.

COURSEID STUDENTNAME
1 geek1
1 geek2
2 geek1
2 geek3
3 geek1

What is Identity?
Ans: Identity (or AutoNumber) is a column that automatically generates numeric values. A start and increment value can be set, but most DBA leave these at 1. A GUID column also generates numbers; the value of this cannot be controlled. Identity/GUID columns do not need to be indexed.

What is a view in SQL? How to create one
Ans: A view is a virtual table based on the result-set of an SQL statement. We can create using create view syntax.

CREATE VIEW view_name AS
SELECT column_name(s)
FROM table_name
WHERE condition

What are the uses of view?
1. Views can represent a subset of the data contained in a table; consequently, a view can limit the degree of exposure of the underlying tables to the outer world: a given user may have permission to query the view, while denied access to the rest of the base table.
2. Views can join and simplify multiple tables into a single virtual table
3. Views can act as aggregated tables, where the database engine aggregates data (sum, average etc.) and presents the calculated results as part of the data
4. Views can hide the complexity of data; for example a view could appear as Sales2000 or Sales2001, transparently partitioning the actual underlying table
5. Views take very little space to store; the database contains only the definition of a view, not a copy of all the data which it presentsv.
6. Depending on the SQL engine used, views can provide extra security
Source: Wiki Page

What is a Trigger?
Ans: A Trigger is a code that associated with insert, update or delete operations. The code is executed automatically whenever the associated query is executed on a table. Triggers can be useful to maintain integrity in database.

What is a stored procedure?
Ans: A stored procedure is like a function that contains a set of operations compiled together. It contains a set of operations that are commonly used in an application to do some common database tasks.

What is the difference between Trigger and Stored Procedure?
Ans: Unlike Stored Procedures, Triggers cannot be called directly. They can only be associated with queries.

What is a transaction? What are ACID properties?
Ans: A Database Transaction is a set of database operations that must be treated as whole, means either all operations are executed or none of them.
An example can be bank transaction from one account to another account. Either both debit and credit operations must be executed or none of them.
ACID (Atomicity, Consistency, Isolation, Durability) is a set of properties that guarantee that database transactions are processed reliably.

What are indexes?
Ans: A database index is a data structure that improves the speed of data retrieval operations on a database table at the cost of additional writes and the use of more storage space to maintain the extra copy of data.
Data can be stored only in one order on disk. To support faster access according to different values, faster search like binary search for different values is desired, For this purpose, indexes are created on tables. These indexes need extra space on disk, but they allow faster search according to different frequently searched values.

What are clustered and non-clustered Indexes?
Ans: Clustered indexes is the index according to which data is physically stored on disk. Therefore, only one clustered index can be created on a given database table.
Non-clustered indexes don’t define physical ordering of data, but logical ordering. Typically, a tree is created whose leaf point to disk records. B-Tree or B+ tree are used for this purpos

Commonly asked DBMS interview questions | Set 2
Practice Quizzes on DBMS
Last Minute Notes – DBMS
DBMS Articles
Please write comments if you find anything incorrect, or you want to share more information about the topic discussed above.

DBMS | Concurrency Control Protocol | Thomas Write Rule
Timestamp Ordering Protocol states that if Ri(X) and Wj(X) are conflicting operations then Ri (X) is processed before Wj(X) if and only if TS(Ti) < TS(Tj). Whenever a schedule does not follow serializablity order according to the Timestamp, user generally reject it and rollback the Transaction. Some operations on the other hand are harmless and can be allowed.

Thomas Write Rule allows such operations and is a modification on the Basic Timestamp Ordering protocol. In Thomas Write Rule user ignore outdated writes. Moreover, of all the Concurrency Protocols have been discussed, Concurrency is imposed on Schedules which are Conflict Serializable, in Thomas Write Rule, the most important improvement is user can achieve Concurrency with View Serializable schedules.

First let’s state what is Thomas Write Rule and then what are the modifications and improvements it succeeds over the Basic TO protocol.

Thomas Write Rule –
Thomas Write Rule does not enforce Conflict Serializablity but rejects fewer Write Operations by modifying the check Operations for W_item(X)

If R_TS(X) > TS(T), then abort and rollback T and reject the operation.
If W_TS(X) > TS(T), then don’t execute the Write Operation and continue processing. This is a case of Outdated or Obsolete Writes. Remember, outdated writes are ignored in Thomas Write Rule but a Transaction following Basic TO protocol will abort such a Transaction.
If neither the condition in 1 or 2 occurs, then and only then execute the W_item(X) operation of T and set W_TS(X) to TS(T)
Outdated Write Example –
The main update in Thomas Write Rule is ignoring the Obsolete Write Operations. This is done because some transaction with timestamp greater than TS(T) (i.e., a transaction after T in TS ordering) has already written the value of X. Hence, logically user can ignore the Write(X) operation of T which becomes obsolete. Let us see this through an example:

Suppose user has a schedule in which two transactions T1 and T2. Now, TS(T1) < TS(T2). This means T1 arrived after T2 and hence has a larger TS value than T1. This implies that serializablity of schedule allowed is T2 –> T1 . Consider the partial schedule given below:

3333
Image – Example of Outdated Write
Obsolete Writes are hence ignored in this rule which is in accordance to the 2nd protocol. It seems to be more logical as user skip an unnecessary procedure of restarting the entire transaction. This protocol is just a modification to Basic TO protocol.

Basic TO Protocol v/s Thomas Write Rule –
Suppose user has a schedule in which two transactions T1 and T2. Now, TS(T1) < TS(T2). This implies that serializablity of schedule allowed is T2 –> T1 . Consider the two protocols, let us see what types of Operation will be allowed and not allowed under them. Ri(A) implies Read and Wi(A) implies Write operation. Now, let us look at the types of partial schedules allowed in both Basic TO and Thomas Write Rule, you’ll understand the difference in operations of both the protocol. User distinguish in operations Allowed and Not Allowed in both of the Protocols.
Basic TO Protocol
Not Allowed
R1(X) W2(X)
W1(X) R2(X)
W1(X) W2(X)
Allowed
All operations where T2 occurs before T1.
R1(X) R2(X)
Thomas Write Rule
Not Allowed
R1(X) W2(X)
W1(X) R2(X)
Allowed
All operations where T2 occurs before T1.
Outdated Writes: W1(X) W2(X)
R1(X) R2(X)
****************************************************************************************************

data structure interview question
************************************************************************************
What is a Data Structure?
A data structure is a way of organizing the data so that the data can be used efficiently. Different kinds of data structures are suited to different kinds of applications, and some are highly specialized to specific tasks. For example, B-trees are particularly well-suited for implementation of databases, while compiler implementations usually use hash tables to look up identifiers. (Source: Wiki Page)

What are linear and non linear data Structures?

Linear: A data structure is said to be linear if its elements form a sequence or a linear list. Examples: Array. Linked List, Stacks and Queues
Non-Linear: A data structure is said to be non-linear if traversal of nodes is nonlinear in nature. Example: Graph and Trees.

What are the various operations that can be performed on different Data Structures?

Insertion − Add a new data item in the given collection of data items.
Deletion − Delete an existing data item from the given collection of data items.
Traversal − Access each data item exactly once so that it can be processed.
Searching − Find out the location of the data item if it exists in the given collection of data items.
Sorting − Arranging the data items in some order i.e. in ascending or descending order in case of numerical data and in dictionary order in case of alphanumeric data.

How is an Array different from Linked List?

The size of the arrays is fixed, Linked Lists are Dynamic in size.
Inserting and deleting a new element in an array of elements is expensive, Whereas both insertion and deletion can easily be done in Linked Lists.
Random access is not allowed in Linked Listed.
Extra memory space for a pointer is required with each element of the Linked list.
Arrays have better cache locality that can make a pretty big difference in performance.

What is Stack and where it can be used?

Stack is a linear data structure which the order LIFO(Last In First Out) or FILO(First In Last Out) for accessing elements. Basic operations of stack are : Push, Pop , Peek

Applications of Stack:

Infix to Postfix Conversion using Stack
Evaluation of Postfix Expression
Reverse a String using Stack
Implement two stacks in an array
Check for balanced parentheses in an expression

What is a Queue, how it is different from stack and how is it implemented?

Queue is a linear structure which follows the order is First In First Out (FIFO) to access elements. Mainly the following are basic operations on queue: Enqueue, Dequeue, Front, Rear
The difference between stacks and queues is in removing. In a stack we remove the item the most recently added; in a queue, we remove the item the least recently added. Both Queues and Stacks can be implemented using Arrays and Linked Lists.

What are Infix, prefix, Postfix notations?

Infix notation: X + Y – Operators are written in-between their operands. This is the usual way we write expressions. An expression such as
A * ( B + C ) / D
Postfix notation (also known as “Reverse Polish notation”): X Y + Operators are written after their operands. The infix expression given above is equivalent to
A B C + * D/
Prefix notation (also known as “Polish notation”): + X Y Operators are written before their operands. The expressions given above are equivalent to
/ * A + B C D
Converting between these notations: Click here

What is a Linked List and What are its types?

A linked list is a linear data structure (like arrays) where each element is a separate object. Each element (that is node) of a list is comprising of two items – the data and a reference to the next node.Types of Linked List :

Singly Linked List : In this type of linked list, every node stores address or reference of next node in list and the last node has next address or reference as NULL. For example 1->2->3->4->NULL
Doubly Linked List : Here, here are two references associated with each node, One of the reference points to the next node and one to the previous node. Eg. NULL<-1<->2<->3->NULL
Circular Linked List : Circular linked list is a linked list where all nodes are connected to form a circle. There is no NULL at the end. A circular linked list can be a singly circular linked list or doubly circular linked list. Eg. 1->2->3->1 [The next pointer of last node is pointing to the first]

Which data structures are used for BFS and DFS of a graph?

Queue is used for BFS
Stack is used for DFS. DFS can also be implemented using recursion (Note that recursion also uses function call stack).

Can doubly linked be implemented using a single pointer variable in every node?
Doubly linked list can be implemented using a single pointer. See XOR Linked List – A Memory Efficient Doubly Linked List

How to implement a stack using queue?

A stack can be implemented using two queues. Let stack to be implemented be ‘s’ and queues used to implement be ‘q1’ and ‘q2’. Stack ‘s’ can be implemented in two ways:

Method 1 (By making push operation costly)
Method 2 (By making pop operation costly) See Implement Stack using Queues

How to implement a queue using stack?

A queue can be implemented using two stacks. Let queue to be implemented be q and stacks used to implement q be stack1 and stack2. q can be implemented in two ways:

Method 1 (By making enQueue operation costly)
Method 2 (By making deQueue operation costly) See Implement Queue using Stacks

Which Data Structure Should be used for implementiong LRU cache?

We use two data structures to implement an LRU Cache.

Queue which is implemented using a doubly linked list. The maximum size of the queue will be equal to the total number of frames available (cache size).The most recently used pages will be near front end and least recently pages will be near rear end.
A Hash with page number as key and address of the corresponding queue node as value. See How to implement LRU caching scheme? What data structures should be used?

How to check if a given Binary Tree is BST or not?
If inorder traversal of a binary tree is sorted, then the binary tree is BST. The idea is to simply do inorder traversal and while traversing keep track of previous key value. If current key value is greater, then continue, else return false. See A program to check if a binary tree is BST or not for more details.

Linked List Questions

Linked List Insertion
Linked List Deletion
middle of a given linked list
Nth node from the end of a Linked List

Tree Traversal Questions

Inorder
Preorder and Postoder Traversals
Level order traversal
Height of Binary Tree

Convert a DLL to Binary Tree in-place
See In-place conversion of Sorted DLL to Balanced BST

Convert Binary Tree to DLL in-place
See Convert a given Binary Tree to Doubly Linked List | Set 1, Convert a given Binary Tree to Doubly Linked List | Set 2

Delete a given node in a singly linked list
Given only a pointer to a node to be deleted in a singly linked list, how do you delete it?

Reverse a Linked List
Write a function to reverse a linked list

Detect Loop in a Linked List
Write a C function to detect loop in a linked list.
*********************************************************************************************************

*********************************************************************************************************************************************************

ALL STATE COMPANY ( CALL BASED 2017 BATCH )

DRIVE DATE 7/4/2018

Address: RMZ Ecoworld , 7th Floor, Building No. 1, Devarabeesanahalli Village,, Varthur, Hobli, Bengaluru, Karnataka 560103

***********************************************************************
INTERVIEW QUESTION CHECK THESE LINKS
*****************************************************

**************************************************************************
https://www.glassdoor.co.in/Interview/Allstate-Interview-Questions-E2341.htm
***********************************************************************************
*******************************************************************************
READ DATA STURCTURE INTERVIEW QUESTION
******************************************************************

What is a Data Structure?
A data structure is a way of organizing the data so that the data can be used efficiently. Different kinds of data structures are suited to different kinds of applications, and some are highly specialized to specific tasks. For example, B-trees are particularly well-suited for implementation of databases, while compiler implementations usually use hash tables to look up identifiers. (Source: Wiki Page)

What are linear and non linear data Structures?

Linear: A data structure is said to be linear if its elements form a sequence or a linear list. Examples: Array. Linked List, Stacks and Queues
Non-Linear: A data structure is said to be non-linear if traversal of nodes is nonlinear in nature. Example: Graph and Trees.

What are the various operations that can be performed on different Data Structures?

Insertion − Add a new data item in the given collection of data items.
Deletion − Delete an existing data item from the given collection of data items.
Traversal − Access each data item exactly once so that it can be processed.
Searching − Find out the location of the data item if it exists in the given collection of data items.
Sorting − Arranging the data items in some order i.e. in ascending or descending order in case of numerical data and in dictionary order in case of alphanumeric data.

How is an Array different from Linked List?

The size of the arrays is fixed, Linked Lists are Dynamic in size.
Inserting and deleting a new element in an array of elements is expensive, Whereas both insertion and deletion can easily be done in Linked Lists.
Random access is not allowed in Linked Listed.
Extra memory space for a pointer is required with each element of the Linked list.
Arrays have better cache locality that can make a pretty big difference in performance.

What is Stack and where it can be used?

Stack is a linear data structure which the order LIFO(Last In First Out) or FILO(First In Last Out) for accessing elements. Basic operations of stack are : Push, Pop , Peek

Applications of Stack:

Infix to Postfix Conversion using Stack
Evaluation of Postfix Expression
Reverse a String using Stack
Implement two stacks in an array
Check for balanced parentheses in an expression

What is a Queue, how it is different from stack and how is it implemented?

Queue is a linear structure which follows the order is First In First Out (FIFO) to access elements. Mainly the following are basic operations on queue: Enqueue, Dequeue, Front, Rear
The difference between stacks and queues is in removing. In a stack we remove the item the most recently added; in a queue, we remove the item the least recently added. Both Queues and Stacks can be implemented using Arrays and Linked Lists.

What are Infix, prefix, Postfix notations?

Infix notation: X + Y – Operators are written in-between their operands. This is the usual way we write expressions. An expression such as
A * ( B + C ) / D
Postfix notation (also known as “Reverse Polish notation”): X Y + Operators are written after their operands. The infix expression given above is equivalent to
A B C + * D/
Prefix notation (also known as “Polish notation”): + X Y Operators are written before their operands. The expressions given above are equivalent to
/ * A + B C D
Converting between these notations: Click here

What is a Linked List and What are its types?

A linked list is a linear data structure (like arrays) where each element is a separate object. Each element (that is node) of a list is comprising of two items – the data and a reference to the next node.Types of Linked List :

Singly Linked List : In this type of linked list, every node stores address or reference of next node in list and the last node has next address or reference as NULL. For example 1->2->3->4->NULL
Doubly Linked List : Here, here are two references associated with each node, One of the reference points to the next node and one to the previous node. Eg. NULL<-1<->2<->3->NULL
Circular Linked List : Circular linked list is a linked list where all nodes are connected to form a circle. There is no NULL at the end. A circular linked list can be a singly circular linked list or doubly circular linked list. Eg. 1->2->3->1 [The next pointer of last node is pointing to the first]

Which data structures are used for BFS and DFS of a graph?

Queue is used for BFS
Stack is used for DFS. DFS can also be implemented using recursion (Note that recursion also uses function call stack).

Can doubly linked be implemented using a single pointer variable in every node?
Doubly linked list can be implemented using a single pointer. See XOR Linked List – A Memory Efficient Doubly Linked List

How to implement a stack using queue?

A stack can be implemented using two queues. Let stack to be implemented be ‘s’ and queues used to implement be ‘q1’ and ‘q2’. Stack ‘s’ can be implemented in two ways:

Method 1 (By making push operation costly)
Method 2 (By making pop operation costly) See Implement Stack using Queues

How to implement a queue using stack?

A queue can be implemented using two stacks. Let queue to be implemented be q and stacks used to implement q be stack1 and stack2. q can be implemented in two ways:

Method 1 (By making enQueue operation costly)
Method 2 (By making deQueue operation costly) See Implement Queue using Stacks

Which Data Structure Should be used for implementiong LRU cache?

We use two data structures to implement an LRU Cache.

Queue which is implemented using a doubly linked list. The maximum size of the queue will be equal to the total number of frames available (cache size).The most recently used pages will be near front end and least recently pages will be near rear end.
A Hash with page number as key and address of the corresponding queue node as value. See How to implement LRU caching scheme? What data structures should be used?

How to check if a given Binary Tree is BST or not?
If inorder traversal of a binary tree is sorted, then the binary tree is BST. The idea is to simply do inorder traversal and while traversing keep track of previous key value. If current key value is greater, then continue, else return false. See A program to check if a binary tree is BST or not for more details.

Linked List Questions

Linked List Insertion
Linked List Deletion
middle of a given linked list
Nth node from the end of a Linked List

Tree Traversal Questions

Inorder
Preorder and Postoder Traversals
Level order traversal
Height of Binary Tree

Convert a DLL to Binary Tree in-place
See In-place conversion of Sorted DLL to Balanced BST

****************************************************************************************************************************************

siemens Technology and Services Private Limited ( CALL BASED 2017 2016 BATCH )
PROFILE DEVELOPER/TESTER
DRIVE DATE 5/4/2018
Address: No. 84, Keonics, Electronics City, Hosur Road, Bengaluru, Karnataka 560100

***********************************************************************
INTERVIEW QUESTION CHECK THESE LINKS
*****************************************************

INTERVIEW QUESTION LINKS

**************************
http://placement.freshersworld.com/siemens-question-papers-and-answers/33140000199

************************************

WRITTEN PATTERN
1. Totally 50 questions were there.
2. Two sections
* Technical 25 questions
* Apptitude 25 questions
3. Duration of the test was 40 min.
4. Negative mark 0.25 for each wrong answers.

Our exam started sharply at 1.30 P.M and sharply and nicely ended at 2.10 P.M. Two batches like 8.00 AM and 1.00 PM batch were conducted.I have appeared in 1.00 PM batch. More than 200 members appeared. But Selected candidates in our batch was only 10.

One question booklet with sequntially printed 50 questions.
Some of the questions i can remember. I would like to tell you those questions, I hope it will definitely help you.
Ok following are some of the useful things about the written pattern.

* TECHNICAL QUESTIONS
In technical questions they asked only from the following areas.
* Operating Systems.
* Computer Networks.
* C
* C++
that all. No other areas. All the questions were really very very basic questions. You can easily answer.

* Operating Systems.
-> Starting 2 to 3 questions were related to Windows NT.
-> Demand paging.
-> Fragmentation.

* Computer Networks
-> Read thoroughly the functions of every layers in OSI model.
-> only two questions related to networks, both of them were related to layers.

* C & C++
-> Very basic c apptitude questions were there.
-> For example,
1. func(int x,int& y)
{
x++;y++;
}
void main()
{
int a,b;
a=b=1;
func(a,b);
cout<<a<<b;
}

Choices:
a. 1 1
b. 1 2
c. 2 1
d. 2 2

2. What is the operator for stream insertion
a. >
b. >>
c. <
d. <<

* APPTITUDE QUESTIONS In Aptitude section, questions on from the following areas were there. * Profit & Loss * Number Series * Missing number * Blood relations I can remember some questions related to every chapters.There may be some mistakes in this questions>But i am giving these questions only to give you the model.

* Profit & Loss
A man has Rs.2000 with him. He would like to lend this money for interest. He divided that amount in two part and lend. One part for the interest of 5% and rest for 2% interest. At the end of one year he get totally Rs.92. What will be the biggest amount he had divided the initial amount Rs.2000?
This kind of questions found range from 2 to 4.

* Missing Number
This kind of questions were really very very easy to answer.
For example,
1. 3 : 16 :: 7 : ?
Ans: 64
(3 * (3+2))+1 = 16
(7 * (7+2))+1 = 64

Nearly more than 10 questions were related absolutely in this section. * Number Series
Nearly 2 to 3 questions were asked
3 , 8 , 15 , ? , 35
HOPE IT WILL BE USEFUL.ALL THE BEST
MR.K

SIEMENS PAPER ON 22ND JULY,2008

Hi frens….i wood wanna share tis resource about siemens for all the aspirants….SIEMENS had come to our college on 22/july/2008….These were the aptitude question…

1) The prototype declaration for a pointer to a function which returns a pointer to an integer is:
a. int (**pfi)();
b. int (*)(*pfi)();
c.(*int) pfi ();
d. int * (*pfi)();
Ans: D

2) main()
{
static int a[20];
int i=0;
a[i]=i++;
printf(“%d%d%d”, a[0],a[i],i );
}
a. 0 0 0
b. 0 0 1
c. 1 1 1
d. Error
ans: b

3) void f(int x,int &y)
{
x++;
y++;
}
Void main()
{
Int i=1,j=1;
F(I,j)
Cout<

**************************************************************************************
Siemens Placement Paper

THIS PAPER CONSISTS 6 PARTS. all are multiple choice q’s

1 general
2 c/unix
3 c++/motif
4 database
5 x-windows
6 ms-windows
we have written q’s not acc. to each part.total 50. q’s. time is sufficient. if u have basic idea about all of the u can easily answer the questions.

1. which of following operator can’t be overloaded.
a)==
b)++
c)?!
d)<=

2. #include<iostream.h>
main()
{
printf(“Hello World”);
}
the program prints Hello World without changing main() the o/p should be initialization Hello World Destruct the changes should be
a)iostream operator<<(iostream os, char*s) os<<‘intialisation'<<(Hello World)<<Destruct
b) c) d)none of the above

3. CDPATH shell variable is in(c-shell)
a) b) c) d)

4. semaphore variable is different from ordinary variable by

5. swap(int x,y)
{
int temp;
temp=x;
x=y;
y=temp;
}
main()
{
int x=2;y=3;
swap(x,y);
}
after calling swap ,what are yhe values x&y?

6. static variable will be visible in
a)fn. in which they are defined
b)module ” ” ” ”
c)all the program
d)none

7. unix system is
a)multi processing
b)multi processing ,multiuser
c)multi processing ,multiuser,multitasking
d)multiuser,multitasking

8. x.25 protocol encapsulates the follwing layers
a)network
b)datalink
c)physical
d)all of the above
e)none of the above

9. TCP/IP can work on
a)ethernet
b)tokenring
c)a&b
d)none

10. A node has the ip address 138.50.10.7 and 138.50.10.9.But it is transmitting data from node1 to node2only. The reason may be
a)a node cannot have more than one address
b)class A should have second octet different
c)classB ” ” ” ” ”
d)a,b,c

11. for an application which exceeds 64k the memory model should be
a)medium
b)huge
c)large
d)none

12. The condition required for dead lock in unix sustem is

13. set-user-id is related to (in unix)

14. wrong statement about c++
a)code removably
b)encapsulation of data and code
c)program easy maintenance
d)program runs faster

15. struct base
{
int a,b;
base();
int virtual function1();
}
struct derv1:base{
int b,c,d;
derv1()
int virtual function1();
}
struct derv2 : base
{int a,e;
}
base::base()
{
a=2;b=3;
}
derv1::derv1(){
b=5;
c=10;d=11;}
base::function1()
{return(100);
}
derv1::function1()
{
return(200);
}
main()
base ba;
derv1 d1,d2;
printf(“%d %d”,d1.a,d1.b)
o/p is
a)a=2;b=3;
b)a=3; b=2;
c)a=5; b=10;
d)none

16. for the above program answer the following q’s
main()
base da;
derv1 d1;
derv2 d2;
printf(“%d %d %d”,da.function1(),d1.function1(),d2.function1());
o/p is
a)100,200,200;
b)200,100,200;
c)200,200,100;
d)none

17. struct {
int x;
int y;
}abc;
you can not access x by the following
1)abc–>x;
2)abc[0]–>x;
abc.x;
(abc)–>x;
a)1,2,3
b)2&3
c)1&2
d)1,3,4

18. automatic variables are destroyed after fn. ends because
a)stored in swap
b)stored in stack and poped out after fn. returns
c)stored in data area
d)stored in disk

19. variable DESTDIR in make program is accessed as
a) $(DESTDIR)
b) ${DESTDIR}
c) DESTDIR
d) DESTDIR

20. The keystroke mouse entrie are interpreted in ms windows as
a) interrupt
b) message
c) event
d) none of the above

21. link between program and out side world (ms -win)
a)device driver and hardware disk
b)application and device driver
c)application and hardware device
d)none

22. after logout the process still runs in the background by giving the command
a)nohop
b)

23. process dies out but still waita
a)exit
b)wakeup
c)zombie
d)steep

24. In dynamic memory allocation we use
a) doubly linked list
b) circularly linked
c) B trees
d) L trees
e) none

25. To find the key of search the data structure is
a)hask key
b)trees
c)linked lists
d)records

26. data base
——————————–
employ_code salary employ_code leave from to
————————————–
1236 1500 1238 — —237
1237 2000 1238 — — 1237
1238 2500 1237 — 1237
————————– ————————————–
select employ_code,employ_data ,leave
the number of rows in the o/p
a)18
b)6
c)7
d)3

27. which is true
a)bridge connects dissimiler LANand protocol insensitive
b)router ” ” ” ” ”
c)gateway ” ” ” ” ”
d)none of the above

********************************************************************
DataBi Solutions OPEN WALKIN WALKIN
FULL STACK DEVELOPER
DRIVE DATE 4TH AND 5TH APRIL
TIME 11:00 AM TO 5:00 PM

Address: 217/C, 2nd Floor, KVV Samrat, East of NGEF,2nd street, Outer Ring Road, Kasturi Nagar, Bang, Bengaluru, Karnataka 560043
*

******************************************************************************************************
https://www.glassdoor.co.in/Overview/Working-at-Datalabs-EI_IE342000.11,19.htm?countryRedirect=true
*********************************************************************************************************************
WRITTEN TEST
********************************************************************

Simple Interest
Profit and Loss
Percentage
Calendar
Average
Volume and Surface Area
Numbers
*************************************************
TECHINCAL INTERVIEW QUESTION
************************************************
Top 25 Java Interview Questions :

1. Which two method you need to implement for key Object in HashMap ?
In order to use any object as Key in HashMap, it must implements equals and hashcode method in Java. Read How HashMap works in Java for detailed explanation on how equals and hashcode method is used to put and get object from HashMap.

2. What is immutable object? Can you write immutable object?Immutable classes are Java classes whose objects can not be modified once created. Any modification in Immutable object result in new object. For example is String is immutable in Java. Mostly Immutable are also final in Java, in order to prevent sub class from overriding methods in Java which can compromise Immutability. You can achieve same functionality by making member as non final but private and not modifying them except in constructor.

3. What is the difference between creating String as new() and literal?
When we create string with new() Operator, it’s created in heap and not added into string pool while String created using literal are created in String pool itself which exists in PermGen area of heap.

String s = new String(“Test”);

does not put the object in String pool , we need to call String.intern() method which is used to put them into String pool explicitly. its only when you create String object as String literal e.g. String s = “Test” Java automatically put that into String pool.

4. What is difference between StringBuffer and StringBuilder in Java ?

Classic Java questions which some people thing tricky and some consider very easy. StringBuilder in Java is introduced in Java 5 and only difference between both of them is that Stringbuffer methods are synchronized while StringBuilder is non synchronized. See StringBuilder vs StringBuffer for more differences.

5. Write code to find the First non repeated character in the String ?
Another good Java interview question, This question is mainly asked by Amazon and equivalent companies. See first non repeated character in the string : Amazon interview question

6. What is the difference between ArrayList and Vector ?
This question is mostly used as a start up question in Technical interviews on the topic of Collection framework . Answer is explained in detail here Difference between ArrayList and Vector .

7. How do you handle error condition while writing stored procedure or accessing stored procedure from java?
This is one of the tough Java interview question and its open for all, my friend didn’t know the answer so he didn’t mind telling me. my take is that stored procedure should return error code if some operation fails but if stored procedure itself fail than catching SQLException is only choice.

8. What is difference between Executor.submit() and Executer.execute() method ?
There is a difference when looking at exception handling. If your tasks throws an exception and if it was submitted with execute this exception will go to the uncaught exception handler (when you don’t have provided one explicitly, the default one will just print the stack trace to System.err). If you submitted the task with submit any thrown exception, checked exception or not, is then part of the task’s return status. For a task that was submitted with submit and that terminates with an exception, the Future.get will re-throw this exception, wrapped in an ExecutionException.

9. What is the difference between factory and abstract factory pattern?
Abstract Factory provides one more level of abstraction. Consider different factories each extended from an Abstract Factory and responsible for creation of different hierarchies of objects based on the type of factory. E.g. AbstractFactory extended by AutomobileFactory, UserFactory, RoleFactory etc. Each individual factory would be responsible for creation of objects in that genre.
You can also refer What is Factory method design pattern in Java to know more details.

10. What is Singleton? is it better to make whole method synchronized or only critical section synchronized ?
Singleton in Java is a class with just one instance in whole Java application, for example java.lang.Runtime is a Singleton class. Creating Singleton was tricky prior Java 4 but once Java 5 introduced Enum its very easy. see my article How to create thread-safe Singleton in Java for more details on writing Singleton using enum and double checked locking which is purpose of this Java interview question.

11. Can you write critical section code for singleton?
This core Java question is followup of previous question and expecting candidate to write Java singleton using double checked locking. Remember to use volatile variable to make Singleton thread-safe.

12. Can you write code for iterating over hashmap in Java 4 and Java 5 ?
Tricky one but he managed to write using while and for loop.

13. When do you override hashcode and equals() ?
Whenever necessary especially if you want to do equality check or want to use your object as key in HashMap.

14. What will be the problem if you don’t override hashcode() method ?
You will not be able to recover your object from hash Map if that is used as key in HashMap.
See here How HashMap works in Java for detailed explanation.

15. Is it better to synchronize critical section of getInstance() method or whole getInstance() method ?
Answer is critical section because if we lock whole method than every time some one call this method will have to wait even though we are not creating any object)

16. What is the difference when String is gets created using literal or new() operator ?
When we create string with new() its created in heap and not added into string pool while String created using literal are created in String pool itself which exists in Perm area of heap.

17. Does not overriding hashcode() method has any performance implication ?
This is a good question and open to all , as per my knowledge a poor hashcode function will result in frequent collision in HashMap which eventually increase time for adding an object into Hash Map.

18. What’s wrong using HashMap in multithreaded environment? When get() method go to infinite loop ?
Another good question. His answer was during concurrent access and re-sizing.

19. What do you understand by thread-safety ? Why is it required ? And finally, how to achieve thread-safety in Java Applications ?

Java Memory Model defines the legal interaction of threads with the memory in a real computer system. In a way, it describes what behaviors are legal in multi-threaded code. It determines when a Thread can reliably see writes to variables made by other threads. It defines semantics for volatile, final & synchronized, that makes guarantee of visibility of memory operations across the Threads.

Let’s first discuss about Memory Barrier which are the base for our further discussions. There are two type of memory barrier instructions in JMM – read barriers and write barrier.

A read barrier invalidates the local memory (cache, registers, etc) and then reads the contents from the main memory, so that changes made by other threads becomes visible to the current Thread.
A write barrier flushes out the contents of the processor’s local memory to the main memory, so that changes made by the current Thread becomes visible to the other threads.
JMM semantics for synchronized
When a thread acquires monitor of an object, by entering into a synchronized block of code, it performs a read barrier (invalidates the local memory and reads from the heap instead). Similarly exiting from a synchronized block as part of releasing the associated monitor, it performs a write barrier (flushes changes to the main memory)
Thus modifications to a shared state using synchronized block by one Thread, is guaranteed to be visible to subsequent synchronized reads by other threads. This guarantee is provided by JMM in presence of synchronized code block.

JMM semantics for Volatile fields
Read & write to volatile variables have same memory semantics as that of acquiring and releasing a monitor using synchronized code block. So the visibility of volatile field is guaranteed by the JMM. Moreover afterwards Java 1.5, volatile reads and writes are not reorderable with any other memory operations (volatile and non-volatile both). Thus when Thread A writes to a volatile variable V, and afterwards Thread B reads from variable V, any variable values that were visible to A at the time V was written are guaranteed now to be visible to B.

Let’s try to understand the same using the following code

Data data = null;
volatile boolean flag = false;

Thread A
————-
data = new Data();
flag = true; <– writing to volatile will flush data as well as flag to main memory

Thread B
————-
if(flag==true){ <– as=”” barrier=”” data.=”” flag=”” font=”” for=”” from=”” perform=”” read=”” reading=”” volatile=”” well=”” will=””>
use data; <!— data is guaranteed to visible even though it is not declared volatile because of the JMM semantics of volatile flag.
}

20. What will happen if you call return statement or System.exit on try or catch block ? will finally block execute?
This is a very popular tricky Java question and its tricky because many programmer think that finally block always executed. This question challenge that concept by putting return statement in try or catch block or calling System.exit from try or catch block. Answer of this tricky question in Java is that finally block will execute even if you put return statement in try block or catch block but finally block won’t run if you call System.exit form try or catch.

19. Can you override private or static method in Java ?
Another popular Java tricky question, As I said method overriding is a good topic to ask trick questions in Java. Anyway, you can not override private or static method in Java, if you create similar method with same return type and same method arguments that’s called method hiding.

20. What will happen if we put a key object in a HashMap which is already there ?
This tricky Java questions is part of How HashMap works in Java, which is also a popular topic to create confusing and tricky question in Java. well if you put the same key again than it will replace the old mapping because HashMap doesn’t allow duplicate keys.

21. If a method throws NullPointerException in super class, can we override it with a method which throws RuntimeException?
One more tricky Java questions from overloading and overriding concept. Answer is you can very well throw super class of RuntimeException in overridden method but you can not do same if its checked Exception.

22. What is the issue with following implementation of compareTo() method in Java

public int compareTo(Object o){
Employee emp = (Employee) emp;
return this.id – o.id;
}

23. How do you ensure that N thread can access N resources without deadlock
If you are not well versed in writing multi-threading code then this is real tricky question for you. This Java question can be tricky even for experienced and senior programmer, who are not really exposed to deadlock and race conditions. Key point here is order, if you acquire resources in a particular order and release resources in reverse order you can prevent deadlock.

24. What is difference between CyclicBarrier and CountDownLatch in Java
Relatively newer Java tricky question, only been introduced form Java 5. Main difference between both of them is that you can reuse CyclicBarrier even if Barrier is broken but you can not reuse CountDownLatch in Java. See CyclicBarrier vs CountDownLatch in Java for more differences.

25. Can you access non static variable in static context?
Another tricky Java question from Java fundamentals. No you can not access static variable in non static context in Java. Read why you can not access non-static variable from static method to learn more about this tricky Java questions.

****************************************************************************

GLASSBEAM COMPANY ( THROUGH ELITMUS 2017 BATCH )

ONLY THOSE WHO GOT CALL LETTER FROM ELITMUS

DRIVE DATE 4TH APRIL

Address: No Sree Rama Deevena Building, Block A, Floor,, 21, Halasuru Rd, HAL 3rd Stage, Bengaluru, Karnataka 560042

***********************************************************************************
https://www.glassdoor.co.in/Interview/Glassbeam-Interview-Questions-E632563.htm
*********************************************************************************

. There are 3 rounds, first of written test then tech and hr interview. Test was about programming and algorithms .There was 12 questions including 2 bonus questions

Interview Questions

The classic monkey and greasy pole problem
************************************************************
WRITTEN TEST
********************************************************************

Simple Interest
Profit and Loss
Percentage
Calendar
Average
Volume and Surface Area
Numbers
*************************************************
WRITTEN TECHINCAL QUESTION
************************************************
rogramming Questions & Answers –
Who should Practice these C Questions?
– Anyone wishing to sharpen their skills on C programming language
– Anyone preparing for aptitude test in C (both objective type test and C coding written test)
– Anyone preparing for interviews (campus/off-campus interviews, walk-in interview and company interviews)

#1: What is the scope of an external variable?
a) Whole source file in which it is defined
b) From the point of declaration to the end of the file in which it is defined
c) Any source file in a program
d) From the point of declaration to the end of the file being compiled
Show Answer

#2: What is the output of this C code?
#include <stdio.h>
void main()
{
int x = 97;
int y = sizeof(x++);
printf(“x is %d”, x);
}
a) x is 97
b) x is 98
c) x is 99
d) Run time error

Show Answer

#3: What is the output of the below c code?
#include <stdio.h>
void main()
{
char *s = “hello”;
char *p = s;
printf(“%p\t%p”, p, s);
}
a) Different address is printed
b) Same address is printed
c) Run time error
d) Nothing

Show Answer

#4: What is the output of this C code?
#include <stdio.h>
struct student
{
char a[5];
};
void main()
{
struct student s[] = {“hi”, “hey”};
printf(“%c”, s[0].a[1]);
}
a) h
b) i
c) e
d) y

Show Answer

#5: What is the output of this C code?
#include <stdio.h>
void main()
{
static int x;
if (x++ < 2)
main();
}
a) Infinite calls to main
b) Run time error
c) Varies
d) main is called twice

Show Answer

#6: What is the output of this C code?
#include <stdio.h>
int main()
{
char *str = “hello, world”;
char *str1 = “hello, world”;
if (strcmp(str, str1))
printf(“equal”);
else
printf(“unequal”);
}
a) equal
b) unequal
c) Compilation error
d) Depends on the compiler

Show Answer

#7: Which of the following cannot be static in C?
a) Variables
b) Functions
c) Structures
d) None of the mentioned
Show Answer

#8: What is the output of this C code?
#include <stdio.h>
#define foo(m, n) m * n = 10
int main()
{
printf(“in main\n”);
}
a) In main
b) Compilation error as lvalue is required for the expression m*n=10
c) Preprocessor error as lvalue is required for the expression m*n=10
d) None of the mentioned

Show Answer

#9: Which of the following is not possible?
a) A structure variable pointing to itself
b) A structure variable pointing to another structure variable of same type
c) 2 different type of structure variable pointing at each other.
d) None of these
Show Answer

#10: Property of external variable to be accessed by any source file is called by C90 standard as
a) external linkage
b) external scope
c) global scope
d) global linkage
***********************************************************************
INTERVIEW QUESTION
**************************************************
Linked List vs Array
Both Arrays and Linked List can be used to store linear data of similar types, but they both have some advantages and disadvantages over each other.

Following are the points in favour of Linked Lists.

(1) The size of the arrays is fixed: So we must know the upper limit on the number of elements in advance. Also, generally, the allocated memory is equal to the upper limit irrespective of the usage, and in practical uses, upper limit is rarely reached.

(2) Inserting a new element in an array of elements is expensive, because room has to be created for the new elements and to create room existing elements have to shifted.

For example, suppose we maintain a sorted list of IDs in an array id[].

id[] = [1000, 1010, 1050, 2000, 2040, …..].

And if we want to insert a new ID 1005, then to maintain the sorted order, we have to move all the elements after 1000 (excluding 1000).

Deletion is also expensive with arrays until unless some special techniques are used. For example, to delete 1010 in id[], everything after 1010 has to be moved.

So Linked list provides following two advantages over arrays
1) Dynamic size
2) Ease of insertion/deletion

Linked lists have following drawbacks:
1) Random access is not allowed. We have to access elements sequentially starting from the first node. So we cannot do binary search with linked lists.
2) Extra memory space for a pointer is required with each element of the list.
3) Arrays have better cache locality that can make a pretty big difference in performance.

Delete a Linked List node at a given position
Given a singly linked list and a position, delete a linked list node at the given position.

Example:

Input: position = 1, Linked List = 8->2->3->1->7
Output: Linked List = 8->3->1->7

Input: position = 0, Linked List = 8->2->3->1->7
Output: Linked List = 2->3->1->7
Recommended: Please solve it on “PRACTICE” first, before moving on to the solution.

If node to be deleted is root, simply delete it. To delete a middle node, we must have pointer to the node previous to the node to be deleted. So if positions is not zero, we run a loop position-1 times and get pointer to the previous node.

// A complete working Java program to delete a node in a linked list
// at a given position
class LinkedList
{
Node head; // head of list

/* Linked list Node*/
class Node
{
int data;
Node next;
Node(int d)
{
data = d;
next = null;
}
}

/* Inserts a new Node at front of the list. */
public void push(int new_data)
{
/* 1 & 2: Allocate the Node &
Put in the data*/
Node new_node = new Node(new_data);

/* 3. Make next of new Node as head */
new_node.next = head;

/* 4. Move the head to point to new Node */
head = new_node;
}

/* Given a reference (pointer to pointer) to the head of a list
and a position, deletes the node at the given position */
void deleteNode(int position)
{
// If linked list is empty
if (head == null)
return;

// Store head node
Node temp = head;

// If head needs to be removed
if (position == 0)
{
head = temp.next; // Change head
return;
}

// Find previous node of the node to be deleted
for (int i=0; temp!=null && i<position-1; i++)
temp = temp.next;

// If position is more than number of ndoes
if (temp == null || temp.next == null)
return;

// Node temp->next is the node to be deleted
// Store pointer to the next of node to be deleted
Node next = temp.next.next;

temp.next = next; // Unlink the deleted node from list
}

/* This function prints contents of linked list starting from
the given node */
public void printList()
{
Node tnode = head;
while (tnode != null)
{
System.out.print(tnode.data+” “);
tnode = tnode.next;
}
}

/* Drier program to test above functions. Ideally this function
should be in a separate user class. It is kept here to keep
code compact */
public static void main(String[] args)
{
/* Start with the empty list */
LinkedList llist = new LinkedList();

llist.push(7);
llist.push(1);
llist.push(3);
llist.push(2);
llist.push(8);

System.out.println(“\nCreated Linked list is: “);
llist.printList();

llist.deleteNode(4); // Delete node at position 4

System.out.println(“\nLinked List after Deletion at position 4: “);
llist.printList();
}
}
Run on IDE

Output:
Created Linked List:
8 2 3 1 7
Linked List after Deletion at position 4:
8 2 3 1

What are linear and non linear data Structures?

Linear: A data structure is said to be linear if its elements form a sequence or a linear list. Examples: Array. Linked List, Stacks and Queues
Non-Linear: A data structure is said to be non-linear if traversal of nodes is nonlinear in nature. Example: Graph and Trees.

What are the various operations that can be performed on different Data Structures?

Insertion − Add a new data item in the given collection of data items.
Deletion − Delete an existing data item from the given collection of data items.
Traversal − Access each data item exactly once so that it can be processed.
Searching − Find out the location of the data item if it exists in the given collection of data items.
Sorting − Arranging the data items in some order i.e. in ascending or descending order in case of numerical data and in dictionary order in case of alphanumeric data.

How is an Array different from Linked List?

The size of the arrays is fixed, Linked Lists are Dynamic in size.
Inserting and deleting a new element in an array of elements is expensive, Whereas both insertion and deletion can easily be done in Linked Lists.
Random access is not allowed in Linked Listed.
Extra memory space for a pointer is required with each element of the Linked list.
Arrays have better cache locality that can make a pretty big difference in performance.

What is Stack and where it can be used?

Stack is a linear data structure which the order LIFO(Last In First Out) or FILO(First In Last Out) for accessing elements. Basic operations of stack are : Push, Pop , Peek

Applications of Stack:

Infix to Postfix Conversion using Stack
Evaluation of Postfix Expression
Reverse a String using Stack
Implement two stacks in an array
Check for balanced parentheses in an expression

What is a Queue, how it is different from stack and how is it implemented?

Queue is a linear structure which follows the order is First In First Out (FIFO) to access elements. Mainly the following are basic operations on queue: Enqueue, Dequeue, Front, Rear
The difference between stacks and queues is in removing. In a stack we remove the item the most recently added; in a queue, we remove the item the least recently added. Both Queues and Stacks can be implemented using Arrays and Linked Lists.

What are Infix, prefix, Postfix notations?

Infix notation: X + Y – Operators are written in-between their operands. This is the usual way we write expressions. An expression such as
A * ( B + C ) / D
Postfix notation (also known as “Reverse Polish notation”): X Y + Operators are written after their operands. The infix expression given above is equivalent to
A B C + * D/
Prefix notation (also known as “Polish notation”): + X Y Operators are written before their operands. The expressions given above are equivalent to
/ * A + B C D
Converting between these notations: Click here

What is a Linked List and What are its types?

A linked list is a linear data structure (like arrays) where each element is a separate object. Each element (that is node) of a list is comprising of two items – the data and a reference to the next node.Types of Linked List :

Singly Linked List : In this type of linked list, every node stores address or reference of next node in list and the last node has next address or reference as NULL. For example 1->2->3->4->NULL
Doubly Linked List : Here, here are two references associated with each node, One of the reference points to the next node and one to the previous node. Eg. NULL<-1<->2<->3->NULL
Circular Linked List : Circular linked list is a linked list where all nodes are connected to form a circle. There is no NULL at the end. A circular linked list can be a singly circular linked list or doubly circular linked list. Eg. 1->2->3->1 [The next pointer of last node is pointing to the first]

Which data structures are used for BFS and DFS of a graph?

Queue is used for BFS
Stack is used for DFS. DFS can also be implemented using recursion (Note that recursion also uses function call stack).

Can doubly linked be implemented using a single pointer variable in every node?
Doubly linked list can be implemented using a single pointer. See XOR Linked List – A Memory Efficient Doubly Linked List

How to implement a stack using queue?

A stack can be implemented using two queues. Let stack to be implemented be ‘s’ and queues used to implement be ‘q1’ and ‘q2’. Stack ‘s’ can be implemented in two ways:

Method 1 (By making push operation costly)
Method 2 (By making pop operation costly) See Implement Stack using Queues

How to implement a queue using stack?

A queue can be implemented using two stacks. Let queue to be implemented be q and stacks used to implement q be stack1 and stack2. q can be implemented in two ways:

Method 1 (By making enQueue operation costly)
Method 2 (By making deQueue operation costly) See Implement Queue using Stacks

Which Data Structure Should be used for implementiong LRU cache?

We use two data structures to implement an LRU Cache.

Queue which is implemented using a doubly linked list. The maximum size of the queue will be equal to the total number of frames available (cache size).The most recently used pages will be near front end and least recently pages will be near rear end.
A Hash with page number as key and address of the corresponding queue node as value. See How to implement LRU caching scheme? What data structures should be used?

How to check if a given Binary Tree is BST or not?
If inorder traversal of a binary tree is sorted, then the binary tree is BST. The idea is to simply do inorder traversal and while traversing keep track of previous key value. If current key value is greater, then continue, else return false. See A program to check if a binary tree is BST or not for more details.


ATTRA INOFTECH ( CALL BASED THROUGH FRESHERWORLD 2017 BATCH )

DRIVE DATE 4-4-2018

1st was written aptitude i cleared
2nd was gd topic indian cinema i cleared
2rd was Technical F2F they asked on basic topic of java with a program and project i clread and now 2 more round left techncal F2F 2 and a HR round really for fresher it is like a dream job to get

*************************************************************************
https://www.glassdoor.co.in/Interview/Attra-Interview-Questions-E466556.htm
***************************************************************************
Time and Distance
Time and Work
Compound Interest
Partnership
Problems on Ages
Clock
Area
Permutation and Combination
Problems on Numbers
Decimal Fraction
***********************************************************************
GD TOPIC
*********************************************************
Are digital payments secure enough for the Indian economy to go cashless?
Ban 500, 1000 notes – Corruption Uprooted or just changing clothes!
Can we dream of hosting the Olympics?
Chinese Goods vs Indian Goods
Do we really need Smart Cities?
Economic growth is more important than Ecological protection
EQ or IQ
*********************************************************

1. What is the MAIN benefit of designing tests early in the life cycle?
It helps prevent defects from being introduced into the code.

2. What is risk-based testing?

Risk-based Testing is the term used for an approach to creating a Test Strategy that is based on prioritizing tests by risk. The basis of the approach is a detailed risk analysis and prioritizing of risks by risk level. Tests to address each risk are then specified, starting with the highest risk first.

3. What is the KEY difference between preventative and reactive approaches to testing?

Preventative tests are designed early; reactive tests are designed after the software has been produced.

4. What is the purpose of exit criteria?

The purpose of exit criteria is to define when a test level is completed.

5. What determines the level of risk?

The likelihood of an adverse event and the impact of the event determine the level of risk.

6. When is used Decision table testing?

Decision table testing is used for testing systems for which the specification takes the form of rules or cause-effect combinations. In a decision table the inputs are listed in a column, with the outputs in the same column but below the inputs. The remainder of the table explores combinations of inputs to define the outputs produced.

Learn More About Decision Table Testing Technique in the Video Tutorial here

7. What is the MAIN objective when reviewing a software deliverable?

To identify defects in any software work product.

8. Which of the following defines the expected results of a test? Test case specification or test design specification.

Test case specification defines the expected results of a test.

9. What is the benefit of test independence?

It avoids author bias in defining effective tests.

10. As part of which test process do you determine the exit criteria?

The exit criteria is determined on the bases of ‘Test Planning’.

11. What is beta testing?

Testing performed by potential customers at their own locations.

12. Given the following fragment of code, how many tests are required for 100% decision coverage?

if width > length

thenbiggest_dimension = width

if height > width

thenbiggest_dimension = height

end_if

elsebiggest_dimension = length

if height > length

thenbiggest_dimension = height

end_if

end_if

4

13. You have designed test cases to provide 100% statement and 100% decision coverage for the following fragment of code. if width > length then biggest_dimension = width else biggest_dimension = length end_if The following has been added to the bottom of the code fragment above. print “Biggest dimension is ” &biggest_dimensionprint “Width: ” & width print “Length: ” & length How many more test cases are required?

None, existing test cases can be used.

14. Rapid Application Development?

Rapid Application Development (RAD) is formally a parallel development of functions and subsequent integration. Components/functions are developed in parallel as if they were mini projects, the developments are time-boxed, delivered, and then assembled into a working prototype. This can very quickly give the customer something to see and use and to provide feedback regarding the delivery and their requirements. Rapid change and development of the product is possible using this methodology. However the product specification will need to be developed for the product at some point, and the project will need to be placed under more formal controls prior to going into production.

15. What is the difference between Testing Techniques and Testing Tools?

Testing technique: – Is a process for ensuring that some aspects of the application system or unit functions properly there may be few techniques but many tools.

Testing Tools: – Is a vehicle for performing a test process. The tool is a resource to the tester, but itself is insufficient to conduct testing

Learn More About Testing Tools here

16. We use the output of the requirement analysis, the requirement specification as the input for writing …

User Acceptance Test Cases

17. Repeated Testing of an already tested program, after modification, to discover any defects introduced or uncovered as a result of the changes in the software being tested or in another related or unrelated software component:

Regression Testing

18. A wholesaler sells printer cartridges. The minimum order quantity is 5. There is a 20% discount for orders of 100 or more printer cartridges. You have been asked to prepare test cases using various values for the number of printer cartridges ordered. Which of the following groups contain three test inputs that would be generated using Boundary Value Analysis?

4, 5, 99

19. What is component testing?

Component testing, also known as unit, module and program testing, searches for defects in, and verifies the functioning of software (e.g. modules, programs, objects, classes, etc.) that are separately testable. Component testing may be done in isolation from the rest of the system depending on the context of the development life cycle and the system. Most often stubs and drivers are used to replace the missing software and simulate the interface between the software components in a simple manner. A stub is called from the software component to be tested; a driver calls a component to be tested.

Here is an awesome video on Unit Testing

20. What is functional system testing?

Testing the end to end functionality of the system as a whole is defined as a functional system testing.

21. What are the benefits of Independent Testing?

Independent testers are unbiased and identify different defects at the same time.

22. In a REACTIVE approach to testing when would you expect the bulk of the test design work to be begun?

The bulk of the test design work begun after the software or system has been produced.

23. What are the different Methodologies in Agile Development Model?

There are currently seven different agile methodologies that I am aware of:

Extreme Programming (XP)
Scrum
Lean Software Development
Feature-Driven Development
Agile Unified Process
Crystal
Dynamic Systems Development Model (DSDM)
24. Which activity in the fundamental test process includes evaluation of the testability of the requirements and system?

A ‘Test Analysis’ and ‘Design’ includes evaluation of the testability of the requirements and system.

25. What is typically the MOST important reason to use risk to drive testing efforts?

Because testing everything is not feasible.

26. What is random/monkey testing? When it is used?

Random testing often known as monkey testing. In such type of testing data is generated randomly often using a tool or automated mechanism. With this randomly generated input the system is tested and results are analysed accordingly. These testing are less reliable; hence it is normally used by the beginners and to see whether the system will hold up under adverse effects.

Grasko Solution Private Limited ( CALL BASED 2016, 2017 )

QA PROFILE

DRIVE DATE 7TH APRIL

ONLY THOSE WHO CLEAR WRITTEN TEST

Address: 11, 29th Main Rd, MCHS Colony, Stage 2, BTM Layout, Bengaluru, Karnataka 560076

*******************************************************************
FOR INTERVIEW QUESTION CHECK THESE LINKS
******************************************************************************************

How to prepare for a Software Testing/QA interview?
Ans. Click the above link to know – Where should I start with for the interview preparation? It’s almost 2 years now since I have faced any interview.

Q. Mock test to judge your Software Testing Interview Skills
Ans. Take this mock test paper which will be helpful for you to prepare for a testing interview as well as the CSTE certification exam. Click the above link for questions and answers.

Q. Different Automation Testing Interview Questions
Ans. Click the above link for Automation Interview questions like Difference between Winrunner and Test Director, What is TSL? What is 4GL and is it similar too?

Q. What is the difference between Performance Testing, Load Testing, and Stress Testing? Explain with examples?
Ans. Many people are confused with these testing terminologies. Click here for the detailed explanation of Performance, Load and Stress Testing with examples.

Q. ISTQB questions and answers (more questions here and also here)
Ans. Click the above links to read about ISTQB paper pattern and tips on how to solve these questions quickly. ISTQB ‘Foundation level’ sample questions with answers are found here.

Q. QTP interview questions
Ans. Quick Test Professional: Interview Questions and answers are found in the above link.

Q. CSTE questions with answers

Ans. Click the above link for questions and answers about CSTE.

Q. What is Desk checking and Control Flow Analysis
Ans. Click here for answers about Desk checking and Control Flow Analysis along with the examples.

Q. What is Sanity Test (or) Build test?
Ans. Verifying the critical (important) functionality of the software on a new build to decide whether to carry further testing or not is termed as Sanity Test.

Q. What is the difference between client-server testing and web-based testing
Ans. Click here for the answer.

Q. What is Black Box testing?
Ans. Black box testing is explained with types in the above link.

Q. What is White Box testing?
Ans. Click here for the post explaining about white box testing along with its types

Q. What are the different Types of Software Testing?
Ans. Click the above link to refer the post explaining all Software Testing Types in detail.

Q. How to define a standard process for the entire testing flow, Explain the challenging situations in Manual Testing career, What is the best way to go about getting a pay rise.
Ans.Click the above link for the answers to these questions.

Q. What is the most challenging situation you ever had during Testing?
Q. How to perform testing when there are no documents?
Ans. Click here for the detailed post on how to answer these QA interview questions.

*********************

Popular Web Testing Interview Questions and Answers
As the name itself defines, Web testing means testing the web applications for any potential bugs or issues, before the web application is moved to the production environment i.e. before making any Web application live.

Based on web testing requirements, there are various factors that should be considered into. These factors include web application securities, TCP/IP communications, ability to handle traffic, firewalls, etc.

Web testing includes Functional testing, Usability testing, Security testing, Interface testing, Compatibility testing, Performance testing etc., in its checklist.

Web Testing Interview Questions

We will take a look at the most common Web Testing interview questions and answers which will guide you to get prepared for any web testing interview.

Given below is the list of most commonly asked web testing interview.

Q #1) What do you understand by web application?

Answer: Web application is a means to communicate and exchange information with the customers. Unlike any desktop applications which are executed by an operating system, a web application runs on a web server and is accessed by a web browser which acts as a client.

The best Example of a web application is ‘Gmail’. In Gmail, the interaction done by an individual user is completely independent of the others. You can send and receive information through emails and also through attachments.

You can maintain documents in a drive, maintain spreadsheets in Google docs and includes much more such features which make a user realize that they have an environment which is customized to their specific identity.

Q #2) Define a Web server.

Answer: Web server follows the client/server model where the program uses HTTP (Hypertext Transfer Protocol). In response to the request of a HTTP client, web server handles client and server side validation and delivers the web content in the form of web pages to the users.

The browsers we use, such as Safari, Chrome, Internet Explorer, Firefox etc., read the files stored on the web servers and bring the information to us in the form of images and texts with the means of internet. Any computer which hosts websites must have web servers.

Some of the leading web servers are:

Apache
Microsoft’s Internet Information Server (IIS)
Java web server
Google web server
Web Server

Q #3) Enlist some important test scenarios for testing a website.

Answer: There are many parameters that should be considered while deciding the important test scenarios for testing any website. Also, the type of website to be tested and its requirement specification plays an important role here.

Enlisted below are few important test scenarios that are applicable for testing any type of website:

Test the GUI (Graphical User Interface) of the website for checking the consistency of the design elements and page layout.
All page links and hyperlinks are checked for their redirection to the desired page.
In case of presence of any forms or fields on the website, testing scenarios consist of testing with valid data, invalid data, testing with existing records as well as testing with empty records.
Functionality testing as per the requirement specification is done.
Performance of a website is tested under heavy loads to determine the web server response time and database query time.
Compatibility testing is done to test the behavior of an application on a different browser and OS (operating system) combinations.
Usability testing and Database testing is also performed as a part of test scenarios.
Q #4) What are the different configurations which have to be considered while testing a website?

Answer: Different configuration includes different browsers as well as an operating system on which a website is being tested. Browser plugins, text size, video resolution, color depth, browser setting option also come under consideration when we talk about configurations.

Different combinations of browsers and operating system are used to test the compatibility of the website. Usually, the latest and the last latest versions are included. Well, these versions are usually specified in the requirement documents.

Few important Browsers include:

Internet Explorer
Firefox
Chrome
Safari
Opera
Few important Operating systems include:

Windows
UNIX
LINUX
MAC
Q #5) Is Web application testing different from Desktop Application testing? Explain how.

Answer: Yes, there is a lot of difference between web application and desktop application.

This can be explained with the help of the below-mentioned table:

Web Application

Desktop Application

Definition Web applications are the one which can run on any client machine having the internet connection without any installation of the execution file. Desktop applications are one which are separately installed and executed on the personal computer.
Performance User actions, feedback, statistics can be easily monitored as well as data updating in one place is reflected everywhere in web application. User actions cannot be monitored as well as changes in data can be only reflected at the machine.
Connectivity
Web application can be accessed on any PC having internet connection using web browser where performance of the application depends on internet speed. Desktop application can be only accessed on specific PC where application is installed.
Security Risks

Web application is more prone to security threats as applications can be accessed by anyone on the internet. Desktop application is less prone to security threats where user can keep a check on security issues at the system level.
User data
User data is saved and accessed remotely in case of web applications. Data is stored, saved and accessed from the same machine on which application is installed.
Q #6) What is Intranet Application?

Answer: Intranet application is a kind of private application which is deployed and run on local LAN server and can only be accessed by the people within the organization. It uses local network to share information.

Example: Organization usually has an application which stores information about your attendance, holidays, upcoming celebrations within the organization or some important event or information that needs to be circulated within the organization.

Q #7) Explain the difference between Authorization and Authentication in Web testing.

Answer: The difference between Authorization and Authentication is explained in below table:

Authentication Authorization

1 Authentication is the process with which the system identifies who the user is? Authorization is the process with which system identifies what user is authorized to do?
2 Authentication determines the identity of the user. Authorization decides the privileges given to the user i.e. whether the user can access or manipulate features of certain program.
3 There are different types of authentications, like password based, device based, etc. There are two types of authorizations, like read only and read write both.

4 For example: Within an organization, each and every employee can login into an intranet application. For example: Only account manager or person in accounts department can access account section.
Q #8) What are the types of Web testing security problems?

Answer: Few web security problems include:

Denial of Service (DOS) attack
Buffer overflow
Directly passing internal URL through browser address
Viewing other stats
Q #9) Define HTTP.

Answer: HTTP stands for Hypertext Transfer Protocol. HTTP is the data transfer protocol which defines how messages are formatted and transferred over World Wide Web. HTTP also determines the response of the actions performed by web servers and browsers.

For Example, when an URL is entered on the web browser, the HTTP command is sent to the web server which in turn fetches the requested web browser.

Q #10) Define HTTPS.

Answer: HTTPS stands for Hypertext Transfer Protocol Secure. This is basically HTTP over SSL (Secure Socket Layer) for security purposes. There is always chances of eavesdrop on data being transferred between a user and the web server when the website uses HTTP protocol.

Therefore, websites use secure way i.e. SSL encryption of data sent back and forth using HTTPS protocol. Almost all the websites that require user log in uses HTTPS protocol. Few Examples are banking websites, e-commerce websites, etc.

Q #11) What are the common problems faced in Web testing?

Answer: Some of the common problems faced in web testing are enlisted below:

Server Problem, which includes server down and server under maintenance problems.
Database connection problem.
Hardware and browser compatibility problems.
Security related problems.
Performance and load related problems.
GUI (graphical user interface) related problems.
Q #12) What is Cookie testing?

Answer: Cookie is said to be a personalized user’s identity or information which is required to communicate between different web pages as well as track user’s navigation through the website pages. Whenever we access any website on any web browser, their respective cookie is written on the hard disk.

Cookies are used to track user sessions, displays ads, remember user’s choice while accessing any website, remember and retrieve user’s shopping cart, track the unique number of visitors, etc.

Suppose an e-commerce site is accessible in many countries like US, Canada, Australia and their testing is done in India. In that case, while testing the e-commerce site for different countries in India, at first respective countries cookies is set so that actual data like time zone etc., are accessed of that particular country.

Q #13) Define Client-side validation.

Answer: Client-side validation is the one which is basically done at the browser level where user’s input is validated at the browser itself with no involvement of the server.

Let’s understand it with the help of an Example.

Suppose a user is entering an incorrect email format while filling a form. The browser will then and there prompt an error message to correct it before moving on to next field. Thus every field is corrected before submitting the form.

The client-side validation is usually done by script language such as JavaScript, VBScript, HTML 5 attributes.

The two types of Client-side validation are:

Field level validation
Form level validation
Q #14) What do you understand by Server-side validation?

Answer: Server-side validation occurs where the validation and processing of user requests require the response from the server. To understand it more clearly, user’s input is being sent to the server and validation is done using server-side scripting languages such as PHP, Asp.NET, etc.

After the validation process, feedback is sent back to the client in the form of dynamically generated web page.

When compared to the Client Side validation process, Server side validation process is more secure because here application is protected against malicious attacks and users can easily bypass client-side scripting language.

Q #15) Differentiate between Static and Dynamic website.

Answer: Difference between static and dynamic websites are as follows:

Static Website

Dynamic website

Static websites are the one which gives out information only and there is no sort of interaction between the user and the website. Dynamic websites are the one where user interaction is possible between the website and user along with imparting information.
Static websites are cheapest to develop and host. Dynamic websites are more expensive to develop as well as their hosting cost is also more.
Static websites are easily loaded on client browser because of its fixed content and no database connectivity. Dynamic websites usually take the time to load on client browser because contents to display are dynamically created and retrieved using database queries.
Static websites can be created from HTML, CSS and does not require any server application language. Dynamic websites require server application language like ASP.NET, JSP, PHP to run the application on the server and display the output on the webpage.
Change in the content of the page of any static website; require being uploaded on server many times. Dynamic website provides facilities to change the page content using server application.
Q #16) What do you understand by Client-Server testing?

Answer: Client-server application is the one where the application itself is loaded or installed on a server whereas application EXE file is loaded on all client machines. This environment is usually used in Intranet networks.

Following tests are performed on a Client-server application:

GUI testing on both client and server systems.
Client-server interaction.
The functionality of an application.
Load and performance testing.
Compatibility testing.
All the test cases and test scenarios used in client-server application testing is derived from the tester’s experience and requirement specifications.

Q #17) Enlist HTTP response codes that are returned by the server.

Answer: HTTP response codes are enlisted below:

2xx – This means ‘Success’
3xx- This means ‘Redirection’
4xx- This means ‘Application error’
5xx- This means ‘Server error’
Q #18) What is the role of Usability testing in Web testing?

Answer: In web testing, Usability testing plays an important role. It is well known that usability testing is the means to determine the ease with which an end user can easily access the application with or without having any programming language knowledge.

In terms of web testing, usability testing comprises of the following:

To check whether the website is user-friendly?
Is the end user able to easily navigate within the application?
Presence of any issues or ambiguity which can hinder the user experience.
Check how quickly the user is able to complete the task within the application.
Q #19) What are the available environments on Web?

Answer: The different types of the environment on Web are:

Intranet (Local Network)
Internet (Wide Area Network)
Extranet(Private network over the internet)
Q #20) What are the test case formats in case of a Static website and Dynamic website?

Answer: The following test case formats will be used in case of Static websites:

Front-end test cases
Navigation test cases
The following test case formats will be used in case of Dynamic websites:

Front-end test cases
Back-end test cases
Navigation test cases
Field validation test cases
Security test cases, etc.
Q #21) Enlist some sub-classes of HTTP response objects?

Answer: Write, Flush, tell, etc are few HTTP response objects.

The sub-classes of HTTP response are:

HttpResponseRedirect
HttpResponsePermanentRedirect
HttpResponseBadRequest
HttpResponseNotfound
Q #22) Enlist some Web Testing Tools.

Answer: Few Web testing tools are enlisted below:

eggplant functional
Selenium
SOA test
JMeter
iMacros, etc.
Q #23) Give some examples of web applications that are used in our day to day life.

Answer: Few Examples include:

Web portals like eBay, Amazon, Flipkart etc.
Banking applications like ICICI, Yes Bank, HDFC, Kotak Mahindra etc.
Email service providers like Gmail, Yahoo, Hotmail etc.
Social Networks like Facebook, Twitter, LinkedIn etc.
Discussion and Information forums like www.Softwaretestinghelp.com
Q #24) What is a Proxy server?

Answer: Proxy server is a server which acts as an intermediary or is the one that lies between the client and the main server.

The communication between the main server and client-server is done through a proxy server as the client request of any connection, file, resources from the main server is sent through a proxy server and again the response from the main server or local cached memory to client-server is done through the proxy server.

Some of the most common proxy servers based on their purpose and functionality are listed below:

Transparent proxy
Web proxy
Anonymous proxy
Distorting proxy
High anonymity proxy
The proxy server is basically used for the following purposes:

To improve the performance of web response.
In case of presence of a document in a cache memory, the response is directly sent to the client.
Proxy server filters web page content in the form of web proxies.
A proxy server is also used to block offensive web content to be accessed by the user especially in an organization, school, and college.
Web proxies prevent the attack of computer viruses and malware.
Q #25) What is Database server?

Answer: A Database server can be defined as a server that refers to the back-end system of a database application that provides database services such as accessing and retrieving data from the database.

Database server uses client/server architecture where the data can be accessed either through the database server by a “front end” which runs and displays data on user’s machine or “back end” which runs on the database server itself.

A database server is like a data warehouse and also holds on Database Management System (DBMS).

*********************

Few More Basic Software Testing Interview Questions
Q. What is Dynamic Testing?
Ans. It is the testing done by executing the code or program with various input values and later on the output is verified.

Q. What is GUI Testing?
Ans. GUI or Graphical user interface testing is the process of testing the software user interface against the provided requirements/mockups/HTML designs etc.,

Q. What is Formal Testing?
Ans. Software verification carried out by following a test plan, testing procedures and proper documentation with an approval from the customer is termed as Formal Testing.

Q. What is Risk Based Testing?
Ans. Identifying the critical functionality in the system and then deciding the orders in which these functionalities are to be tested and applying testing after that is termed as Risk-based Testing.

Q. What is Early Testing?
Ans. Conducting testing as soon as possible in the development lifecycle to find defects at early stages of STLC. Early testing is helpful to reduce the cost of fixing defects at the later stages of STLC.

Q. What is Exhaustive Testing?
Ans. Testing functionality with all valid, invalid inputs and pre-conditions is called Exhaustive testing.

Q. What is Defect Clustering?
Ans. Any small module or functionality may contain a number of defects – concentrating more on testing these functionalities is known as Defect Clustering.

Q. What is Pesticide Paradox?
Ans. If prepared test cases are not finding defects, add/revise test cases to find more defects, this is known as Pesticide Paradox.

Q. What is Static Testing?
Ans. Manual verification of the code without executing the program is called as Static Testing. In this process, the issues are identified in the code by checking code, requirement and design documents.

Q. What is Positive Testing?
Ans. It is the Testing which is conducted on the application to determine if the system works properly. Basically known as “test to pass” approach.

Q. What is Negative Testing?
Ans. Testing Software with a negative approach to check if the system is not “showing error when not supposed to” and “not showing error when supposed to” is termed as Negative Testing.

Q. What is an End-to-End Testing?
Ans. Testing the overall functionality of the system including the data integration among all the modules is called End-to-End Testing.

Q. What is Exploratory Testing?
Ans. Exploring the application, understanding its functionalities, adding (or) modifying the existing test cases for better testing is called Exploratory testing.

Q. What is Monkey Testing?
Ans. Testing conducted on an application without any plan and carried out randomly with the tests to find any system crash with an intention of finding tricky defects is called Monkey Testing.

Q. What is Non-Functional Testing?
Ans. Validating various non-functional aspects of the system such as user interfaces, user-friendliness, security, compatibility, Load, Stress, and Performance etc., is called Non-Functional testing.

Q. What is Usability Testing?
Ans. Checking how easily the end users are able to understand and operate the application is called Usability Testing.

Q. What is Security Testing?
Ans. Validating whether all security conditions are properly implemented in the software (or) not is called Security testing.

Q. What is Performance Testing?
Ans. The process of measuring various efficiency characteristics of a system such as response time, load stress transactions per minutes, transaction mix etc., is termed as Performance Testing.

Q. What is Load Testing?
Ans. Analyzing both the functional and performance behavior of an application under various conditions is called Load Testing.

Q. What is Stress Testing?
Ans. Checking the application behavior under stress conditions
(or)
Reducing the system resources and keeping the load as constant and checking how the application is behaving is called Stress Testing.

Q. What is Process?
Ans. A process is a set of practices performed to achieve a given purpose; it may include tools, methods, materials or people.

Q. What is Software Configuration Management?
Ans. The process of identifying, Organizing and controlling changes to the Software development and maintenance.
(or)
It is a methodology to control and manage a software development project.

Q. What is a Testing Process / LifeCycle?
Ans. It includes the below factors:

Writing a Test Plan
Test Scenarios
Test Cases
Executing the Test Cases
Test Results
Defect Reporting
Defect Tracking
Defect Closing
Test Release

Q. What is full form of CMMI?
Ans. Capability Maturity Model Integration

Q. What is a Code Walk Through?
Ans. An informal analysis of the program source code to find the defects and verify the coding techniques is termed so.

Q. What is Unit Level Testing?
Ans. Testing of single programs, modules or unit of code is termed as Unit Level Testing.

Q. What is Integration Level Testing?
Ans. Testing of related programs, Modules (or) Unit of code.
(or)
Partitions of the system which is ready for testing with other partitions of the system is termed so.

Q. What is System Level Testing?
Ans. Testing of the entire computer system across all the modules is termed so. This kind of testing can include Functional as well as Structural Testing.

Q. What is Alpha Testing?
Ans. Testing of a whole computer system before rolling out to the UAT is termed so.

Q. What is User Acceptance Testing (UAT)?
Ans. Testing of a computer system by the client to verify if it adhered to the provided requirements.

Q. What is a Test Plan?
Ans. It is a document describing the scope, approach, resources, and schedule of testing activities. It identifies test items, features to be tested, testing tasks, who will do each task, and any risks requiring contingency planning.

Q. What is a Test Scenario?
Ans. Identifying all the possible areas to be tested (or) what is to be tested is termed so.

Q. What is ECP (Equivalence Class Partition)?
Ans. It is a method for deriving test cases.

Q. What is a Defect?
Ans. Any flaw or imperfection in a software work product is termed as a Defect.
(or)
When the expected result does not match with the application actual result, it is termed so.

Q. What is Severity?
Ans. It defines the importance of the defect from the functional point of view i.e. how critical is a defect with respect to the application.

Q. What is Priority?
Ans. It indicates the importance or urgency of fixing a defect

Q. What is Re-Testing?
Ans. Re-testing the application means verifying whether the defects have been fixed or not.

Q. What is Regression Testing?
Ans. Verifying an existing functional and non-functional area after making changes to the part of a software or addition of new features is termed so.

Q. What is Recovery Testing?
Ans. Checking whether the system is able to handle some unexpected or unpredictable situations is called Recovery Testing.

Q. What is Globalization Testing?
Ans. It is the process of verifying whether a software can be run independently of its geographical and cultural environment. Checking if the application is having features of setting and changing language, date, format, and currency if it is designed for global users.

Q. What is Localization Testing?
Ans. Verifying globalized application for a particular locality of users, under cultural and geographical conditions is termed so.

Q. What is Installation Testing?
Ans. Checking whether we are able to install a software successfully (or) not, as per the guidelines given in the installation document is called Installation Testing.

Q. What is Un-Installation Testing?
Ans. Checking whether we are able to uninstall the software from the system successfully (or) not is called Un-Installation Testing

Q. What is Compatibility Testing?
Ans. Checking whether the application is compatible with different software and hardware environment or not is called Compatibility Testing.

Q. What is a Test Strategy?
Ans. It is a part of a test plan describing how testing is carried out for the project and what testing types need to be performed on the application.

Q. What is a Test Case?
Ans. A Test case is a set of pre-conditional steps to be followed with input data and expected behavior to validate the functionality of a system.

Q. What is Business Validation Test Case?
Ans. A test case which is prepared to check the business condition or a business requirement is called Business Validation test case.

Q. What is a Good Test Case?
Ans. A Test case that has the high priority of catching defects is called a Good Test Case.

Q. What is Use Case Testing?
Ans. Validating a software to confirm whether it is developed as per the use cases or not is called Use Case testing.

Q. What is a Defect Age?
Ans. The time gap between the date of detection & the date of closure of a defect is termed so.

Q. What is Showstopper Defect?
Ans. A defect which is not permitting to continue further with testing is called Showstopper Defect.

Q. What is a Test Closure?
Ans. It is the last phase of the STLC, where the management prepares various test summary reports that explain the complete statistics of the project based on the testing carried out.

Q. What is Bucket Testing?
Ans. Bucket testing is also known as A/B testing. It is mostly used to study the impact of various product designs in the website metrics. Two simultaneous versions are run on a single or a set of web pages to measure the difference in click rates, interface, and traffic.

Q. What is meant by Entry Criteria and Exit Criteria in Software Testing?
Ans. Entry Criteria is the process that must be present when a system begins, like,
SRS – Software
FRS
Use Case
Test Case
Test Plan
Exit criteria ensure whether the testing is completed and the application is ready for release, like,
Test Summary Report,
Metrics
Defect Analysis Report.

Q. What is Concurrency Testing?
Ans. This is a multiple user testing to access the application at the same time to verify the effect on code, module or DB and it is mainly used to identify the locking and deadlocking situations in the code.

Q. What is Web Application Testing?
Ans. Web application testing is done on a website to check – load, performance, security, Functionality, Interface, Compatibility and other usability-related issues.

Q. What is Unit Testing?
Ans. Unit testing is done to check whether the individual modules of the source code are working properly or not.

Q. What is Interface Testing?
Ans. Interface testing is done to check whether the individual modules are communicating properly as per the specifications or not. Interface testing is mostly used to test the user interface of GUI applications.

Q. What is Gamma Testing?
Ans. Gamma testing is done when the software is ready for release with the specified requirements, this testing is done directly by skipping all the in-house testing activities.

Q. What is Test Harness?
Ans. Test Harness is configuring a set of tools and test data to test an application under various conditions, which involves monitoring the output with the expected output for correctness.
The benefits of Testing Harness are: Productivity increase due to process automation and increase in the product quality

Q. What is Scalability Testing?
Ans. It is used to check whether the functionality and performance of a system are capable to meet the volume and size changes as per the requirements.
Scalability testing is done using load test by changing various software, hardware configurations, and testing environment.

Q. What is Fuzz Testing?
Ans. Fuzz testing is a black box testing technique which uses a random bad data to attack a program to check if anything breaks in the application.

Q. What is Difference between QA, QC, and Testing?
Ans. QA?
It is process oriented and its Aim is to prevent the defects in an application.

QC?
QC is product oriented and it is a Set of activities used to evaluate a developed work product

Testing?
Executing and verifying an application with the intention of finding defects.

Q. What is Date Driven Testing?
Ans. It is an Automation testing process in which an application is tested with multiple sets of data with different preconditions as an input to the script.

mindteck company ( call based cocube 2017 batch )

drive date 5th april
THROUGH COCUBE

Address: A.M.R. Tech Park, Block -1, 3rd Floor, # 664, 23/24, Hosur Rd, Bommanahalli, Bengaluru, Karnataka 560068
********************************************
Techincal interview question
*************************************
java, jquery, dbms
**************************

Q1. Explain JVM, JRE and JDK?
JVM (Java Virtual Machine): It is an abstract machine. It is a specification that provides run-time environment in which java bytecode can be executed. It follows three notations:

Specification: It is a document that describes the implementation of the Java virtual machine. It is provided by Sun and other companies.
Implementation: It is a program that meets the requirements of JVM specification.
Runtime Instance: An instance of JVM is created whenever you write a java command on the command prompt and run the class.
JRE (Java Runtime Environment) : JRE refers to a runtime environment in which java bytecode can be executed. It implements the JVM (Java Virtual Machine) and provides all the class libraries and other support files that JVM uses at runtime. So JRE is a software package that contains what is required to run a Java program. Basically, it’s an implementation of the JVM which physically exists.

JDK(Java Development Kit) : It is the tool necessary to compile, document and package Java programs. The JDK completely includes JRE which contains tools for Java programmers. The Java Development Kit is provided free of charge. Along with JRE, it includes an interpreter/loader, a compiler (javac), an archiver (jar), a documentation generator (javadoc) and other tools needed in Java development. In short, it contains JRE + development tools.

Refer to this below image and understand how exactly these components reside:

Q2. Explain public static void main(String args[]).
public : Public is an access modifier, which is used to specify who can access this method. Public means that this Method will be accessible by any Class.
static : It is a keyword in java which identifies it is class based i.e it can be accessed without creating the instance of a Class.

void : It is the return type of the method. Void defines the method which will not return any value.

main: It is the name of the method which is searched by JVM as a starting point for an application with a particular signature only. It is the method where the main execution occurs.

String args[] : It is the parameter passed to the main method.

Q3. Why Java is platform independent?
Platform independent practically means “write once run anywhere”. Java is called so because of its byte codes which can run on any system irrespective of its underlying operating system.

Q4. Why java is not 100% Object-oriented?
Java is not 100% Object-oriented because it makes use of eight primitive datatypes such as boolean, byte, char, int, float, double, long, short which are not objects.

Q5. What are wrapper classes?
Wrapper classes converts the java primitives into the reference types (objects). Every primitive data type has a class dedicated to it. These are known as wrapper classes because they “wrap” the primitive data type into an object of that class. Refer to the below image which displays different primitive type, wrapper class and constructor argument.

WrapperClass – Java Interview Questions – Edureka

Q6. What are constructors in Java?
In Java, constructor refers to a block of code which is used to initialize an object. It must have the same name as that of the class. Also, it has no return type and it is automatically called when an object is created.

There are two types of constructors:

Default constructor
Parameterized constructor
Q7. What is singleton class and how can we make a class singleton?
Singleton class is a class whose only one instance can be created at any given time, in one JVM. A class can be made singleton by making its constructor private.

Q8. What is the difference between Array list and vector?
Array List Vector
Array List is not synchronized. Vector is synchronized.
Array List is fast as it’s non-synchronized. Vector is slow as it is thread safe.
If an element is inserted into the Array List, it increases its Array size by 50%. Vector defaults to doubling size of its array.
Array List does not define the increment size. Vector defines the increment size.
Array List can only use Iterator for traversing an Array List. Except Hashtable, Vector is the only other class which uses both Enumeration and Iterator.
Q9. What is the difference between equals() and == ?
Equals() method is defined in Object class in Java and used for checking equality of two objects defined by business logic.
“==” or equality operator in Java is a binary operator provided by Java programming language and used to compare primitives and objects. public boolean equals(Object o) is the method provided by the Object class. The default implementation uses == operator to compare two objects. For example: method can be overridden like String class. equals() method is used to compare the values of two objects.

public class Equaltest {
public static void main(String[] args) {
String str1= new String(“ABCD”);
String str2= new String(“ABCD”);
if(Str1 == str2)
{
System.out.println(“String 1 == String 2 is true”);
}
else
{
System.out.println(“String 1 == String 2 is false”);
String Str3 = Str2;
if( Str2 == Str3)
{
System.out.println(“String 2 == String 3 is true”);
}
else
{
System.out.println(“String 2 == String 3 is false”);
}
if(Str1.equals(str2))
{
System.out.println(“String 1 equals string 2 is true”);
}
else
{
System.out.prinltn(“String 1 equals string 2 is false”);
}
}}
Q10. What are the differences between Heap and Stack Memory?
The major difference between Heap and Stack memory are:

Features Stack Heap
Memory Stack memory is used only by one thread of execution. Heap memory is used by all the parts of the application.
Access Stack memory can’t be accessed by other threads. Objects stored in the heap are globally accessible.
Memory Management Follows LIFO manner to free memory. Memory management is based on generation associated to each object.
Lifetime Exists until the end of execution of the thread. Heap memory lives from the start till the end of application execution.
Usage Stack memory only contains local primitive and reference variables to objects in heap space. Whenever an object is created, it’s always stored in the Heap space.

Java doesn’t support multiple inheritance. Why?
Java doesn’t support multiple inheritance. Because we cannot use different methods in one class it creates an ambiguity.
Example:

class Intellipaat1
{
void test()
{
system.out.println(“test() method”);
}
}class Intellipaat2
{
void test()
{
system.out.println(“test() method”);
}
}Multiple inheritance
class C extends Intellipaat1, Intellipaat2
{
………………………………………….
…………………………………………..
}
Intellipaat1 and Intellipaat2 test() methods are inheriting to class C
So which test() method C class will take. As Intellipaat1 & Intellipaat2 class test () methods are different, So here we would face ambiguity.

18. Are constructors inherited? Can a subclass call the parent’s class constructor?
We cannot inherit a constructor. We create an instance of a subclass using a constructor of one of its superclass. Because override the superclass constructor is not our wish so that, we override a superclass constructor, then we destroy the encapsulation abilities of the language.

Check the insightful tutorial to learn more about Java Constructors.

Learn Java from Experts! Enrol Today

19. Define JSON?
Expansion of JSON is “JavaScript Object Notation”, It is a much lighter and readable alternative to XML. It is an independent and easily parse-able in all programming languages. It is primarily used for Communicating between client – server or server -server communication. It is a much lighter and readable alternative to XML.

20. What are the advantages of JSON over XML?
The advantages of JSON over XML are

JSON is Lighter and faster than XML
Better understandable.
Easy to parse and conversion to objects for information consumption.
Support multiple data types – JSON support string, number, array, Boolean but XML data are all strings.
21. Name the methods of Object Class?
clone() – This method helps to create and return a copy of the object.
equals() – This method helps to compare
finalize() – Called by the garbage collector on an object
getClass() – It helps to return the runtime class of an object.
hashCode() – Helps to return a hash code value for the object.
toString() – helps to return a string representation of the object.
notify(), notifyAll(), and wait() – It helps to synchronize the activities of independently running threads in a program.

Read this tutorial to learn more about Java Methods.

22. Define content negotiation?
If we have visited website to searching the information, we will get the information in different languages and in different formats when a client makes an HTTP request to a server, the client can also specify the media types here. The client can specify what it can accept back from the host and on the basis of availability the host will return to the client. This is known as content negotiation because client and server negotiated on the language and format of the content to be shared.

23. Can we import same package/class two times? Will the JVM load the package twice at runtime?
A package or class can be inherited multiple times in a program code. JVM and compiler will not create any issue. Moreover JVM automatically loads the class internally once regardless of times it is called in the program.

24. Define Abstract class?
A class which contains the abstract keyword in its declaration is known as abstract class. It can have abstract and non-abstract methods (method with body).

This class can have public, private, protected or constants and default variables.
It needs to be extended and its method implemented. It cannot be instantiated.
If a class has at least one abstract method, then the class must be declared abstract.
25. Describe the Annotations.
Java Annotations is a tag which symbolizes metadata associated with class, interface, methods, fields, etc.
Annotations do not directly influence the operations.
The additional information carried by annotations are utilized by java compiler and JVM.
26. Java doesn’t use pointers. Why?
Pointers are susceptible and slight carelessness in their use may result in memory problems and hence Java basically manages their use.

27. Distinguish between static loading and dynamic class loading?
Static loading – Classes are loaded statically with operator “new”.Dynamic class loading – It is a technique for programmatically invoking the functions of a class loader at run time. The syntax isClass.forName (Test className);

28. Explain Struts 1 Classes are not Thread Safe whereas Struts 2 classes are thread safe?
Struts 1 actions are a singleton. So all threads operate on the single action object and hence make it thread-unsafe.Struts 2 actions are not a singleton and a new action object copy are created each time a new action request is made and hence it threads safe.

29. Define JAXP & JAXB?
JAXP: – Stands for Java API for XML Processing. This provides a common interface for creating and using DOM, SAX, and XSLT APIs in Java regardless of which vendor’s implementation is actually being used.
JAXB: – It Stands for Java API for XML Binding. This standard defines a system for a script out Java objects as XML and for creating Java objects from XML structures.

30. Define an enumeration?
Usually, we called enumeration as an enum. An enumeration is an interface containing methods for accessing the original data structure from which the enumeration is obtained. It allows sequential access to all the elements stored in the collection.

31. How can we find the actual size of an object on the heap?
In Java, there is no way to find out the actual size of an object on the heap.
*****************************
interview

three rounds, two technical and one hr.
first telephonic then f to f,then hr for negotiations and notice period
cool, focus on basics, communication, oops jquery
*************************************************************************************************

https://www.glassdoor.co.in/Interview/Mindteck-Software-Engineer-Interview-Questions-EI_IE40335.0,8_KO9,26.htm
******************************************************************************************
************************************************************************************************

Entlogics Technologies Pvt. Ltd ( call based 2017 through elitmus)
drive date 3-4-2018
profile developer
Address: Venkatagowda Layout, Hebbal Kempapura, Byatarayanapura CMC and OG Part, Karnataka 560024

******************************************************************************************************
read data sturcture question interview as well as dbms

*******************************************************
**********************************************************************************************************
What is a Data Structure?
A data structure is a way of organizing the data so that the data can be used efficiently. Different kinds of data structures are suited to different kinds of applications, and some are highly specialized to specific tasks. For example, B-trees are particularly well-suited for implementation of databases, while compiler implementations usually use hash tables to look up identifiers. (Source: Wiki Page)

What are linear and non linear data Structures?

Linear: A data structure is said to be linear if its elements form a sequence or a linear list. Examples: Array. Linked List, Stacks and Queues
Non-Linear: A data structure is said to be non-linear if traversal of nodes is nonlinear in nature. Example: Graph and Trees.

What are the various operations that can be performed on different Data Structures?

Insertion − Add a new data item in the given collection of data items.
Deletion − Delete an existing data item from the given collection of data items.
Traversal − Access each data item exactly once so that it can be processed.
Searching − Find out the location of the data item if it exists in the given collection of data items.
Sorting − Arranging the data items in some order i.e. in ascending or descending order in case of numerical data and in dictionary order in case of alphanumeric data.

How is an Array different from Linked List?

The size of the arrays is fixed, Linked Lists are Dynamic in size.
Inserting and deleting a new element in an array of elements is expensive, Whereas both insertion and deletion can easily be done in Linked Lists.
Random access is not allowed in Linked Listed.
Extra memory space for a pointer is required with each element of the Linked list.
Arrays have better cache locality that can make a pretty big difference in performance.

What is Stack and where it can be used?

Stack is a linear data structure which the order LIFO(Last In First Out) or FILO(First In Last Out) for accessing elements. Basic operations of stack are : Push, Pop , Peek

Applications of Stack:

Infix to Postfix Conversion using Stack
Evaluation of Postfix Expression
Reverse a String using Stack
Implement two stacks in an array
Check for balanced parentheses in an expression

What is a Queue, how it is different from stack and how is it implemented?

Queue is a linear structure which follows the order is First In First Out (FIFO) to access elements. Mainly the following are basic operations on queue: Enqueue, Dequeue, Front, Rear
The difference between stacks and queues is in removing. In a stack we remove the item the most recently added; in a queue, we remove the item the least recently added. Both Queues and Stacks can be implemented using Arrays and Linked Lists.

What are Infix, prefix, Postfix notations?

Infix notation: X + Y – Operators are written in-between their operands. This is the usual way we write expressions. An expression such as
A * ( B + C ) / D
Postfix notation (also known as “Reverse Polish notation”): X Y + Operators are written after their operands. The infix expression given above is equivalent to
A B C + * D/
Prefix notation (also known as “Polish notation”): + X Y Operators are written before their operands. The expressions given above are equivalent to
/ * A + B C D
Converting between these notations: Click here

What is a Linked List and What are its types?

A linked list is a linear data structure (like arrays) where each element is a separate object. Each element (that is node) of a list is comprising of two items – the data and a reference to the next node.Types of Linked List :

Singly Linked List : In this type of linked list, every node stores address or reference of next node in list and the last node has next address or reference as NULL. For example 1->2->3->4->NULL
Doubly Linked List : Here, here are two references associated with each node, One of the reference points to the next node and one to the previous node. Eg. NULL<-1<->2<->3->NULL
Circular Linked List : Circular linked list is a linked list where all nodes are connected to form a circle. There is no NULL at the end. A circular linked list can be a singly circular linked list or doubly circular linked list. Eg. 1->2->3->1 [The next pointer of last node is pointing to the first]

Which data structures are used for BFS and DFS of a graph?

Queue is used for BFS
Stack is used for DFS. DFS can also be implemented using recursion (Note that recursion also uses function call stack).

Can doubly linked be implemented using a single pointer variable in every node?
Doubly linked list can be implemented using a single pointer. See XOR Linked List – A Memory Efficient Doubly Linked List

How to implement a stack using queue?

A stack can be implemented using two queues. Let stack to be implemented be ‘s’ and queues used to implement be ‘q1’ and ‘q2’. Stack ‘s’ can be implemented in two ways:

Method 1 (By making push operation costly)
Method 2 (By making pop operation costly) See Implement Stack using Queues

How to implement a queue using stack?

A queue can be implemented using two stacks. Let queue to be implemented be q and stacks used to implement q be stack1 and stack2. q can be implemented in two ways:

Method 1 (By making enQueue operation costly)
Method 2 (By making deQueue operation costly) See Implement Queue using Stacks

Which Data Structure Should be used for implementiong LRU cache?

We use two data structures to implement an LRU Cache.

Queue which is implemented using a doubly linked list. The maximum size of the queue will be equal to the total number of frames available (cache size).The most recently used pages will be near front end and least recently pages will be near rear end.
A Hash with page number as key and address of the corresponding queue node as value. See How to implement LRU caching scheme? What data structures should be used?

How to check if a given Binary Tree is BST or not?
If inorder traversal of a binary tree is sorted, then the binary tree is BST. The idea is to simply do inorder traversal and while traversing keep track of previous key value. If current key value is greater, then continue, else return false. See A program to check if a binary tree is BST or not for more details.

Linked List Questions

Linked List Insertion
Linked List Deletion
middle of a given linked list
Nth node from the end of a Linked List

Tree Traversal Questions

Inorder
Preorder and Postoder Traversals
Level order traversal
Height of Binary Tree

Convert a DLL to Binary Tree in-place
See In-place conversion of Sorted DLL to Balanced BST

Convert Binary Tree to DLL in-place
See Convert a given Binary Tree to Doubly Linked List | Set 1, Convert a given Binary Tree to Doubly Linked List | Set 2

Delete a given node in a singly linked list
Given only a pointer to a node to be deleted in a singly linked list, how do you delete it?

Reverse a Linked List
Write a function to reverse a linked list

Detect Loop in a Linked List
Write a C function to detect loop in a linked list.

Which data structure is used for dictionary and spell checker?
Data Structure for Dictionary and Spell Checker?

*****************************************************************************************************
What are advantages of DBMS over traditional file based systems?
Ans: Database management systems were developed to handle the following difficulties of typical file-processing systems supported by conventional operating systems.
1. Data redundancy and inconsistency
2. Difficulty in accessing data
3. Data isolation – multiple files and formats
4. Integrity problems
5. Atomicity of updates
6. Concurrent access by multiple users
7. Security problems
Source: http://cs.nyu.edu/courses/spring01/G22.2433-001/mod1.2.pdf

What are super, primary, candidate and foreign keys?
Ans: A superkey is a set of attributes of a relation schema upon which all attributes of the schema are functionally dependent. No two rows can have the same value of super key attributes.
A Candidate key is minimal superkey, i.e., no proper subset of Candidate key attributes can be a superkey.
A Primary Key is one of the candidate keys. One of the candidate keys is selected as most important and becomes the primary key. There cannot be more that one primary keys in a table.
Foreign key is a field (or collection of fields) in one table that uniquely identifies a row of another table. See this for an example.

What is the difference between primary key and unique constraints?
Ans: Primary key cannot have NULL value, the unique constraints can have NULL values. There is only one primary key in a table, but there can be multiple unique constrains.

What is database normalization?
Ans: It is a process of analyzing the given relation schemas based on their functional dependencies and primary keys to achieve the following desirable properties:
1) Minimizing Redundancy
2) Minimizing the Insertion, Deletion, And Update Anomalies
Relation schemas that do not meet the properties are decomposed into smaller relation schemas that could meet desirable properties.
Source: http://cs.tsu.edu/ghemri/CS346/ClassNotes/Normalization.pdf

What is SQL?
SQL is Structured Query Language designed for inserting and modifying in a relational database system.

What are the differences between DDL, DML and DCL in SQL?
Ans: Following are some details of three.
DDL stands for Data Definition Language. SQL queries like CREATE, ALTER, DROP and RENAME come under this.
DML stands for Data Manipulation Language. SQL queries like SELECT, INSERT and UPDATE come under this.
DCL stands for Data Control Language. SQL queries like GRANT and REVOKE come under this.

What is the difference between having and where clause?
Ans: HAVING is used to specify a condition for a group or an aggregate function used in select statement. The WHERE clause selects before grouping. The HAVING clause selects rows after grouping. Unlike HAVING clause, the WHERE clause cannot contain aggregate functions. (See this for examples).
See Having vs Where Clause? for more details

How to print duplicate rows in a table?
Ans: See http://quiz.geeksforgeeks.org/how-to-print-duplicate-rows-…/

What is Join?
Ans: An SQL Join is used to combine data from two or more tables, based on a common field between them. For example, consider the following two tables.

Micro-Focus company ( through fresherworld 2017 )

4th april

CONTACT PERSON : VIKRAMA, BISWAKEN
Address: 2,6 & 7th floor, Olympia building,Bagmane Tech Park, C V, Krishnappa Garden, C V Raman Nagar, Bengaluru, Karnataka 560093
******************************************************************************************************************************
https://www.glassdoor.co.in/Interview/Micro-Focus-Associate-Software-Engineer-Interview-Questions-EI_IE15057.0,11_KO12,39.htm
*****************************************************************************************************************************

Q. How to prepare for a Software Testing/QA interview?
Ans. Click the above link to know – Where should I start with for the interview preparation? It’s almost 2 years now since I have faced any interview.

Q. Mock test to judge your Software Testing Interview Skills
Ans. Take this mock test paper which will be helpful for you to prepare for a testing interview as well as the CSTE certification exam. Click the above link for questions and answers.

Q. Different Automation Testing Interview Questions
Ans. Click the above link for Automation Interview questions like Difference between Winrunner and Test Director, What is TSL? What is 4GL and is it similar too?

Q. What is the difference between Performance Testing, Load Testing, and Stress Testing? Explain with examples?
Ans. Many people are confused with these testing terminologies. Click here for the detailed explanation of Performance, Load and Stress Testing with examples.

Q. ISTQB questions and answers (more questions here and also here)
Ans. Click the above links to read about ISTQB paper pattern and tips on how to solve these questions quickly. ISTQB ‘Foundation level’ sample questions with answers are found here.

Q. QTP interview questions
Ans. Quick Test Professional: Interview Questions and answers are found in the above link.

Q. CSTE questions with answers

Ans. Click the above link for questions and answers about CSTE.

Q. What is Desk checking and Control Flow Analysis
Ans. Click here for answers about Desk checking and Control Flow Analysis along with the examples.

Q. What is Sanity Test (or) Build test?
Ans. Verifying the critical (important) functionality of the software on a new build to decide whether to carry further testing or not is termed as Sanity Test.

Q. What is the difference between client-server testing and web-based testing
Ans. Click here for the answer.

Q. What is Black Box testing?
Ans. Black box testing is explained with types in the above link.

Q. What is White Box testing?
Ans. Click here for the post explaining about white box testing along with its types

Q. What are the different Types of Software Testing?
Ans. Click the above link to refer the post explaining all Software Testing Types in detail.

Q. How to define a standard process for the entire testing flow, Explain the challenging situations in Manual Testing career, What is the best way to go about getting a pay rise.
Ans.Click the above link for the answers to these questions.

Q. What is the most challenging situation you ever had during Testing?
Q. How to perform testing when there are no documents?
Ans. Click here for the detailed post on how to answer these QA interview questions.

*********************

Popular Web Testing Interview Questions and Answers
As the name itself defines, Web testing means testing the web applications for any potential bugs or issues, before the web application is moved to the production environment i.e. before making any Web application live.

Based on web testing requirements, there are various factors that should be considered into. These factors include web application securities, TCP/IP communications, ability to handle traffic, firewalls, etc.

Web testing includes Functional testing, Usability testing, Security testing, Interface testing, Compatibility testing, Performance testing etc., in its checklist.

Web Testing Interview Questions

We will take a look at the most common Web Testing interview questions and answers which will guide you to get prepared for any web testing interview.

Given below is the list of most commonly asked web testing interview.

Q #1) What do you understand by web application?

Answer: Web application is a means to communicate and exchange information with the customers. Unlike any desktop applications which are executed by an operating system, a web application runs on a web server and is accessed by a web browser which acts as a client.

The best Example of a web application is ‘Gmail’. In Gmail, the interaction done by an individual user is completely independent of the others. You can send and receive information through emails and also through attachments.

You can maintain documents in a drive, maintain spreadsheets in Google docs and includes much more such features which make a user realize that they have an environment which is customized to their specific identity.

Q #2) Define a Web server.

Answer: Web server follows the client/server model where the program uses HTTP (Hypertext Transfer Protocol). In response to the request of a HTTP client, web server handles client and server side validation and delivers the web content in the form of web pages to the users.

The browsers we use, such as Safari, Chrome, Internet Explorer, Firefox etc., read the files stored on the web servers and bring the information to us in the form of images and texts with the means of internet. Any computer which hosts websites must have web servers.

Some of the leading web servers are:

Apache
Microsoft’s Internet Information Server (IIS)
Java web server
Google web server
Web Server

Q #3) Enlist some important test scenarios for testing a website.

Answer: There are many parameters that should be considered while deciding the important test scenarios for testing any website. Also, the type of website to be tested and its requirement specification plays an important role here.

Enlisted below are few important test scenarios that are applicable for testing any type of website:

Test the GUI (Graphical User Interface) of the website for checking the consistency of the design elements and page layout.
All page links and hyperlinks are checked for their redirection to the desired page.
In case of presence of any forms or fields on the website, testing scenarios consist of testing with valid data, invalid data, testing with existing records as well as testing with empty records.
Functionality testing as per the requirement specification is done.
Performance of a website is tested under heavy loads to determine the web server response time and database query time.
Compatibility testing is done to test the behavior of an application on a different browser and OS (operating system) combinations.
Usability testing and Database testing is also performed as a part of test scenarios.
Q #4) What are the different configurations which have to be considered while testing a website?

Answer: Different configuration includes different browsers as well as an operating system on which a website is being tested. Browser plugins, text size, video resolution, color depth, browser setting option also come under consideration when we talk about configurations.

Different combinations of browsers and operating system are used to test the compatibility of the website. Usually, the latest and the last latest versions are included. Well, these versions are usually specified in the requirement documents.

Few important Browsers include:

Internet Explorer
Firefox
Chrome
Safari
Opera
Few important Operating systems include:

Windows
UNIX
LINUX
MAC
Q #5) Is Web application testing different from Desktop Application testing? Explain how.

Answer: Yes, there is a lot of difference between web application and desktop application.

This can be explained with the help of the below-mentioned table:

Web Application

Desktop Application

Definition Web applications are the one which can run on any client machine having the internet connection without any installation of the execution file. Desktop applications are one which are separately installed and executed on the personal computer.
Performance User actions, feedback, statistics can be easily monitored as well as data updating in one place is reflected everywhere in web application. User actions cannot be monitored as well as changes in data can be only reflected at the machine.
Connectivity
Web application can be accessed on any PC having internet connection using web browser where performance of the application depends on internet speed. Desktop application can be only accessed on specific PC where application is installed.
Security Risks

Web application is more prone to security threats as applications can be accessed by anyone on the internet. Desktop application is less prone to security threats where user can keep a check on security issues at the system level.
User data
User data is saved and accessed remotely in case of web applications. Data is stored, saved and accessed from the same machine on which application is installed.
Q #6) What is Intranet Application?

Answer: Intranet application is a kind of private application which is deployed and run on local LAN server and can only be accessed by the people within the organization. It uses local network to share information.

Example: Organization usually has an application which stores information about your attendance, holidays, upcoming celebrations within the organization or some important event or information that needs to be circulated within the organization.

Q #7) Explain the difference between Authorization and Authentication in Web testing.

Answer: The difference between Authorization and Authentication is explained in below table:

Authentication Authorization

1 Authentication is the process with which the system identifies who the user is? Authorization is the process with which system identifies what user is authorized to do?
2 Authentication determines the identity of the user. Authorization decides the privileges given to the user i.e. whether the user can access or manipulate features of certain program.
3 There are different types of authentications, like password based, device based, etc. There are two types of authorizations, like read only and read write both.

4 For example: Within an organization, each and every employee can login into an intranet application. For example: Only account manager or person in accounts department can access account section.
Q #8) What are the types of Web testing security problems?

Answer: Few web security problems include:

Denial of Service (DOS) attack
Buffer overflow
Directly passing internal URL through browser address
Viewing other stats
Q #9) Define HTTP.

Answer: HTTP stands for Hypertext Transfer Protocol. HTTP is the data transfer protocol which defines how messages are formatted and transferred over World Wide Web. HTTP also determines the response of the actions performed by web servers and browsers.

For Example, when an URL is entered on the web browser, the HTTP command is sent to the web server which in turn fetches the requested web browser.

Q #10) Define HTTPS.

Answer: HTTPS stands for Hypertext Transfer Protocol Secure. This is basically HTTP over SSL (Secure Socket Layer) for security purposes. There is always chances of eavesdrop on data being transferred between a user and the web server when the website uses HTTP protocol.

Therefore, websites use secure way i.e. SSL encryption of data sent back and forth using HTTPS protocol. Almost all the websites that require user log in uses HTTPS protocol. Few Examples are banking websites, e-commerce websites, etc.

Q #11) What are the common problems faced in Web testing?

Answer: Some of the common problems faced in web testing are enlisted below:

Server Problem, which includes server down and server under maintenance problems.
Database connection problem.
Hardware and browser compatibility problems.
Security related problems.
Performance and load related problems.
GUI (graphical user interface) related problems.
Q #12) What is Cookie testing?

Answer: Cookie is said to be a personalized user’s identity or information which is required to communicate between different web pages as well as track user’s navigation through the website pages. Whenever we access any website on any web browser, their respective cookie is written on the hard disk.

Cookies are used to track user sessions, displays ads, remember user’s choice while accessing any website, remember and retrieve user’s shopping cart, track the unique number of visitors, etc.

Suppose an e-commerce site is accessible in many countries like US, Canada, Australia and their testing is done in India. In that case, while testing the e-commerce site for different countries in India, at first respective countries cookies is set so that actual data like time zone etc., are accessed of that particular country.

Q #13) Define Client-side validation.

Answer: Client-side validation is the one which is basically done at the browser level where user’s input is validated at the browser itself with no involvement of the server.

Let’s understand it with the help of an Example.

Suppose a user is entering an incorrect email format while filling a form. The browser will then and there prompt an error message to correct it before moving on to next field. Thus every field is corrected before submitting the form.

The client-side validation is usually done by script language such as JavaScript, VBScript, HTML 5 attributes.

The two types of Client-side validation are:

Field level validation
Form level validation
Q #14) What do you understand by Server-side validation?

Answer: Server-side validation occurs where the validation and processing of user requests require the response from the server. To understand it more clearly, user’s input is being sent to the server and validation is done using server-side scripting languages such as PHP, Asp.NET, etc.

After the validation process, feedback is sent back to the client in the form of dynamically generated web page.

When compared to the Client Side validation process, Server side validation process is more secure because here application is protected against malicious attacks and users can easily bypass client-side scripting language.

Q #15) Differentiate between Static and Dynamic website.

Answer: Difference between static and dynamic websites are as follows:

Static Website

Dynamic website

Static websites are the one which gives out information only and there is no sort of interaction between the user and the website. Dynamic websites are the one where user interaction is possible between the website and user along with imparting information.
Static websites are cheapest to develop and host. Dynamic websites are more expensive to develop as well as their hosting cost is also more.
Static websites are easily loaded on client browser because of its fixed content and no database connectivity. Dynamic websites usually take the time to load on client browser because contents to display are dynamically created and retrieved using database queries.
Static websites can be created from HTML, CSS and does not require any server application language. Dynamic websites require server application language like ASP.NET, JSP, PHP to run the application on the server and display the output on the webpage.
Change in the content of the page of any static website; require being uploaded on server many times. Dynamic website provides facilities to change the page content using server application.
Q #16) What do you understand by Client-Server testing?

Answer: Client-server application is the one where the application itself is loaded or installed on a server whereas application EXE file is loaded on all client machines. This environment is usually used in Intranet networks.

Following tests are performed on a Client-server application:

GUI testing on both client and server systems.
Client-server interaction.
The functionality of an application.
Load and performance testing.
Compatibility testing.
All the test cases and test scenarios used in client-server application testing is derived from the tester’s experience and requirement specifications.

Q #17) Enlist HTTP response codes that are returned by the server.

Answer: HTTP response codes are enlisted below:

2xx – This means ‘Success’
3xx- This means ‘Redirection’
4xx- This means ‘Application error’
5xx- This means ‘Server error’
Q #18) What is the role of Usability testing in Web testing?

Answer: In web testing, Usability testing plays an important role. It is well known that usability testing is the means to determine the ease with which an end user can easily access the application with or without having any programming language knowledge.

In terms of web testing, usability testing comprises of the following:

To check whether the website is user-friendly?
Is the end user able to easily navigate within the application?
Presence of any issues or ambiguity which can hinder the user experience.
Check how quickly the user is able to complete the task within the application.
Q #19) What are the available environments on Web?

Answer: The different types of the environment on Web are:

Intranet (Local Network)
Internet (Wide Area Network)
Extranet(Private network over the internet)
Q #20) What are the test case formats in case of a Static website and Dynamic website?

Answer: The following test case formats will be used in case of Static websites:

Front-end test cases
Navigation test cases
The following test case formats will be used in case of Dynamic websites:

Front-end test cases
Back-end test cases
Navigation test cases
Field validation test cases
Security test cases, etc.
Q #21) Enlist some sub-classes of HTTP response objects?

Answer: Write, Flush, tell, etc are few HTTP response objects.

The sub-classes of HTTP response are:

HttpResponseRedirect
HttpResponsePermanentRedirect
HttpResponseBadRequest
HttpResponseNotfound
Q #22) Enlist some Web Testing Tools.

Answer: Few Web testing tools are enlisted below:

eggplant functional
Selenium
SOA test
JMeter
iMacros, etc.
Q #23) Give some examples of web applications that are used in our day to day life.

Answer: Few Examples include:

Web portals like eBay, Amazon, Flipkart etc.
Banking applications like ICICI, Yes Bank, HDFC, Kotak Mahindra etc.
Email service providers like Gmail, Yahoo, Hotmail etc.
Social Networks like Facebook, Twitter, LinkedIn etc.
Discussion and Information forums like www.Softwaretestinghelp.com
Q #24) What is a Proxy server?

Answer: Proxy server is a server which acts as an intermediary or is the one that lies between the client and the main server.

The communication between the main server and client-server is done through a proxy server as the client request of any connection, file, resources from the main server is sent through a proxy server and again the response from the main server or local cached memory to client-server is done through the proxy server.

Some of the most common proxy servers based on their purpose and functionality are listed below:

Transparent proxy
Web proxy
Anonymous proxy
Distorting proxy
High anonymity proxy
The proxy server is basically used for the following purposes:

To improve the performance of web response.
In case of presence of a document in a cache memory, the response is directly sent to the client.
Proxy server filters web page content in the form of web proxies.
A proxy server is also used to block offensive web content to be accessed by the user especially in an organization, school, and college.
Web proxies prevent the attack of computer viruses and malware.
Q #25) What is Database server?

Answer: A Database server can be defined as a server that refers to the back-end system of a database application that provides database services such as accessing and retrieving data from the database.

Database server uses client/server architecture where the data can be accessed either through the database server by a “front end” which runs and displays data on user’s machine or “back end” which runs on the database server itself.

A database server is like a data warehouse and also holds on Database Management System (DBMS).

*********************

Few More Basic Software Testing Interview Questions
Q. What is Dynamic Testing?
Ans. It is the testing done by executing the code or program with various input values and later on the output is verified.

Q. What is GUI Testing?
Ans. GUI or Graphical user interface testing is the process of testing the software user interface against the provided requirements/mockups/HTML designs etc.,

Q. What is Formal Testing?
Ans. Software verification carried out by following a test plan, testing procedures and proper documentation with an approval from the customer is termed as Formal Testing.

Q. What is Risk Based Testing?
Ans. Identifying the critical functionality in the system and then deciding the orders in which these functionalities are to be tested and applying testing after that is termed as Risk-based Testing.

Q. What is Early Testing?
Ans. Conducting testing as soon as possible in the development lifecycle to find defects at early stages of STLC. Early testing is helpful to reduce the cost of fixing defects at the later stages of STLC.

Q. What is Exhaustive Testing?
Ans. Testing functionality with all valid, invalid inputs and pre-conditions is called Exhaustive testing.

Q. What is Defect Clustering?
Ans. Any small module or functionality may contain a number of defects – concentrating more on testing these functionalities is known as Defect Clustering.

Q. What is Pesticide Paradox?
Ans. If prepared test cases are not finding defects, add/revise test cases to find more defects, this is known as Pesticide Paradox.

Q. What is Static Testing?
Ans. Manual verification of the code without executing the program is called as Static Testing. In this process, the issues are identified in the code by checking code, requirement and design documents.

Q. What is Positive Testing?
Ans. It is the Testing which is conducted on the application to determine if the system works properly. Basically known as “test to pass” approach.

Q. What is Negative Testing?
Ans. Testing Software with a negative approach to check if the system is not “showing error when not supposed to” and “not showing error when supposed to” is termed as Negative Testing.

Q. What is an End-to-End Testing?
Ans. Testing the overall functionality of the system including the data integration among all the modules is called End-to-End Testing.

Q. What is Exploratory Testing?
Ans. Exploring the application, understanding its functionalities, adding (or) modifying the existing test cases for better testing is called Exploratory testing.

Q. What is Monkey Testing?
Ans. Testing conducted on an application without any plan and carried out randomly with the tests to find any system crash with an intention of finding tricky defects is called Monkey Testing.

Q. What is Non-Functional Testing?
Ans. Validating various non-functional aspects of the system such as user interfaces, user-friendliness, security, compatibility, Load, Stress, and Performance etc., is called Non-Functional testing.

Q. What is Usability Testing?
Ans. Checking how easily the end users are able to understand and operate the application is called Usability Testing.

Q. What is Security Testing?
Ans. Validating whether all security conditions are properly implemented in the software (or) not is called Security testing.

Q. What is Performance Testing?
Ans. The process of measuring various efficiency characteristics of a system such as response time, load stress transactions per minutes, transaction mix etc., is termed as Performance Testing.

Q. What is Load Testing?
Ans. Analyzing both the functional and performance behavior of an application under various conditions is called Load Testing.

Q. What is Stress Testing?
Ans. Checking the application behavior under stress conditions
(or)
Reducing the system resources and keeping the load as constant and checking how the application is behaving is called Stress Testing.

Q. What is Process?
Ans. A process is a set of practices performed to achieve a given purpose; it may include tools, methods, materials or people.

Q. What is Software Configuration Management?
Ans. The process of identifying, Organizing and controlling changes to the Software development and maintenance.
(or)
It is a methodology to control and manage a software development project.

Q. What is a Testing Process / LifeCycle?
Ans. It includes the below factors:

Writing a Test Plan
Test Scenarios
Test Cases
Executing the Test Cases
Test Results
Defect Reporting
Defect Tracking
Defect Closing
Test Release

Q. What is full form of CMMI?
Ans. Capability Maturity Model Integration

Q. What is a Code Walk Through?
Ans. An informal analysis of the program source code to find the defects and verify the coding techniques is termed so.

Q. What is Unit Level Testing?
Ans. Testing of single programs, modules or unit of code is termed as Unit Level Testing.

Q. What is Integration Level Testing?
Ans. Testing of related programs, Modules (or) Unit of code.
(or)
Partitions of the system which is ready for testing with other partitions of the system is termed so.

Q. What is System Level Testing?
Ans. Testing of the entire computer system across all the modules is termed so. This kind of testing can include Functional as well as Structural Testing.

Q. What is Alpha Testing?
Ans. Testing of a whole computer system before rolling out to the UAT is termed so.

Q. What is User Acceptance Testing (UAT)?
Ans. Testing of a computer system by the client to verify if it adhered to the provided requirements.

Q. What is a Test Plan?
Ans. It is a document describing the scope, approach, resources, and schedule of testing activities. It identifies test items, features to be tested, testing tasks, who will do each task, and any risks requiring contingency planning.

Q. What is a Test Scenario?
Ans. Identifying all the possible areas to be tested (or) what is to be tested is termed so.

Q. What is ECP (Equivalence Class Partition)?
Ans. It is a method for deriving test cases.

Q. What is a Defect?
Ans. Any flaw or imperfection in a software work product is termed as a Defect.
(or)
When the expected result does not match with the application actual result, it is termed so.

Q. What is Severity?
Ans. It defines the importance of the defect from the functional point of view i.e. how critical is a defect with respect to the application.

Q. What is Priority?
Ans. It indicates the importance or urgency of fixing a defect

Q. What is Re-Testing?
Ans. Re-testing the application means verifying whether the defects have been fixed or not.

Q. What is Regression Testing?
Ans. Verifying an existing functional and non-functional area after making changes to the part of a software or addition of new features is termed so.

Q. What is Recovery Testing?
Ans. Checking whether the system is able to handle some unexpected or unpredictable situations is called Recovery Testing.

Q. What is Globalization Testing?
Ans. It is the process of verifying whether a software can be run independently of its geographical and cultural environment. Checking if the application is having features of setting and changing language, date, format, and currency if it is designed for global users.

Q. What is Localization Testing?
Ans. Verifying globalized application for a particular locality of users, under cultural and geographical conditions is termed so.

Q. What is Installation Testing?
Ans. Checking whether we are able to install a software successfully (or) not, as per the guidelines given in the installation document is called Installation Testing.

Q. What is Un-Installation Testing?
Ans. Checking whether we are able to uninstall the software from the system successfully (or) not is called Un-Installation Testing

Q. What is Compatibility Testing?
Ans. Checking whether the application is compatible with different software and hardware environment or not is called Compatibility Testing.

Q. What is a Test Strategy?
Ans. It is a part of a test plan describing how testing is carried out for the project and what testing types need to be performed on the application.

Q. What is a Test Case?
Ans. A Test case is a set of pre-conditional steps to be followed with input data and expected behavior to validate the functionality of a system.

Q. What is Business Validation Test Case?
Ans. A test case which is prepared to check the business condition or a business requirement is called Business Validation test case.

Q. What is a Good Test Case?
Ans. A Test case that has the high priority of catching defects is called a Good Test Case.

. What is Use Case Testing?
Ans. Validating a software to confirm whether it is developed as per the use cases or not is called Use Case testing.

Q. What is a Defect Age?
Ans. The time gap between the date of detection & the date of closure of a defect is termed so.

Q. What is Showstopper Defect?
Ans. A defect which is not permitting to continue further with testing is called Showstopper Defect.

Q. What is a Test Closure?
Ans. It is the last phase of the STLC, where the management prepares various test summary reports that explain the complete statistics of the project based on the testing carried out.

Q. What is Bucket Testing?
Ans. Bucket testing is also known as A/B testing. It is mostly used to study the impact of various product designs in the website metrics. Two simultaneous versions are run on a single or a set of web pages to measure the difference in click rates, interface, and traffic.

Q. What is meant by Entry Criteria and Exit Criteria in Software Testing?
Ans. Entry Criteria is the process that must be present when a system begins, like,
SRS – Software
FRS
Use Case
Test Case
Test Plan
Exit criteria ensure whether the testing is completed and the application is ready for release, like,
Test Summary Report,
Metrics
Defect Analysis Report.

Q. What is Concurrency Testing?
Ans. This is a multiple user testing to access the application at the same time to verify the effect on code, module or DB and it is mainly used to identify the locking and deadlocking situations in the code.

Q. What is Web Application Testing?
Ans. Web application testing is done on a website to check – load, performance, security, Functionality, Interface, Compatibility and other usability-related issues.

Q. What is Unit Testing?
Ans. Unit testing is done to check whether the individual modules of the source code are working properly or not.

Q. What is Interface Testing?
Ans. Interface testing is done to check whether the individual modules are communicating properly as per the specifications or not. Interface testing is mostly used to test the user interface of GUI applications.

Q. What is Gamma Testing?
Ans. Gamma testing is done when the software is ready for release with the specified requirements, this testing is done directly by skipping all the in-house testing activities.

Q. What is Test Harness?
Ans. Test Harness is configuring a set of tools and test data to test an application under various conditions, which involves monitoring the output with the expected output for correctness.
The benefits of Testing Harness are: Productivity increase due to process automation and increase in the product quality

Q. What is Scalability Testing?
Ans. It is used to check whether the functionality and performance of a system are capable to meet the volume and size changes as per the requirements.
Scalability testing is done using load test by changing various software, hardware configurations, and testing environment.

 

********************************************************************************************************************

MAQ ONLINE TEST BY FRESHERORLD (call based through fresherworld 2017)
FOR 2017 BATCH
drive date 4-4-2018
Address: Level 7, Astro, aVance Business Hub, Behind Dell Campus, HITEC City 2, Madhapur, Hyderabad, Telangana 500081

INTERVIEW REVIEW
*************************************************
*************************************************

https://www.geeksforgeeks.org/tag/maq-software/
************************************************
MAQ Software Interview Experience | Set 17 (On-Campus FTE+Internship)
Round 1:
The first round was of two parts.The first part contained 30 aptitude questions in 30 minutes .Be fast else you won’t be able to complete.
In the second part there were two coding questions to be completed in 30 minutes.They will provide you a compiler but they will test your code on one test case and final testing would be done after the test and once you submit you will have no second chance of submitting so be very sure about your code.The questions that came in my first round was
1. Given a sum S find the smallest 5 digit number whose sum of digits is S.If such a number does not exist print impossible.
2. Given a number x find the nearest prime number before x. https://www.geeksforgeeks.org/sieve-of-eratosthenes/
28 people were shortlisted after this round

TECHNICAL ROUND 1:

The interviews happened on skype. They will ask you to share the screen and write a code.The interview started with discussion on my project followed by three coding questions.
1. What is recursion ? What are its types ? Write a recursive code to generate fibonacci series.
2. Given a binary string print the length of maximum consecutive 1’s in the string.
3. Right View of a Binary tree. https://www.geeksforgeeks.org/print-right-view-binary-tree…/

He then switched to dbms:

1.What is a primary key ? What are its properties ?
2. What is indexing ? Explain types ?
He then switched to object oriented programming and asked questions on it.
I then had a puzzle to solve:
Given three boxes one has only red one has only blue and one has a combination of the two and all the labels of the box are incorrectly placed.If we pick one ball from a box it is considered one move.At a time we can only take one ball from a box. Find the minimum number of moves to identify correct label for boxes.
8 people were shortlisted after this round.

TECHNICAL ROUND 2:

The second technical round consisted of some questions from my project. It also consisted questions from dbms and software engineering.
There was no HR and 2 people were selected for FTE+Internship and 2 were selected for internship.

MAQ Software most Frequently Asked Questions
Algorithmic Problems:

Detect a loop in a linked list
Print matrix in a spiral order – Practice here
Snake-Ladder problem
N-queen problem for 8 queens
Reverse a string wordwise – Practice here
key and lock problem – Practice here
Serialize and Deserialize a Binary Tree – Practice here
Wap to print all permutations of a given string – Practice here
Maximum area of a histogram – Practice here
Given a number, generate all prime numbers till that number – Practice here
Sort an array of 0s, 1s, 2s – Practice here
Nth fibonacci number – Practice here
Find Middle element of Linked List – Practice here
Check if a linked list is Circular Linked List – Practice here
Others Subjects:

SQL queries
Basic Java concepts
Indexing in DBMS
B-tree and B+ Tree
BST
Deadlock
Mutex and Semaphores
Aptitude:

Time and work
Pipes and Cisterns
Calendar Dates
Common puzzles
Speed and Distances

MAQ Software Interview Experience | Set 15 ( On-Campus )
Recently MAQ Software visited our campus. A panel of two members arrived.
There was a pen and paper round. The round consisted of aptitude questions like

Round 1:

Time and work
Pipes and Cisterns
Calendar Dates
Common puzzles
Speed and Distances
There were 30 questions to be solved in 30 mins. Each question was provided with four choices out of which one was correct. There was negative marking for wrong answers.
Next there was a round where two coding questions were given. Time allotted for this round was again 30 mins. The questions were

Sort an array of 0s, 1s and 2s
Given an array A[] consisting 0s, 1s and 2s, write a function that sorts A[]. The functions should put all 0s first, then all 1s and all 2s in last.
Examples:

Input : {0, 1, 2, 0, 1, 2}
Output : {0, 0, 1, 1, 2, 2}

Input : {0, 1, 1, 0, 1, 2, 1, 2, 0, 0, 0, 1}
Output : {0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 2, 2}

// Java program to sort an array of 0, 1 and 2
import java.io.*;

class countzot {

// Sort the input array, the array is assumed to
// have values in {0, 1, 2}
static void sort012(int a[], int arr_size)
{
int lo = 0;
int hi = arr_size – 1;
int mid = 0,temp=0;
while (mid <= hi)
{
switch (a[mid])
{
case 0:
{
temp = a[lo];
a[lo] = a[mid];
a[mid] = temp;
lo++;
mid++;
break;
}
case 1:
mid++;
break;
case 2:
{
temp = a[mid];
a[mid] = a[hi];
a[hi] = temp;
hi–;
break;
}
}
}
}

/* Utility function to print array arr[] */
static void printArray(int arr[], int arr_size)
{
int i;
for (i = 0; i < arr_size; i++)
System.out.print(arr[i]+” “);
System.out.println(“”);
}

/*Driver function to check for above functions*/
public static void main (String[] args)
{
int arr[] = {0, 1, 1, 0, 1, 2, 1, 2, 0, 0, 0, 1};
int arr_size = arr.length;
sort012(arr, arr_size);
System.out.println(“Array after seggregation “);
printArray(arr, arr_size);
}
}

Output:

array after segregation 0 0 0 0 0 1 1 1 1 1 2 2

Technical 1: FTF
1) Discussion on project
2) Reverse a string wordwise. (Let the input string be “i like this program very much”. The function should change the string to “much very program this like i”).
3) Questions on Android (Project related)
4) SQL queries
5) Java concepts
6) Asked me to explain backtracking and both of the codes of the written round.
[35 mins]

MAQ Software Interview Experience (On-Campus FTE+Internship)

There were four rounds.
Round 1:
This round was an offline written round.It consisted of 30 aptitiude questions and the given time was 30 mins.
Topics:

Time and work
Pipes and Cisterns
Calendar Dates
Common puzzles
Speed and Distances
Simple and Compund Interest
Profit and Loss
Area
There was negative marking for wrong answers.

Round 2:
This round was an offline coding round. It consisted of two questions.Time alloted was 30 mins.

Print a given matrix in spiral form
Given a 2D array, print it in spiral form. See the following examples.

Input:
1 2 3 4
5 6 7 8
9 10 11 12
13 14 15 16
Output:
1 2 3 4 8 12 16 15 14 13 9 5 6 7 11 10

Input:
1 2 3 4 5 6
7 8 9 10 11 12
13 14 15 16 17 18
Output:
1 2 3 4 5 6 12 18 17 16 15 14 13 7 8 9 10 11

// Java program to print a given matrix in spiral form
import java.io.*;

class GFG
{
// Function print matrix in spiral form
static void spiralPrint(int m, int n, int a[][])
{
int i, k = 0, l = 0;
/* k – starting row index
m – ending row index
l – starting column index
n – ending column index
i – iterator
*/

while (k < m && l < n)
{
// Print the first row from the remaining rows
for (i = l; i < n; ++i)
{
System.out.print(a[k][i]+” “);
}
k++;

// Print the last column from the remaining columns
for (i = k; i < m; ++i)
{
System.out.print(a[i][n-1]+” “);
}
n–;

// Print the last row from the remaining rows */
if ( k < m)
{
for (i = n-1; i >= l; –i)
{
System.out.print(a[m-1][i]+” “);
}
m–;
}

// Print the first column from the remaining columns */
if (l < n)
{
for (i = m-1; i >= k; –i)
{
System.out.print(a[i][l]+” “);
}
l++;
}
}
}

// driver program
public static void main (String[] args)
{
int R = 3;
int C = 6;
int a[][] = { {1, 2, 3, 4, 5, 6},
{7, 8, 9, 10, 11, 12},
{13, 14, 15, 16, 17, 18}
};
spiralPrint(R,C,a);
}
}

// Contributed by Pramod Kumar
Run on IDE

Output:

1 2 3 4 5 6 12 18 17 16 15 14 13 7 8 9 10 11

Snake and Ladder Problem
Given a snake and ladder board, find the minimum number of dice throws required to reach the destination or last cell from source or 1st cell. Basically, the player has total control over outcome of dice throw and wants to find out minimum number of throws required to reach last cell.

If the player reaches a cell which is base of a ladder, the player has to climb up that ladder and if reaches a cell is mouth of the snake, has to go down to the tail of snake without a dice throw.

For example, consider the board shown, the minimum number of dice throws required to reach cell 30 from cell 1 is 3.
Following are the steps:

a) First throw two on dice to reach cell number 3 and then ladder to reach 22
b) Then throw 6 to reach 28.
c) Finally through 2 to reach 30.

There can be other solutions as well like (2, 2, 6), (2, 4, 4), (2, 3, 5).. etc.

// Java program to find minimum number of dice
// throws required to reach last cell from first
// cell of a given snake and ladder board

import java.util.LinkedList;
import java.util.Queue;

public class SnakesLadder
{
// An entry in queue used in BFS
static class qentry
{
int v;// Vertex number
int dist;// Distance of this vertex from source
}

// This function returns minimum number of dice
// throws required to Reach last cell from 0’th cell
// in a snake and ladder game. move[] is an array of
// size N where N is no. of cells on board If there
// is no snake or ladder from cell i, then move[i]
// is -1 Otherwise move[i] contains cell to which
// snake or ladder at i takes to.
static int getMinDiceThrows(int move[], int n)
{
int visited[] = new int[n];
Queue<qentry> q = new LinkedList<>();
qentry qe = new qentry();
qe.v = 0;
qe.dist = 0;

// Mark the node 0 as visited and enqueue it.
visited[0] = 1;
q.add(qe);

// Do a BFS starting from vertex at index 0
while (!q.isEmpty())
{
qe = q.remove();
int v = qe.v;

// If front vertex is the destination
// vertex, we are done
if (v == n – 1)
break;

// Otherwise dequeue the front vertex and
// enqueue its adjacent vertices (or cell
// numbers reachable through a dice throw)
for (int j = v + 1; j <= (v + 6) && j < n; ++j)
{
// If this cell is already visited, then ignore
if (visited[j] == 0)
{
// Otherwise calculate its distance and
// mark it as visited
qentry a = new qentry();
a.dist = (qe.dist + 1);
visited[j] = 1;

// Check if there a snake or ladder at ‘j’
// then tail of snake or top of ladder
// become the adjacent of ‘i’
if (move[j] != -1)
a.v = move[j];
else
a.v = j;
q.add(a);
}
}
}

// We reach here when ‘qe’ has last vertex
// return the distance of vertex in ‘qe’
return qe.dist;
}

public static void main(String[] args)
{
// Let us construct the board given in above diagram
int N = 30;
int moves[] = new int[N];
for (int i = 0; i < N; i++)
moves[i] = -1;

// Ladders
moves[2] = 21;
moves[4] = 7;
moves[10] = 25;
moves[19] = 28;

// Snakes
moves[26] = 0;
moves[20] = 8;
moves[16] = 3;
moves[18] = 6;

System.out.println(“Min Dice throws required is ” +
getMinDiceThrows(moves, N));
}
}

One could write pseudo code/algorithm/full code.

Around 18 people were selected for the interview rounds based on the previous two rounds(but the weightage of the first round was more).

There were total 2 interview/technical rounds.

Technical interview round 1:(40 mins)

1. Tell me about yourself.
2. About the family background.
3. Rate yourself in data structures(array,string,binary tree,BST etc).
4. What is indexing in DBMS? Types of indexing? How you can implement indexing using B-tree and B+ tree? Lot of discussion on B-tree and B+ tree-insertion and deletion.
5. What is BST? Give a real-life example.
6. What are the types of link list? How to detect and remove a loop in link list?
7. Lot of questions was asked based on my projects( Machine Learning and neural network).
8. Given a range, count the no of times the 7th digit will occur. Implement in both recursive and iterative form.
Eg: if range is 1-20, count=2
9. Reverse a string in one pass.
Eg: if input string is “my name is mohan”
output is : “mohan is name my”.
http://stackoverflow.com/…/reverse-the-ordering-of-words-in….

There were some HR questions like:
1. What is your future goal.
2. Preferred location(Mumbai/Hyderbad).
3. Questions related to team management.

7 students were selected for 2nd technical round.

Technical interview round 2:(1 hr)

1. Wap to print all permutations of a given string
eg. Input string is “ABC”
output will be:
ABC
ACB
BAC
BCA
CBA
CAB
https://www.geeksforgeeks.org/write-a-c-program-to-print-a…/

2. Serialize and Deserialize a Binary Tree
https://www.geeksforgeeks.org/serialize-deserialize-binary…/
Write the full code with all base cases.
3. Apple puzzle.
https://www.youtube.com/watch?v=o6nbg69Ml4c
4. How many squares in a chessboard.

ideapoke company ( through jspider 2016, 2017 batch )

through jspider

drive date 2-4-2018

Address: # 219, 7th ‘A’ Main, HRBR Layout 1st Block, Kalyan Nagar, Bengaluru, 560043

***********************************************************************************
https://www.glassdoor.co.in/Interview/Ideapoke-Technologies-Interview-Questions-E840977.htm

**************************************************************************************
Interview

20 objective question (java,java script, 1 for my sql , and 1 for monogodb)
5 programming in eclipse
sort array
reverse string
intersection of two collections………………
find frequency of sub string in string(ideapoke is ideapoke) substring ideapoke

asic Java Interview Questions
Q1. Explain JVM, JRE and JDK?
JVM (Java Virtual Machine): It is an abstract machine. It is a specification that provides run-time environment in which java bytecode can be executed. It follows three notations:

Specification: It is a document that describes the implementation of the Java virtual machine. It is provided by Sun and other companies.
Implementation: It is a program that meets the requirements of JVM specification.
Runtime Instance: An instance of JVM is created whenever you write a java command on the command prompt and run the class.
JRE (Java Runtime Environment) : JRE refers to a runtime environment in which java bytecode can be executed. It implements the JVM (Java Virtual Machine) and provides all the class libraries and other support files that JVM uses at runtime. So JRE is a software package that contains what is required to run a Java program. Basically, it’s an implementation of the JVM which physically exists.

JDK(Java Development Kit) : It is the tool necessary to compile, document and package Java programs. The JDK completely includes JRE which contains tools for Java programmers. The Java Development Kit is provided free of charge. Along with JRE, it includes an interpreter/loader, a compiler (javac), an archiver (jar), a documentation generator (javadoc) and other tools needed in Java development. In short, it contains JRE + development tools.

Refer to this below image and understand how exactly these components reside:

Components – Java Interview Questions – Edureka

Q2. Explain public static void main(String args[]).
public : Public is an access modifier, which is used to specify who can access this method. Public means that this Method will be accessible by any Class.
static : It is a keyword in java which identifies it is class based i.e it can be accessed without creating the instance of a Class.

void : It is the return type of the method. Void defines the method which will not return any value.

main: It is the name of the method which is searched by JVM as a starting point for an application with a particular signature only. It is the method where the main execution occurs.

String args[] : It is the parameter passed to the main method.

Q3. Why Java is platform independent?
Platform independent practically means “write once run anywhere”. Java is called so because of its byte codes which can run on any system irrespective of its underlying operating system.

Q4. Why java is not 100% Object-oriented?
Java is not 100% Object-oriented because it makes use of eight primitive datatypes such as boolean, byte, char, int, float, double, long, short which are not objects.

Q5. What are wrapper classes?
Wrapper classes converts the java primitives into the reference types (objects). Every primitive data type has a class dedicated to it. These are known as wrapper classes because they “wrap” the primitive data type into an object of that class. Refer to the below image which displays different primitive type, wrapper class and constructor argument.

WrapperClass – Java Interview Questions – Edureka

Q6. What are constructors in Java?
In Java, constructor refers to a block of code which is used to initialize an object. It must have the same name as that of the class. Also, it has no return type and it is automatically called when an object is created.

There are two types of constructors:

Default constructor
Parameterized constructor
Q7. What is singleton class and how can we make a class singleton?
Singleton class is a class whose only one instance can be created at any given time, in one JVM. A class can be made singleton by making its constructor private.

Q8. What is the difference between Array list and vector?
Array List Vector
Array List is not synchronized. Vector is synchronized.
Array List is fast as it’s non-synchronized. Vector is slow as it is thread safe.
If an element is inserted into the Array List, it increases its Array size by 50%. Vector defaults to doubling size of its array.
Array List does not define the increment size. Vector defines the increment size.
Array List can only use Iterator for traversing an Array List. Except Hashtable, Vector is the only other class which uses both Enumeration and Iterator.
Q9. What is the difference between equals() and == ?
Equals() method is defined in Object class in Java and used for checking equality of two objects defined by business logic.
“==” or equality operator in Java is a binary operator provided by Java programming language and used to compare primitives and objects. public boolean equals(Object o) is the method provided by the Object class. The default implementation uses == operator to compare two objects. For example: method can be overridden like String class. equals() method is used to compare the values of two objects.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
public class Equaltest {
public static void main(String[] args) {
String str1= new String(“ABCD”);
String str2= new String(“ABCD”);
if(Str1 == str2)
{
System.out.println(“String 1 == String 2 is true”);
}
else
{
System.out.println(“String 1 == String 2 is false”);
String Str3 = Str2;
if( Str2 == Str3)
{
System.out.println(“String 2 == String 3 is true”);
}
else
{
System.out.println(“String 2 == String 3 is false”);
}
if(Str1.equals(str2))
{
System.out.println(“String 1 equals string 2 is true”);
}
else
{
System.out.prinltn(“String 1 equals string 2 is false”);
}
}}
Q10. What are the differences between Heap and Stack Memory?
The major difference between Heap and Stack memory are:

Features Stack Heap
Memory Stack memory is used only by one thread of execution. Heap memory is used by all the parts of the application.
Access Stack memory can’t be accessed by other threads. Objects stored in the heap are globally accessible.
Memory Management Follows LIFO manner to free memory. Memory management is based on generation associated to each object.
Lifetime Exists until the end of execution of the thread. Heap memory lives from the start till the end of application execution.
Usage Stack memory only contains local primitive and reference variables to objects in heap space. Whenever an object is created, it’s always stored in the Heap space.

In case you are facing any challenges with these java interview questions, please comment your problems in the section below. Apart from this Java Interview Questions Blog, if you want to get trained from professionals on this technology, you can opt for a structured training from edureka! Click below to know more.

Get Started with Java

OOPS Java Interview Questions:
Q1. What is Polymorphism?

Polymorphism is briefly described as “one interface, many implementations”. Polymorphism is a characteristic of being able to assign a different meaning or usage to something in different contexts – specifically, to allow an entity such as a variable, a function, or an object to have more than one form. There are two types of polymorphism:

Compile time polymorphism
Run time polymorphism

Compile time polymorphism is method overloading whereas Runtime time polymorphism is done using inheritance and interface.

Q2. What is runtime polymorphism or dynamic method dispatch?
In Java, runtime polymorphism or dynamic method dispatch is a process in which a call to an overridden method is resolved at runtime rather than at compile-time. In this process, an overridden method is called through the reference variable of a superclass. Let’s take a look at the example below to understand it better.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
class Car {
void run()
{
System.out.println(“car is running”);
}
}
class Audi extends Car {
void run()
{
System.out.prinltn(“Audi is running safely with 100km”);
}
public static void main(String args[])
{
Car b= new Audi(); //upcasting
b.run();
}
}
Q3. What is the difference between abstract classes and interfaces?
Abstract Class Interfaces
An abstract class can provide complete, default code and/or just the details that have to be overridden. An interface cannot provide any code at all,just the signature.
In case of abstract class, a class may extend only one abstract class. A Class may implement several interfaces.
An abstract class can have non-abstract methods. All methods of an Interface are abstract.
An abstract class can have instance variables. An Interface cannot have instance variables
An abstract class can have any visibility: public, private, protected. An Interface visibility must be public (or) none.
If we add a new method to an abstract class then we have the option of providing default implementation and therefore all the existing code might work properly If we add a new method to an Interface then we have to track down all the implementations of the interface and define implementation for the new method
An abstract class can contain constructors An Interface cannot contain constructors
Abstract classes are fast Interfaces are slow as it requires extra indirection to find corresponding method in the actual class
Q4. What is method overloading and method overriding?
Method Overloading :
In Method Overloading, Methods of the same class shares the same name but each method must have different number of parameters or parameters having different types and order.
Method Overloading is to “add” or “extend” more to method’s behavior.
It is a compile time polymorphism.
The methods must have different signature.
It may or may not need inheritance in Method Overloading.
Let’s take a look at the example below to understand it better.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
class Adder {
Static int add(int a, int b)
{
return a+b;
}
Static double add( double a, double b)
{
return a+b;
}
public static void main(String args[])
{
System.out.println(Adder.add(11,11));
System.out.println(Adder.add(12.3,12.6));
}}
Method Overriding:
In Method Overriding, sub class have the same method with same name and exactly the same number and type of parameters and same return type as a super class.
Method Overriding is to “Change” existing behavior of method.
It is a run time polymorphism.
The methods must have same signature.
It always requires inheritance in Method Overriding.
Let’s take a look at the example below to understand it better.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
class Car {
void run(){
System.out.println(“car is running”);
}
Class Audi extends Car{
void run()
{
System.out.prinltn(“Audi is running safely with 100km”);
}
public static void main( String args[])
{
Car b=new Audi();
b.run();
}
}
Q5. Can you override a private or static method in Java?
You cannot override a private or static method in Java. If you create a similar method with same return type and same method arguments in child class then it will hide the super class method; this is known as method hiding. Similarly, you cannot override a private method in sub class because it’s not accessible there. What you can do is create another private method with the same name in the child class. Let’s take a look at the example below to understand it better.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
class Base {
private static void display() {
System.out.println(“Static or class method from Base”);
}
public void print() {
System.out.println(“Non-static or instance method from Base”);
}
class Derived extends Base {
private static void display() {
System.out.println(“Static or class method from Derived”);
}
public void print() {
System.out.println(“Non-static or instance method from Derived”);
}
public class test {
public static void main(String args[])
{
Base obj= new Derived();
obj1.display();
obj1.print();
}
}
Q6. What is multiple inheritance? Is it supported by Java?
MultipleInheritance – Java Interview Questions – EdurekaIf a child class inherits the property from multiple classes is known as multiple inheritance. Java does not allow to extend multiple classes.

The problem with multiple inheritance is that if multiple parent classes have a same method name, then at runtime it becomes difficult for the compiler to decide which method to execute from the child class.

Therefore, Java doesn’t support multiple inheritance. The problem is commonly referred as Diamond Problem.

Q7. What is association?
Association is a relationship where all object have their own lifecycle and there is no owner. Let’s take an example of Teacher and Student. Multiple students can associate with a single teacher and a single student can associate with multiple teachers but there is no ownership between the objects and both have their own lifecycle. These relationship can be one to one, One to many, many to one and many to many.

Q8. What do you mean by aggregation?
Aggregation is a specialized form of Association where all object have their own lifecycle but there is ownership and child object can not belongs to another parent object. Let’s take an example of Department and teacher. A single teacher can not belongs to multiple departments, but if we delete the department teacher object will not destroy.

Q9. What is composition in Java?
Composition is again specialized form of Aggregation and we can call this as a “death” relationship. It is a strong type of Aggregation. Child object dose not have their lifecycle and if parent object deletes all child object will also be deleted. Let’s take again an example of relationship between House and rooms. House can contain multiple rooms there is no independent life of room and any room can not belongs to two different house if we delete the house room will automatically delete.

In case you are facing any challenges with these java interview questions, please comment your problems in the section below. Apart from this Java Interview Questions Blog, if you want to get trained from professionals on this technology, you can opt for a structured training from edureka! Click below to know more.

Learn Java From Experts

Servlets Interview Questions
Q1. What is a servlet?
Java Servlet is server side technologies to extend the capability of web servers by providing support for dynamic response and data persistence.
The javax.servlet and javax.servlet.http packages provide interfaces and classes for writing our own servlets.
All servlets must implement the javax.servlet.Servlet interface, which defines servlet lifecycle methods. When implementing a generic service, we can extend the GenericServlet class provided with the Java Servlet API. The HttpServlet class provides methods, such as doGet() and doPost(), for handling HTTP-specific services.
Most of the times, web applications are accessed using HTTP protocol and thats why we mostly extend HttpServlet class. Servlet API hierarchy is shown in below image.
Servlet – Java Interview Questions – Edureka

Q2. What are the differences between Get and Post methods?
Get Post
Limited amount of data can be sent because data is sent in header. Large amount of data can be sent because data is sent in body.
Not Secured because data is exposed in URL bar. Secured because data is not exposed in URL bar.
Can be bookmarked Cannot be bookmarked
Idempotent Non-Idempotent
It is more efficient and used than Post It is less efficient and used
Q3. What is Request Dispatcher?
RequestDispatcher interface is used to forward the request to another resource that can be HTML, JSP or another servlet in same application. We can also use this to include the content of another resource to the response.

There are two methods defined in this interface:

1.void forward()

2.void include()

ForwardMethod – Java Interview Questions – Edureka
IncludeMethod – Java Interview Questions – Edureka

Q4. What are the differences between forward() method and sendRedirect() methods?
Forward() method SendRedirect() method
forward() sends the same request to another resource. sendRedirect() method sends new request always because it uses the URL bar of the browser.
forward() method works at server side. sendRedirect() method works at client side.
forward() method works within the server only. sendRedirect() method works within and outside the server.
Q5. What is the life-cycle of a servlet?
There are 5 stages in the lifecycle of a servlet:LifeCycleServlet – Java Interview Questions – Edureka

Servlet is loaded
Servlet is instantiated
Servlet is initialized
Service the request
Servlet is destroyed
Q6. How does cookies work in Servlets?
Cookies are text data sent by server to the client and it gets saved at the client local machine.
Servlet API provides cookies support through javax.servlet.http.Cookie class that implements Serializable and Cloneable interfaces.
HttpServletRequest getCookies() method is provided to get the array of Cookies from request, since there is no point of adding Cookie to request, there are no methods to set or add cookie to request.
Similarly HttpServletResponse addCookie(Cookie c) method is provided to attach cookie in response header, there are no getter methods for cookie.
Q7. What are the differences between ServletContext vs ServletConfig?
The difference between ServletContext and ServletConfig in Servlets JSP is in below tabular format.

ServletConfig ServletContext
Servlet config object represent single servlet It represent whole web application running on particular JVM and common for all the servlet
Its like local parameter associated with particular servlet Its like global parameter associated with whole application
It’s a name value pair defined inside the servlet section of web.xml file so it has servlet wide scope ServletContext has application wide scope so define outside of servlet tag in web.xml file.
getServletConfig() method is used to get the config object getServletContext() method is used to get the context object.
for example shopping cart of a user is a specific to particular user so here we can use servlet config To get the MIME type of a file or application session related information is stored using servlet context object.
Q8. What are the different methods of session management in servlets?
Session is a conversational state between client and server and it can consists of multiple request and response between client and server. Since HTTP and Web Server both are stateless, the only way to maintain a session is when some unique information about the session (session id) is passed between server and client in every request and response.

Some of the common ways of session management in servlets are:

User Authentication
HTML Hidden Field
Cookies
URL Rewriting
Session Management API
************************************************************************

 

 

 

attra company ( call based through fresherworld 2016, 2017 batch )

developer
Address: No. 23 & 24, 2nd Floor, AMR Tech Park II, Hosur Main Road, Hongasandra, Bengaluru, Karnataka 560068
******************************************************************
mainframe interview question
*******************************************************

1. What is DRDA ?

DRDA stands for Distributed Relational Database Architecture. DRDA is a connection protocol for relational database processing which IBM and vendor databases use. It consists of rules for communication between a remote relational DBMS and the application.

2. Explain the use of the WHERE?

The “WHERE” clause isolates an element or row whenever it is used with a relational statement.

3. How can a LIKE table be created?

It can be made by the use of the LIKE parameter in the statement CREATE. These tables are generally required for testing the production environment.

4. What is the need of running runstats in the test environment?

It is for clearing the default values from the catalog columns. Because if the columns have default values; then the result might not be an expected one.

5. What is the need of a secondary index in IMS?

It is a substitute path into any IMS database. It can be used as a file to acquire required data.

Mainframe
Mainframe

6. Explain foreign keys?

Foreign keys are properties of a particular table having matching entries to a primary key in some another table. This results in the formation of a relation between the two tables.

7. Write about the self-referencing constraint?

It limits the changes that can be made to the primary key from a foreign key. For this purpose, the foreign key has to define a DELETE CASCADE rule.

8. What does a deadlock mean in DB2?

When two independent processes contend for the same resource or the resources reserved by one another, it is called a deadlock. -911 and -913 are the SQLcode for a deadlock.

9. What is the function of DBCTL?

It is used to access IMS files for CICS Transactions and it is an address space. PSBs, DBDs, IMS files and ACBs are fixed into DBCTL for file access. Now if an IMS call is generated by a CICS program the processing gets transferred to DBCTL to be carried, and the result is sent as reply.

10. How are TYPE 1 and TYPE 2 indexes different?

TYPE 2 index is available for DB2V4. In this type, the data pages get locked, but the index pages are not locked. Therefore, TYPE 2 index are faster.

11. What are the different types of Table spaces?

There are three table spaces, namely:

Simple
Segmented
Partitioned
12. Write the difference between HIDAM and HDAM databases?

HIDAM has a separate index file which is based on the root segment. This file has information regarding the pointer that marks the position of the data. On the other hand, HDAM file does not have separate index file, but the key field of every record is passed through a randomizer which places the record to a particular position in the database.

13. Explain referential integrity?

It is the rule that states that consistency needs to be conserved between the foreign and primary keys. This means that each foreign key entry needs to have a fitting primary key entry.

14. How are composite and multiple indexes different?

Multiple index are two indexes, one each for a column of the same table. Composite index is only one index, which consists of combined values of 2 columns of a table.

15. What is the advantage in De-normalizing tables in DB2?

It lowers the requirement for executing intensive relational joins. It also cuts the number of required foreign keys.

16. Explain Database Descriptor in brief?

DBD, short for Database Descriptor, restricts access to the database when objects get altered, created or dropped.

17. State the maximum value up to which volumes can be inserted to an STOGROUP?

Volumes can be inserted up to 133. Practically though, only 3-4 volumes, when added to an STOGROUP, becomes hard to manage and monitor.

18. Explain delete-connected tables?

Tables, which are related through a foreign key, are known as delete-connected tables. This is because whenever any entry in the primary key is deleted, it affects the values in the foreign key table too.

19. Explain lock contention?

The DBD only allows entry to one object at a particular time. Lock contention is said to happen when more than one object seeks permission for execution simultaneously.

20. What is SPUFI?

SPUFI is the abbreviated form of SQL Processing Using File Input. It is a menu-driven tool which the developers use to make objects in the database.

21. What is an alias?

It is a substitute to a synonym. Aliases are developed for distributed environments so as to avoid the use of location qualifier of a view or table. It is not dropped when the table gets deleted.

22. What is the place for VSAM KSDS?

It is the BSDS.

23. Name and explain the type of locks?

There are three types of lock, namely:

Shared – This type of lock permits two or more programs to read from the locked space but does not allow them to change it.
Update – This lock is more lenient. It permits the program to read and change the locked space.
Exclusive – This lock restricts all users from accessing the locked space.
24. Explain isolation level?

Isolation level is the degree to which the activation group in focus is isolated from the activation groups executing at the same time.

25. What is NOTCAT2?

It is an MVS message that indicates the presence of a duplicate catalogue in the database. This problem can be fixed by removing one of the entries and then adding a new one.

26. What will happen if both STEPLIB and JOBLIB are specified?

JOBLIB is a Data Definition statement. It determines the location of the program, which called the EXEC statement. JOBLIB applies to all steps present in that whole job. It is not possible to use it for catalogued procedures. STEPLIB is very similar JOBLIB. It determines the dataset in which the program exists. It applies only to one step and not the entire job. STEPLIB can be used at any position in the job step and can also be used for catalogued procedures.

In a situation when both STEPLIB and JOBLIB are specified, JOBLIB will be ignored by the system.

27. State the difference between JES2 and JES3?

In JES3, the allocation of data sets for the steps takes place even before the job is scheduled for execution. While in JES2, this allocation takes place just before the execution of each step.

28. State all the File OPEN modes?

The four File Open methods are:

INPUT
OUTPUT
EXTEND
I-O
29. Is the order of the WHEN clause significant in an EVALUATE statement?

Yes, the order is significant as the evaluation takes place in the top to bottom manner and, therefore, the order has a large impact in the determination of results.

30. When are scope terminators compulsory?

They are compulsory for EVALUATE statements and in-line PERFORMS. Scope terminators are always declared explicitly to improve readability.

31. What is linkage section?

It is a part of a program that is being called and maps to data items in the program’s (calling) working storage. Linkage Sections is where shared items are declared and defined.

32. How is NEXT SENTENCE and CONTINUE different?

The NEXT SENTENCE hands the flow of control to the statement that follows the next period. On the other hand, CONTINUE hands the flow of control to the next statement after the scope terminator.

33. What is the need to code COMMITS in batch programs?

COMMIT statements are used to release locks which are required for that unit of work, and then permit a new unit of work. In other words, if COMMITS are not coded in the program and the program has been sent for execution, then while processing, in place of just going back to a few inserts since the nearest commit, the program has to go back to the inserts which were made during the entire run of the program. This extra process takes around twice or thrice the time taken normally.

34. How is data retrieved from multiple tables using a single SQL statement?

Data can be retrieved from multiple tables by using joins, nested selects and unions.

35. Write about a ‘view’ in brief?

It is a virtual table that is made using data from base tables and other views. This table is not stored separately.

36. What parameters are used to control the free space in DB2?

Free space permits the addition of new rows.

There are two parameters, which are used to control the free space in DB2, they are:

PCTFREE – It defines the free space percentage that will be present in each page.
FREEPAGE – It specifies the number of pages to be loaded before leaving a page empty.
37. What is the function of CURRENTDATA option in bind?

It allows block fetch when selecting rows in a table. It is set to NO by default from DB2V4. So it is important to change CURRENTDATA (YES), in the bind cards, to NO in DB2V3 & earlier, as YES is the default value for them.

38. How can record locking be achieved in those DB2 versions which do not support it?

It can be done by setting the record length’s size to more than half of the page’s size.

39. State the maximum number of tables that can be joined?

The maximum numbers of tables that can be joined are fifteen.

40. Explain index cardinality?

Index cardinality is the number of discrete entries in a column. In DB2, a utility RUNSTATS examines the column value redundancy to find if an index scan or tablespace is required for searching of data.

41. Define clustered index?

A clustered index is the one in which columns are maintained in the same sequence as the rows until there is still free space in the memory. DB2 then processes the table in the given order expeditiously.

42. Name the lockable units in DB2?

DB2 implements locking on four types of units:

Pages
Indexes sub page
Tables
Table space
43. What is the function of the verb INITIALIZE?

This verb sets Alphanumeric, alphabetic and alphanumeric field items to ““(Space) and Numeric and Numeric edited field items to “0” (Zero). The INITIALIZE verb leaves FILLER items unchanged.

44. What is the importance of COMMON Attribute?

Its functions are utilized in nested COBOL programs. If COMMON attribute will not be specified, the nested programs will find it impossible to access the program. An example of COMMON program is Pgmname.

45. What will be the result if ON SIZE ERROR phrase is declared?

When the condition is true, the code written in the “ON SIZE ERROR” phrase is performed. During this process, the content of the destination field does not change.

If this phrase is not mentioned, then the statement is executed with truncation. MOVE statement does not support the ON SIZE ERROR phrase.

46. Can records be accessed randomly in ESDS?

Yes, records can be accessed randomly. It can be done by reference of Relative Byte Address (RBA). However, it is not possible to delete records.

47. Why is free space left in KSDS Dataset?

While allocating KSDS Datasets, free space is declared at regular intervals at the time of initial loading. This is done because this free space is utilized for keeping the data arranged in sequence physically, even though inserted randomly.

48. Write in brief about clusters?

It is a combination consisting of the sequence set, index and data portions in the Data set. The cluster has the program access given to it by the Operating System, and this allows access to be granted to all parts of the Dataset at the same time.

49. Explain path?

It is a file that makes accessing a file by alternate index possible. The path defines a relation between the base cluster and the AIX.

50. What is the function of IEBGENER?

IEBGENER helps in copying one SAM File to some other Source. It is also used to perform simple data reformatting through the supply of control cards via SYSIN.

 

Pole To Win WALKIN FOR SUPPORT PROFILE ONLY

DRIVE DATE 2ND APRIL TO 10TH APRIL

Address: Muneswara Nagar, Sector 6, HSR Layout, Bengaluru, Karnataka 560102

Contact person : HR

Venue:-
POLE TO WIN INDIA PRIVATE LIMITED
#290/281/276/243/244, Fortune Summit IT Park, 4th floor, 1st Main Road, Sector 6, HSR Layout, Near Silk Board Junction , Hosur Road, Bangalore – 560068 + 91 080 49103940 Extn: 340

Round 1 – it will be general introduction about yourself to HR, just like a 1 on 1 with HR / Jamming session

Round 2 – Essay writing they will check Grammar – or Aptitude test – basic stuff

Round 3 – Grammar test for 75 marks – articles,preposition , conjunction , all the basic grammar

all question 1 mark

For this check this website, i heared they are taking question from this website – http://www.english-grammar.at/

Round 4 – Technical with Team lead

Techincal stuff – definition for – adhoc testing , smoke testing , functional testing , Regression testing , sanity testing , unit testing , Integration testing , system testing – all the basic manual testing definiton

and they will ask from the game you played and ask about general storyline ,
who is publisher for the game and also the top publisher in gaming
what is consoles
type of consoles – Xbox , PS2 , PS3 , PS 4 , wii and nintendo

Round 5 – HR – general conversation with HR – like company policy and able to work in night shift and other stuff

 

CAPGEMINI COMPANY ( THROUGH COCUBE FOR 2016, 2017 BATCH )

ONLY THOSE WHO CLEAR WRITTEN TEST BY COCUBES

DRIVE DATE 2ND APRIL

Address: Rukmini Knowledge Park, Kattigenahalli, Yelahanka, Near Border Security Bustop, Bengaluru, Karnataka 560064

FOR INTERVIEW QUESTION

******************************************************************************************

Aptitude Test: Aptitude test was on paper and an objective type. The paper was divided into two sections:
(i) Quantitative 25 questions.
(ii) Analytical 25 questions.

We were given 1hr to solve the paper. There was a sectional cut-off of 10 marks (it was told in advance) and there was a provision of negative marking (0.25 marks deducted for every incorrect answer). I went for around 15 questions from both the sections and managed to clear the aptitude test. Please note that there were 3 sets of question papers and they contained very few common questions. But a lot of questions (around 8-10) in each set were repeated questions (questions that had been asked in earlier campus interviews by Capgemini). So do refer to the previous years papers…So, I will suggest you togo through all the questions by heart that I am giving with their answers.

QUANTITATIVE:
1. Find min value of fn: |-5-x| + |2-x|+|6-x|+10-x|; where x is an integer
0 17 23 19

2. units digit in expansion os 2 raised to 51 is:
2 4 6 8

3. 2 men at same tym start walking towards each other from A n B 72 kms apart. sp of A is 4kmph.Sp of B is 2 kmph in 1st hr,2.5 in 2nd, 3 in rd. n so on…when will they meet i in 7 hrs ii at 35 kms from A iii in 10 hrs iv midway

4. (8*76+19*?-60) / (?*7*12+3-52)=1
5 2 1 3

5. 45 grinders brought @ 2215/-.transpot expense 2190/-.2760/- on octroi . Find SP/piece to make profit of 20%
2585 2225 2670 3325

6. in a 2 digit no unit’s place is halved and tens place is doubled.diff bet the nos is 37.digit in unit’s place is 2 more than tens place.
24 46 42 none

7. if x-y + z = 19 , y + z =20 , x-z=3 , find d value of x+4y-5z
22 38 17 none

8. Find approx value of 39.987/0.8102+1.987*18.02
72 56 86 44

9. If the ratio of prod of 3 diff comp’s A B & C is 4:7:5 and of overall prod last yr was 4lac tones and if each comp had an increase of 20% in prod level this yr what is the prod of Comp B this yr?
2.1L 22.1L 4.1L none

10. If 70% of a no. is subtracted from itself it reduces to 81.what is two fifth of that no.? 108/54/210/none

11. If a certain sum of money at SI doubles itself in 5 yrs then what is d rate?
5% 20% 25% 14.8%

12. If radius of cylinder and sphere r same and vol of sphere and cylinder r same what is d ratio betn the radius and height of the cylinder
i. R= H
ii. R= (3/4)H
iii. R = (4/3)H
iv. R=2/3H

13. Which one of the foll fractions is arranged in ascending order
i. 9/11,7/9,11/13,13/14
ii 7/8,9/11,11/13,13/14
iii 9/11,11/13,7/8,13/14
iv none

14. A is 4 yrs old and B is thrice A>when A is 12 yrs, how old will B be?
16 20 24 28

15. Boat goes downstream from P to Q in 2hrs, upstream in 6hrs and if speed of stream was ½ of boat in still water. Find dist PQ
6 4 10 none

16. Fresh Grapes contain 90% water by wt. Dried grapes contain 20% water by %age. What will b wt of dried grapes when we begin with 20 kg fresh grapes? 2kg 2.4kg 2.5kg none

17. How many 5 digit no. can b formed wit digits 1, 2, 3,4,5,6 which r divisible by 4 and digits not repeated
144 168 192 none

18. Asish was given Rs. 158 in denominations of Rs 1 each. He distributes these in diff bags, such that ne sum of money of denomination betn 1 and 158 can be given in bags. The min no. of such bags reqd :
10 17 15 none

19.There is a rectangular Garden whose length and width are 60m X 20m.There is a walkway of uniform width around garden. Area of walkway is 516m^2. Find width of walkway:
1 2 3 4

20. In a race from pt. X to pt Y and back, Jack averages 0 miles/hr to pt Y and 10 miles/hr back to pr X.Sandy averages 20 miles/hr in both directions. If Jack and Sandy start race at same tym, who’ll finish:
i. 1st Jack ii.Sandy iii.they tie iv.Impossible to tell

21. A man engaged a servant on a condn that he’ll pay Rs 90 and also give him a bag at the end of the yr. He served for 9 months and was given a turban and Rs 65. So the price of turban is i. Rs :
10 19 0 55

22. Three wheels make 36, 24, 60 rev/min. Each has a black mark on it. It is aligned at the start of the qn. When does it align again for the first tym?
14 20 22 5sec

23. If 1= (3/4)(1+ (y/x) ) then
i. x=3y ii. x=y/3 iii. x=(2/3)y iv. none

24. The sum of six consecutive odd nos. is 888. What is the average of the nos.? i. 147 ii. 148 iii. 149 iv. 146

25. 1010/104*102=10?
i. 8 ii. 6 iii. 4 iv. none

ANALYTICAL:
Direction for Qn 1-8
Ans A using I only Ans B using II only Ans C using both I and II Ans D not solvable

1. Raman and Gaurav Brought eggs from a vendor. How many eggs were bought by each of them
i. Raman bought half as many as Gaurav
ii. The dealer had a stock of 500 eggs at the beginning of day

2. What is the age of Ramprakash?
i. Ramprakash was born when his father was 26 yrs old
ii. Ramprakash’s mothers age is 3yrs less than his father’s

3. How much time is reqd for downloading the software?
i. The Data transfer rate is 6 kbps
ii. The size of the software is 4.5 megabytes

4. Sanjay and Vijay started their journey from Mumbai to Pune. Who reached Pune first?
i. Sanjay overtakes two times Vijay and Vijay overtakes Sanjay two times
ii. Sanjay started first

5. Is the GDP of country X higher than Country Y? i. GDP’s of X and Y has been increasing at a compounded annual growth rate of 5% and 6% over he past 5 yrs ii. 5 yrs ago GDP of X was 1.2 times Y

6. A boat can ferry 1500 passengers across a river in 12 hrs. How many round trips does it make during the journey? i. The boat can carry 400 passengers at a time ii. During its journey, the boat takes 40 mins time each way and 20 mins waiting time at each end.

7. What are the values of m and n? i. n is an even integer, m is odd integer and m is greater than n. ii. The product of m and n is 30

8. How much is the weight of 20 mangoes and 30 oranges?
i. 1 orange weighs twice that of 1 mango
ii. 2 mangoes and 3 oranges weigh 2 kg

Direction for Qn 9-12
Five teams participated in Pepsi Cup. Each team played against each other. The top teams played finals. A win fetched 2 pts and a tie 1 point
1) South Africa were in the finals
2) India defeated SA but failed to reach the finals
3) Australia lost only one match in the tournament
4) The match between India and Sri Lanka was a tie
5) The undefeated team in the league matches lost in the finals
6) England was one of the best teams that did not qualify

9. Who were the finalists?
i. SA & India
ii. Aus & SL
iii. SA & SL
iv. none

10. Who won the finals?
i. Aus
ii. SL
iii. SA
iv. Can’t be determined

11. How many matches did India Win?
i. 0
ii. 1
iii. 2
iv. can’t be determined

12. What was the outcome of the India England Match
i. India won
ii. England won
iii. It was a tie
iv. Can’t be determined

Direction for Qn 13-14
These qns are based on situations given below:
7 Uni crick players are to be honored at a special luncheon. The players will be seated on a dais along one side of a single rectangular table. A and G have to leave the luncheon early and must be seated at the extreme right end of table, which is closest to exit. B will receive Man of the Match and must be in the centre chair C and D who are bitter rivals for the position of Wicket keeper dislike one another and should be seated as far apart as possible E and F are best friends and want to seat together.

13. Which of the foll may not be seated at either end of the table?
i. C ii. D iii. G iv. F

14. Which of the foll pairs may not be seated together?
i. E & A ii. B & D iii. C & F iv. G & D

Direction for Qn 15-18
An employee has to allocate offices to 6 staff members. The offices are no. 1-6. the offices are arranged in a row and they are separated from each other by dividers>hence voices, sounds and cigarette smoke flow easily from one office to another Miss R needs to use the telephone quite often throughout the day. Mr. M and Mr. B need adjacent offices as they need to consult each other often while working.

Miss H is a senior employee and his to be allotted the office no. 5, having the biggest window. Mr D requires silence in office next to his. Mr. T, Mr M and Mr. D are all smokers. Miss H finds tobacco smoke allergic and consecutively the offices next to hers are occupied by non-smokers. Unless specifically stated all the employees maintain an atmosphere of silence during office hrs.

15. The ideal candidate to occupy office farthest from Mr. B will be i. Miss H ii. Mr. M iii. Mr. T iv. Mr. D

16. The three employees who are smokers should be seated in the offices i. 1 2 4 ii. 2 3 6 iii. 1 2 3 iv. 1 2 3

17. The ideal office for Mr. M would be i. 2 ii. 6 iii. 1 iv. 3

18. In the event of what occurrence within a period of one month since the assignment of the offices would a request for a change in office be put forth by one or more employees?
i. Mr D quitting smoking
ii. Mr. T taking over duties formally taken care of by Miss R
iii. The installation of a water cooler in Miss H’s office
iv. Mr. B suffering from anemia

Direction for Qn 19-20
A robot moves on a graph sheet with x-y axes. The robot is moved by feeding it with a sequence of instructions. The different instructions that can be used in moving it, and their meanings are: Instruction Meaning GOTO(x,y) move to pt with co-ord (x,y) no matter where u are currently WALKX(P) move parallel to x-axis through a distance of p, in the +ve direction if p is +ve and in –ve if p is –ve WALKY(P) move parallel to y-axis through a distance of p, in the +ve direction if p is +ve and in –ve if p is –ve

19. The robot reaches point (5,6) when a sequence of 3 instr. Is executed, the first of which is GOTO(x,y) , WALKY(2), WALKY(4). What are the values of x and y??
i. 2,4 ii. 0,0 iii. 3,2 iv. 2,3

20. The robot is initially at (x.y), x>0 and y<0.>
i. 2 ii. 1 iii. x + y iv. 0

Direction for Qn 21-23
Ten coins are distr. Among 4 people P, Q, R, S such that one of them gets a coin, another gets 2 coins,3rd gets 3 coins, and 4th gets 4 coins. It is known that Q gets more coins than P, and S gets fewer coins than R

21. If the no. of coins distr. To Q is twice the no. distr. to P then which one of the foll. is necessarily true?
i. R gets even no. of coins
ii. R gets odd no. of coins
iii. S gets even no. of coins
iv. S gets odd no. of coins

22. If R gets at least two more coins than S which one of the foll is necessarily true?
i. Q gets at least 2 more coins than S
ii. Q gets more coins than P
iii. P gets more coins than S
iv. P and Q together get at least five coins

23. If Q gets fewer coins than R, then which one of the foll. is not necessarily true?
i. P and Q together get at least 4 coins
ii. Q and S together get at least 4 coins
iii. R and S together get at least 5 coins
iv. P and R together get at least 5 coins

Direction for Qn 24-25
Elle is 3 times older than Zaheer. Zaheer is ½ as old as Waheeda. Yogesh is elder than Zaheer.

24. What is sufficient to estimate Elle’s age?
i. Zaheer is 10 yrs old
ii. Yogesh and Waheeda are both older than Zaheer by the same no of yrs.
iii. Both of the above iv. None of the above

25. Which one of the foll. statements can be inferred from the info above i. Yogesh is elder than Waheeda ii. Elle is older than Waheeda iii. Elle’s age may be less than that of Waheeda iv. None of the above I would suggest you to go through as many Capgemini placement papers as possible. The questions are very simple. Candidates those who managed to clear the aptitude test were called for GD session.

3) Group Discussion:
All the selected candidates were divided into 13 groups of 10 students each.
The GD was being conducted simultaneously in 2 rooms. Our group got the topic “LIVE-IN RELATIONSHIP” Clearing the GD round is easy. The coordinators were really very friendly and made all the candidates relaxed. In GD, you will have to show your participation. Do open up your mouth, but at the same time, see to it that you are not disrupting others and make out a valid point atleast try to be around the point and just not beat around the bushes n blabber anything. Dont loose confidence even if you are not a very good speaker. Just give strong points, this is what matters the most. After about 1hr the list of candidates who had cleared the GD was displayed and they were asked to report in a room for further proceedings. 60 candidates cleared the GD round.

4) Personal Interview:
There were 3 interview panels consisting of 2 members each. The interviews were going on simultaneously.The interveiwer are the different ppl here …i mean not the one in GD round..one was Preeti mam..main HR she was there for PI n the other sir for technical..for interview just wanna say that be very firm with ur answers showing full confidence .If u dont knw any answer say to them….they just asked abt the dead basics of C & C++,some of Software Engg,n yes if u have gone through any project be very clear with that coz they may be asking ur contribution to that…Sir also gave me to write a logic for swapping,

Try to be confident n yes keep smiling…coz it may add extra effects…

finally the results were out…
n i was the 7th to be selected…there were total 19 selections …
***********************************************************************************************************
CAPGEMINI -QUANTITATIVE

1. Find min value of fn: |-5-x| + |2-x|+|6-x|+10-x|; where x is an integer 0 17 23 19

2. units digit in expansion os 2 raised to 51 is: 2 4 6 8

3. 2 men at same tym start walking towards each other from A n B 72 kms apart. sp of A is 4kmph.Sp of B is 2 kmph in 1st hr,2.5 in 2nd, 3 in rd. n so on…when will they meet i in 7 hrs ii at 35 kms from A iii in 10 hrs iv midway

4. (8*76+19*?-60) / (?*7*12+3-52)=1 5 2 1 3

5. 45 grinders brought @ 2215/-.transpot expense 2190/-.2760/- on octroi . Find SP/piece to make profit of 20% 2585 2225 2670 3325

6. in a 2 digit no unit’s place is halved and tens place is doubled.diff bet the nos is 37.digit in unit’s place is 2 more than tens place. 24 46 42 none

7. if x-y + z = 19 , y + z =20 , x-z=3 , find d value of x+4y-5z 22 38 17 none

8. Find approx value of 39.987/0.8102+1.987*18.02 72 56 86 44

9. If the ratio of prod of 3 diff comp’s A B & C is 4:7:5 and of overall prod last yr was 4lac tones and if each comp had an increase of 20% in prod level this yr what is the prod of Comp B this yr?
2.1L 22.1L 4.1L none

10. If 70% of a no. is subtracted from itself it reduces to 81.what is two fifth of that no.? 108/54/210/none

11. If a certain sum of money at SI doubles itself in 5 yrs then what is d rate? 5% 20% 25% 14.8%

12. If radius of cylinder and sphere r same and vol of sphere and cylinder r same what is d ratio betn the radius and height of the cylinder
i. R= H
ii. R= (3/4)H
iii. R = (4/3)H
iv. R=2/3H

13. Which one of the foll fractions is arranged in ascending order
i. 9/11,7/9,11/13,13/14
ii 7/8,9/11,11/13,13/14
iii 9/11,11/13,7/8,13/14
iv none

14. A is 4 yrs old and B is thrice A>when A is 12 yrs, how old will B be? 16 20 24 28

15. Boat goes downstream from P to Q in 2hrs, upstream in 6hrs and if speed of stream was ½ of boat in still water. Find dist PQ 6 4 10 none

16. Fresh Grapes contain 90% water by wt. Dried grapes contain 20% water by %age. What will b wt of dried grapes when we begin with 20 kg fresh grapes? 2kg 2.4kg 2.5kg none

17. How many 5 digit no. can b formed wit digits 1, 2, 3,4,5,6 which r divisible by 4 and digits not repeated 144 168 192 none

18. Asish was given Rs. 158 in denominations of Rs 1 each. He distributes these in diff bags, such that ne sum of money of denomination betn 1 and 158 can be given in bags. The min no. of such bags reqd :
10 17 15 none

19.There is a rectangular Garden whose length and width are 60m X 20m.There is a walkway of uniform width around garden. Area of walkway is 516m^2. Find width of walkway:
1 2 3 4

20. In a race from pt. X to pt Y and back, Jack averages 0 miles/hr to pt Y and 10 miles/hr back to pr X.Sandy averages 20 miles/hr in both directions. If Jack and Sandy start race at same tym, who’ll finish:
i. 1st Jack ii.Sandy iii.they tie iv.Impossible to tell

21. A man engaged a servant on a condn that he’ll pay Rs 90 and also give him a bag at the end of the yr. He served for 9 months and was given a turban and Rs 65. So the price of turban is i. Rs :
10 19 0 55

22. Three wheels make 36, 24, 60 rev/min. Each has a black mark on it. It is aligned at the start of the qn. When does it align again for the first tym?
14 20 22 5sec

23. If 1= (3/4)(1+ (y/x) ) then
i. x=3y ii. x=y/3 iii. x=(2/3)y iv. none

24. The sum of six consecutive odd nos. is 888. What is the average of the nos.? i. 147 ii. 148 iii. 149 iv. 146

25. 1010/104*102=10?
i. 8 ii. 6 iii. 4 iv. none

ANALYTICAL:
Direction for Qn 1-8
Ans A using I only Ans B using II only Ans C using both I and II Ans D not solvable
1. Raman and Gaurav Brought eggs from a vendor. How many eggs were bought by each of them
i. Raman bought half as many as Gaurav
ii. The dealer had a stock of 500 eggs at the beginning of day

2. What is the age of Ramprakash?
i. Ramprakash was born when his father was 26 yrs old
ii. Ramprakash’s mothers age is 3yrs less than his father’s

3. How much time is reqd for downloading the software?
i. The Data transfer rate is 6 kbps
ii. The size of the software is 4.5 megabytes

4. Sanjay and Vijay started their journey from Mumbai to Pune. Who reached Pune first?
i. Sanjay overtakes two times Vijay and Vijay overtakes Sanjay two times
ii. Sanjay started first

5. Is the GDP of country X higher than Country Y? i. GDP’s of X and Y has been increasing at a compounded annual growth rate of 5% and 6% over he past 5 yrs ii. 5 yrs ago GDP of X was 1.2 times Y

6. A boat can ferry 1500 passengers across a river in 12 hrs. How many round trips does it make during the journey? i. The boat can carry 400 passengers at a time ii. During its journey, the boat takes 40 mins time each way and 20 mins waiting time at each end.

7. What are the values of m and n? i. n is an even integer, m is odd integer and m is greater than n. ii. The product of m and n is 30

8. How much is the weight of 20 mangoes and 30 oranges?
i. 1 orange weighs twice that of 1 mango
ii. 2 mangoes and 3 oranges weigh 2 kg

Direction for Qn 9-12
Five teams participated in Pepsi Cup. Each team played against each other. The top teams played finals. A win fetched 2 pts and a tie 1 point
1) South Africa were in the finals
2) India defeated SA but failed to reach the finals
3) Australia lost only one match in the tournament
4) The match between India and Sri Lanka was a tie
5) The undefeated team in the league matches lost in the finals
6) England was one of the best teams that did not qualify

9. Who were the finalists?
i. SA & India
ii. Aus & SL
iii. SA & SL
iv. none

10. Who won the finals?
i. Aus
ii. SL
iii. SA
iv. Can’t be determined

11. How many matches did India Win?
i. 0
ii. 1
iii. 2
iv. can’t be determined

12. What was the outcome of the India England Match
i. India won
ii. England won
iii. It was a tie
iv. Can’t be determined

Direction for Qn 13-14
These qns are based on situations given below:
7 Uni crick players are to be honored at a special luncheon. The players will be seated on a dais along one side of a single rectangular table. A and G have to leave the luncheon early and must be seated at the extreme right end of table, which is closest to exit. B will receive Man of the Match and must be in the centre chair C and D who are bitter rivals for the position of Wicket keeper dislike one another and should be seated as far apart as possible E and F are best friends and want to seat together.

13. Which of the foll may not be seated at either end of the table?
i. C ii. D iii. G iv. F
14. Which of the foll pairs may not be seated together?
i. E & A ii. B & D iii. C & F iv. G & D

Direction for Qn 15-18
An employee has to allocate offices to 6 staff members. The offices are no. 1-6. the offices are arranged in a row and they are separated from each other by dividers>hence voices, sounds and cigarette smoke flow easily from one office to another Miss R needs to use the telephone quite often throughout the day. Mr. M and Mr. B need adjacent offices as they need to consult each other often while working.
Miss H is a senior employee and his to be allotted the office no. 5, having the biggest window. Mr D requires silence in office next to his. Mr. T, Mr M and Mr. D are all smokers. Miss H finds tobacco smoke allergic and consecutively the offices next to hers are occupied by non-smokers. Unless specifically stated all the employees maintain an atmosphere of silence during office hrs.

15. The ideal candidate to occupy office farthest from Mr. B will be i. Miss H ii. Mr. M iii. Mr. T iv. Mr. D

16. The three employees who are smokers should be seated in the offices i. 1 2 4 ii. 2 3 6 iii. 1 2 3 iv. 1 2 3

17. The ideal office for Mr. M would be i. 2 ii. 6 iii. 1 iv. 3

18. In the event of what occurrence within a period of one month since the assignment of the offices would a request for a change in office be put forth by one or more employees?
i. Mr D quitting smoking
ii. Mr. T taking over duties formally taken care of by Miss R
iii. The installation of a water cooler in Miss H’s office
iv. Mr. B suffering from anemia

Direction for Qn 19-20
A robot moves on a graph sheet with x-y axes. The robot is moved by feeding it with a sequence of instructions. The different instructions that can be used in moving it, and their meanings are: Instruction Meaning GOTO(x,y) move to pt with co-ord (x,y) no matter where u are currently WALKX(P) move parallel to x-axis through a distance of p, in the +ve direction if p is +ve and in –ve if p is –ve WALKY(P) move parallel to y-axis through a distance of p, in the +ve direction if p is +ve and in –ve if p is –ve

19. The robot reaches point (5,6) when a sequence of 3 instr. Is executed, the first of which is GOTO(x,y) , WALKY(2), WALKY(4). What are the values of x and y??
i. 2,4 ii. 0,0 iii. 3,2 iv. 2,3
20. The robot is initially at (x.y), x>0 and y<0.>
i. 2 ii. 1 iii. x + y iv. 0

Direction for Qn 21-23
Ten coins are distr. Among 4 people P, Q, R, S such that one of them gets a coin, another gets 2 coins,3rd gets 3 coins, and 4th gets 4 coins. It is known that Q gets more coins than P, and S gets fewer coins than R
21. If the no. of coins distr. To Q is twice the no. distr. to P then which one of the foll. is necessarily true?
i. R gets even no. of coins
ii. R gets odd no. of coins
iii. S gets even no. of coins
iv. S gets odd no. of coins

22. If R gets at least two more coins than S which one of the foll is necessarily true?
i. Q gets at least 2 more coins than S
ii. Q gets more coins than P
iii. P gets more coins than S
iv. P and Q together get at least five coins

23. If Q gets fewer coins than R, then which one of the foll. is not necessarily true?
i. P and Q together get at least 4 coins
ii. Q and S together get at least 4 coins
iii. R and S together get at least 5 coins
iv. P and R together get at least 5 coins

Direction for Qn 24-25
Elle is 3 times older than Zaheer. Zaheer is ½ as old as Waheeda. Yogesh is elder than Zaheer.
24. What is sufficient to estimate Elle’s age?
i. Zaheer is 10 yrs old
ii. Yogesh and Waheeda are both older than Zaheer by the same no of yrs.
iii. Both of the above iv. None of the above

25. Which one of the foll. statements can be inferred from the info above i. Yogesh is elder than Waheeda ii. Elle is older than Waheeda iii. Elle’s age may be less than that of Waheeda iv. None of the above I would suggest you to go through as many Capgemini placement papers as possible. The questions are very simple. Candidates those who managed to clear the aptitude test were called for GD session.

3) Group Discussion:
All the selected candidates were divided into 13 groups of 10 students each.
The GD was being conducted simultaneously in 2 rooms. Our group got the topic “LIVE-IN RELATIONSHIP” Clearing the GD round is easy. The coordinators were really very friendly and made all the candidates relaxed. In GD, you will have to show your participation. Do open up your mouth, but at the same time, see to it that you are not disrupting others and make out a valid point atleast try to be around the point and just not beat around the bushes n blabber anything. Dont loose confidence even if you are not a very good speaker. Just give strong points, this is what matters the most. After about 1hr the list of candidates who had cleared the GD was displayed and they were asked to report in a room for further proceedings. 60 candidates cleared the GD round.

4) Personal Interview:
There were 3 interview panels consisting of 2 members each. The interviews were going on simultaneously.The interveiwer are the different ppl here …i mean not the one in GD round..one was Preeti mam..main HR she was there for PI n the other sir for technical..for interview just wanna say that be very firm with ur answers showing full confidence .If u dont knw any answer say to them….they just asked abt the dead basics of C & C++,some of Software Engg,n yes if u have gone through any project be very clear with that coz they may be asking ur contribution to that…Sir also gave me to write a logic for swapping,
***************************************************************************************************************************************************************************

Capgemini recruitment questions in August QUANTI test of Capgemini Campus 12 August ,Capgemini written test questions with answers

1.Written test
Total 75 questions ,
Time Limit 60 minutes

Total 75 questions , 60 minutes —SECTIONAL CUTOFF IS THERE

1. Aptitude (25 quest)….20 MINUTE
2. Reasoning (25 quest)…20 MINUTE
3. English (25 quest)…20 MINUTE

Guys,Please careful…Capgemini has entered a set of question.So Don’t Try to Practise the old papers..This is new pattern..Which is exactly the same as on the kerela campus with some other questionBut out of 75 there is almost 50 question is repeated as of kerela,mumbai on 13-14 july….So try to Solve this questions because Capgemini will try to hold this set at least 2-3 year…So just prepare This set u can definitely cleared the apti Round…Don’t waste your time to Do other papers because not even a single Question will come now as of 2011 papers…The new pattern is this….Try to solve because digits may be changed by Capgemini.

Thank God,I had a look on kerela paper of at freshersworld.com.So that I was able to clear the Quanti paper….After that I cleared The GD and PI interview…see u soon at Capgemini

1. The average salary of 3 workers is 95 Rs. per week. If one earns Rs.115 and second earns Rs.65 how much is the salary of the 3rd worker.
Ans.105.

2. A 16 stored building has 12000 sq.feet on each floor. Company A rents 7 floors and company B rents 4 floors. What is the number of sq.feet of unrented floor space.
Ans.60000

3.During a given week A programmer spends 1/4 of his time preparing flow chart, 3/8 of his time coding and the rest of the time in debugging the programs. If he works 48 hours during the week , how many hours did he spend debugging the program.
Ans. 18.

4) On 8th Dec, 2007 Saturday falls. What day of the week was it on 8th Dec, 2006?

5. A man owns 2/3 of the market research beauro business and sells 3/4 of his shares for Rs. 75000. What is the value of Business ?
Ans.150000

6. If 12 file cabinets require 18 feet of wall space, how many feet of wall space will 30 cabinets require?
Ans.45

7. A computer printer produced 176,400 lines in a given day. If the printer was in operation for seven hours during the day, how many lines did it print per minute?
Ans.420

8. From its total income, A sales company spent Rs.20,000 for advertising, half of the remainder on commissions and had Rs.6000 left. What was its total income?
Ans.32000

9. On Monday a banker processed a batch of cheques, on Tuesday she processed three times as many, and on Wednesday she processed 4000 cheques. In the three days, she processed 16000 cheques. How many did she process on Tuesday?
Ans.9000

10. The cost of four dozen proof machine ribbons and five dozen accouting machine ribbons was Rs.160/-. If one dozen accounting machine ribbons cost Rs.20/-, what is the cost of a dozen proof machine ribbons?
Ans.Rs.15

11. If a clerk can process 80 cheques in half an hour, how many cheques can she process in a seven and one half hour day?
Ans.1200

12) A milk vendor has 2 cans of milk. The first contains 25% water and the rest milk. The second contains 50% water. How much milk should he mix from each of the containers so as to get 12 litres of milk such that the ratio of water to milk is 3 : 5?

13. The average length of three tapes is 6800 feet. None of the tapes is less than 6400 feet. What is the greatest possible length of one of the other tapes?
Ans.7600

14. A company rented a machine for Rs.700/- a month. Five years later the treasurer calculated that if the company had purchased the machine and paid Rs.100/- monthly maintenance charge, the company would have saved
Rs.2000/-. What was the purchase price of the machine?
Ans.Rs.34000

15. Two computers each produced 48000 public utility bills in a day. One computer printed bills at the rate of 9600 an hour and the other at the rate of 7800 an hour. When the first computer finished its run, how many bills did the other computer still have to print?
Ans.9000

16) A train passes a station platform in 36 seconds and a man standing on the platform in 20 seconds. If the speed of the train is 54 km/hr, what is the length of the platform?

17 On a given day, a bank had 16000 cheques returned by customers. Inspection of the first 800 cheques indicated that 100 of those 800 had errors and were therefore the available immediately for data processing. On this basis, how many cheques would be available immediately for data processing on that day?
Ans.14000

18. A tape manufacturer reduces the price of his heavy duty tape from Rs.30/- to Rs.28/- a reel and the price of a regular tape from Rs.24/- to Rs.23/- a reel. A computing centre normally spends Rs.1440/- a month for tapes
and 3/4 of this is for heavy duty tapes. How much will they save a month under the new prices?

Ans.Rs.87

19. The dimensions of a certain machine are 48″ X 30″ X 52″. If the size of the machine is increased proportionately until the sum of its dimensions equals 156″, what will be the increase in the shortest side?
Ans. 6″
20 In a certain company, 20% of the men and 40% of the women attended the annual company picnic. If 35% of all the employees are man, what percent of all the employees went to the picnic?
Ans.33%

21. It cost a college Rs.0.70 a copy to produce a Programme for the homecoming football game. If Rs.15,000/- was received for advertisements in the programme, how many copies at Rs.0.50 a copy must be sold to make a profit of Rs.8000/- ?
Ans. 35000

22. If the digits of my present age are reversed then i get the age of my son. If 1 year ago my age was twice as that of my son. Find my present age.
Ans. father-73, son-37

23. There are 6561 balls out of them 1 is heavy. Find the min. no. of times the balls have to be weighed for finding out the heavy ball.
Ans. 8

24.If I walk with 30 miles/hr i reach 1 hour before and if i walk with 20 miles/hr i reach 1 hour late. Find the distance between 2 points and the exact time of reaching destination is 11 am then find the speed with which it walks.
Ans. 120miles and 24 miles/hr

25) Tea worth Rs. 126 per kg and Rs. 135 per kg are mixed with a third variety in the ratio 1 : 1 : 2. If the mixture is worth Rs. 153 per kg, the price of the third variety per kg will be:

2. Reasoning (30 quest)

Answer Questions 1 to 4 on the basis of the information given below:
The only people to attend a conference were four ship captains and the first mates of three of those captains. The captains were L, M, N and O; the first mates were A, D and G Each person in turn delivered a report to the assembly as follows:

Each of the first mates delivered their report exactly after his or her captain. The first captain to speak was M, and captain N spoke after him.

1. Among the following which is not an appropriate order of delivered reports?

M, A, N, G, O, L, D
M, D, N, G, L, O, A
M, N, A, L, D, O, G
M, N, A, O, D, L, G
M, N, G, D, O, L, A

Ans : E

2. In case L speaks after A, and A is the third of the first mates to speak, then among the following statements which would be untrue?

O spoke immediately after G.
The order of the first four speakers was M, G, N, D.
O’s first mate was present.
A was the fourth speaker after M.
The captains spoke in the order M, N, O, L.

Ans : D

3. Among the following statements which statement must be true?

In case the second speaker was a captain, the seventh speaker was a first mate.
In case the second speaker was a first mate, the seventh speaker was a captain.
In case the third speaker was a first mate, the seventh speaker was a captain.
In case the third speaker was a captain, the seventh speaker was a first mate.
In case the seventh speaker was a first mate, the first and third speakers were captains.

Ans : A

4. In case A spoke immediately after L and immediately before O, and O was not the last speaker, L spoke

second
third
fourth
fifth
sixth

Ans : C

Directions to Solve – (5-9)

In each of the following questions two statements are given. Which are followed by four conclusions (1), (2), (3) and (4). Choose the conclusions which logically follow from the given statements.

5). Statements: No door is dog. All the dogs are cats.

1. No door is cat.

2. No cat is door.

3. Some cats are dogs.

4. All the cats are dogs.

A. Only (2) and (4)

B. Only (1) and (3)

C. Only (3) and (4)

D. Only (3)

E. All the four

6). Statements: All green are blue. All blue are white.

1. Some blue are green.

2. Some white are green.

3. Some green are not white.

4. All white are blue.

A. Only (1) and (2)

B. Only (1) and (3)

C. Only (1) and (4)

D. Only (2) and (4)

7). Statements: All men are vertebrates. Some mammals are vertebrates.

1. All men are mammals.

2. All mammals are men.

3. Some vertebrates are mammals.

4. All vertebrates are men.

A. Only (4)

B. Only (2)

C. Only (3)

D. Only (1)

E. Only (1) and (3

8). Statements: All the phones are scales. All the scales are calculators.

1. All the calculators are scales.

2. All the phones are calculators

Infogain India Private Limited ( CALL BASED THROUGH JOBHUNTER LINK 2016, 2017)

NOIDA CAMPUS
DRIVE DATE 7 /4/2018

Address: A-16, Block A, Sector 60, Noida, Uttar Pradesh 201301

***********************************************************
FOR ONLINE TEST
********************************************************

Time and Distance
Time and Work
Compound Interest
Partnership
Problems on Ages
Clock
Area
Permutation and Combination
Problems on Numbers
Decimal Fraction
Square Root and Cube Root
Ratio and Proportion
Pipes and Cistern
**********************************************************************

https://www.glassdoor.co.in/Interview/Infogain-Interview-Questions-E31605.htm
**********************************************************
1. Which two method you need to implement for key Object in HashMap ?
In order to use any object as Key in HashMap, it must implements equals and hashcode method in Java. Read How HashMap works in Java for detailed explanation on how equals and hashcode method is used to put and get object from HashMap.

2. What is immutable object? Can you write immutable object?Immutable classes are Java classes whose objects can not be modified once created. Any modification in Immutable object result in new object. For example is String is immutable in Java. Mostly Immutable are also final in Java, in order to prevent sub class from overriding methods in Java which can compromise Immutability. You can achieve same functionality by making member as non final but private and not modifying them except in constructor.

3. What is the difference between creating String as new() and literal?
When we create string with new() Operator, it’s created in heap and not added into string pool while String created using literal are created in String pool itself which exists in PermGen area of heap.

String s = new String(“Test”);

does not put the object in String pool , we need to call String.intern() method which is used to put them into String pool explicitly. its only when you create String object as String literal e.g. String s = “Test” Java automatically put that into String pool.

4. What is difference between StringBuffer and StringBuilder in Java ?

Classic Java questions which some people thing tricky and some consider very easy. StringBuilder in Java is introduced in Java 5 and only difference between both of them is that Stringbuffer methods are synchronized while StringBuilder is non synchronized. See StringBuilder vs StringBuffer for more differences.

5. Write code to find the First non repeated character in the String ?
Another good Java interview question, This question is mainly asked by Amazon and equivalent companies. See first non repeated character in the string : Amazon interview question

6. What is the difference between ArrayList and Vector ?
This question is mostly used as a start up question in Technical interviews on the topic of Collection framework . Answer is explained in detail here Difference between ArrayList and Vector .

7. How do you handle error condition while writing stored procedure or accessing stored procedure from java?
This is one of the tough Java interview question and its open for all, my friend didn’t know the answer so he didn’t mind telling me. my take is that stored procedure should return error code if some operation fails but if stored procedure itself fail than catching SQLException is only choice.

8. What is difference between Executor.submit() and Executer.execute() method ?
There is a difference when looking at exception handling. If your tasks throws an exception and if it was submitted with execute this exception will go to the uncaught exception handler (when you don’t have provided one explicitly, the default one will just print the stack trace to System.err). If you submitted the task with submit any thrown exception, checked exception or not, is then part of the task’s return status. For a task that was submitted with submit and that terminates with an exception, the Future.get will re-throw this exception, wrapped in an ExecutionException.

9. What is the difference between factory and abstract factory pattern?
Abstract Factory provides one more level of abstraction. Consider different factories each extended from an Abstract Factory and responsible for creation of different hierarchies of objects based on the type of factory. E.g. AbstractFactory extended by AutomobileFactory, UserFactory, RoleFactory etc. Each individual factory would be responsible for creation of objects in that genre.
You can also refer What is Factory method design pattern in Java to know more details.

10. What is Singleton? is it better to make whole method synchronized or only critical section synchronized ?
Singleton in Java is a class with just one instance in whole Java application, for example java.lang.Runtime is a Singleton class. Creating Singleton was tricky prior Java 4 but once Java 5 introduced Enum its very easy. see my article How to create thread-safe Singleton in Java for more details on writing Singleton using enum and double checked locking which is purpose of this Java interview question.

11. Can you write critical section code for singleton?
This core Java question is followup of previous question and expecting candidate to write Java singleton using double checked locking. Remember to use volatile variable to make Singleton thread-safe.

12. Can you write code for iterating over hashmap in Java 4 and Java 5 ?
Tricky one but he managed to write using while and for loop.

13. When do you override hashcode and equals() ?
Whenever necessary especially if you want to do equality check or want to use your object as key in HashMap.

14. What will be the problem if you don’t override hashcode() method ?
You will not be able to recover your object from hash Map if that is used as key in HashMap.
See here How HashMap works in Java for detailed explanation.

15. Is it better to synchronize critical section of getInstance() method or whole getInstance() method ?
Answer is critical section because if we lock whole method than every time some one call this method will have to wait even though we are not creating any object)

16. What is the difference when String is gets created using literal or new() operator ?
When we create string with new() its created in heap and not added into string pool while String created using literal are created in String pool itself which exists in Perm area of heap.

17. Does not overriding hashcode() method has any performance implication ?
This is a good question and open to all , as per my knowledge a poor hashcode function will result in frequent collision in HashMap which eventually increase time for adding an object into Hash Map.

18. What’s wrong using HashMap in multithreaded environment? When get() method go to infinite loop ?
Another good question. His answer was during concurrent access and re-sizing.

19. What do you understand by thread-safety ? Why is it required ? And finally, how to achieve thread-safety in Java Applications ?

Java Memory Model defines the legal interaction of threads with the memory in a real computer system. In a way, it describes what behaviors are legal in multi-threaded code. It determines when a Thread can reliably see writes to variables made by other threads. It defines semantics for volatile, final & synchronized, that makes guarantee of visibility of memory operations across the Threads.

Let’s first discuss about Memory Barrier which are the base for our further discussions. There are two type of memory barrier instructions in JMM – read barriers and write barrier.

A read barrier invalidates the local memory (cache, registers, etc) and then reads the contents from the main memory, so that changes made by other threads becomes visible to the current Thread.
A write barrier flushes out the contents of the processor’s local memory to the main memory, so that changes made by the current Thread becomes visible to the other threads.
JMM semantics for synchronized
When a thread acquires monitor of an object, by entering into a synchronized block of code, it performs a read barrier (invalidates the local memory and reads from the heap instead). Similarly exiting from a synchronized block as part of releasing the associated monitor, it performs a write barrier (flushes changes to the main memory)
Thus modifications to a shared state using synchronized block by one Thread, is guaranteed to be visible to subsequent synchronized reads by other threads. This guarantee is provided by JMM in presence of synchronized code block.

JMM semantics for Volatile fields
Read & write to volatile variables have same memory semantics as that of acquiring and releasing a monitor using synchronized code block. So the visibility of volatile field is guaranteed by the JMM. Moreover afterwards Java 1.5, volatile reads and writes are not reorderable with any other memory operations (volatile and non-volatile both). Thus when Thread A writes to a volatile variable V, and afterwards Thread B reads from variable V, any variable values that were visible to A at the time V was written are guaranteed now to be visible to B.

Let’s try to understand the same using the following code

Data data = null;
volatile boolean flag = false;

Thread A
————-
data = new Data();
flag = true; <– writing to volatile will flush data as well as flag to main memory

Thread B
————-
if(flag==true){ <– as=”” barrier=”” data.=”” flag=”” font=”” for=”” from=”” perform=”” read=”” reading=”” volatile=”” well=”” will=””>
use data; <!— data is guaranteed to visible even though it is not declared volatile because of the JMM semantics of volatile flag.
}

20. What will happen if you call return statement or System.exit on try or catch block ? will finally block execute?
This is a very popular tricky Java question and its tricky because many programmer think that finally block always executed. This question challenge that concept by putting return statement in try or catch block or calling System.exit from try or catch block. Answer of this tricky question in Java is that finally block will execute even if you put return statement in try block or catch block but finally block won’t run if you call System.exit form try or catch.

19. Can you override private or static method in Java ?
Another popular Java tricky question, As I said method overriding is a good topic to ask trick questions in Java. Anyway, you can not override private or static method in Java, if you create similar method with same return type and same method arguments that’s called method hiding.

20. What will happen if we put a key object in a HashMap which is already there ?
This tricky Java questions is part of How HashMap works in Java, which is also a popular topic to create confusing and tricky question in Java. well if you put the same key again than it will replace the old mapping because HashMap doesn’t allow duplicate keys.

21. If a method throws NullPointerException in super class, can we override it with a method which throws RuntimeException?
One more tricky Java questions from overloading and overriding concept. Answer is you can very well throw super class of RuntimeException in overridden method but you can not do same if its checked Exception.

22. What is the issue with following implementation of compareTo() method in Java

public int compareTo(Object o){
Employee emp = (Employee) emp;
return this.id – o.id;
}

23. How do you ensure that N thread can access N resources without deadlock
If you are not well versed in writing multi-threading code then this is real tricky question for you. This Java question can be tricky even for experienced and senior programmer, who are not really exposed to deadlock and race conditions. Key point here is order, if you acquire resources in a particular order and release resources in reverse order you can prevent deadlock.

24. What is difference between CyclicBarrier and CountDownLatch in Java
Relatively newer Java tricky question, only been introduced form Java 5. Main difference between both of them is that you can reuse CyclicBarrier even if Barrier is broken but you can not reuse CountDownLatch in Java. See CyclicBarrier vs CountDownLatch in Java for more differences.

25. Can you access non static variable in static context?
Another tricky Java question from Java fundamentals. No you can not access static variable in non static context in Java. Read why you can not access non-static variable from static method to learn more about this tricky Java questions
*************************************************************************************************************

RENTMYSTAY COMPANY HIREING FOR JAVA DEVELOPER THROUGH JOBHUNTER LINKS
DRIVE DATE 3/4/2018 AND 4/4/2018

Address: 323, Hosur Rd, Santhosapuram, Venkatapura, HSR Layout 5th Sector, Bengaluru, Karnataka 560068

FOR INTERVIEW QUESTION
************************************************************

***************************************************************
https://www.glassdoor.co.in/Interview/RentMyStay-Interview-Questions-E1553243.htm

\*****************************************
1st Round there will be 4 program
***********************************************

Java Interview Programs
*******************************************************************************
Write a program to get a line with max word count from the given file.
Write a program to convert string to number without using Integer.parseInt() method.
Write a program to find two lines with max characters in descending order.
Write a program to find the sum of the first 1000 prime numbers.
Find longest substring without repeating characters.
Write a program to remove duplicates from sorted array.
How to sort a Stack using a temporary Stack?
Write a program to print all permutations of a given string.
Implement Binary Search Tree (BST)
Find min and max value from Binary Search Tree (BST)
Find height of a Binary Search Tree (BST)
Implement Binary Search Tree (BST) Level order traversal (breadth first).
Implement Binary Search Tree (BST) pre-order traversal (depth first).
Implement Binary Search Tree (BST) in-order traversal (depth first).
Implement Binary Search Tree (BST) post-order traversal (depth first).
How to check the given Binary Tree is Binary Search Tree (BST) or not?
How to delete a node from Binary Search Tree (BST)?
****************************************************************************
In technical round
they will check your logic and programing skill the frequently ask qustion is to find prime number, print star in some pattern, Some SQL queries and OPPS Concept.

Can we Overload or Override static methods in java ?

Overriding : Overriding is related to run-time polymorphism. A subclass (or derived class) provides a specific implementation of a method in superclass (or base class) at runtime.
Overloading: Overloading is related to compile time (or static) polymorphism. This feature allows different methods to have same name, but different signatures, especially number of input parameters and type of input paramaters.
Can we overload static methods? The answer is ‘Yes’. We can have two ore more static methods with same name, but differences in input parameters
Can we Override static methods in java? We can declare static methods with same signature in subclass, but it is not considered overriding as there won’t be any run-time polymorphism. Hence the answer is ‘No’. Static methods cannot be overridden because method overriding only occurs in the context of dynamic (i.e. runtime) lookup of methods. Static methods (by their name) are looked up statically (i.e. at compile-time).
Read more

Why the main method is static in java?
The method is static because otherwise there would be ambiguity: which constructor should be called? Especially if your class looks like this:

public class JavaClass
{
protected JavaClass(int x)
{ }
public void main(String[] args)
{

}
}
Should the JVM call new JavaClass(int)? What should it pass for x? If not, should the JVM instantiate JavaClass without running any constructor method? because that will special-case your entire class – sometimes you have an instance that hasn’t been initialized, and you have to check for it in every method that could be called. There are just too many edge cases and ambiguities for it to make sense for the JVM to have to instantiate a class before the entry point is called. That’s why main is static.

What happens if you remove static modifier from the main method?
Program compiles successfully . But at runtime throws an error “NoSuchMethodError”.

What is the scope of variables in Java in following cases?

Member Variables (Class Level Scope) : The member variables must be declared inside class (outside any function). They can be directly accessed anywhere in class
Local Variables (Method Level Scope) : Variables declared inside a method have method level scope and can’t be accessed outside the method.
Loop Variables (Block Scope) : A variable declared inside pair of brackets “{” and “}” in a method has scope withing the brackets only.
Read more

What is “this” keyword in java?
Within an instance method or a constructor, this is a reference to the current object — the object whose method or constructor is being called. You can refer to any member of the current object from within an instance method or a constructor by using this.
Usage of this keyword

Used to refer current class instance variable.
To invoke current class constructor.
It can be passed as an argument in the method call.
It can be passed as argument in the constructor call.
Used to return the current class instance.
Used to invoke current class method (implicitly)

What is an abstract class? How abstract classes are similar or different in Java from C++?
Abstract classes are classes that contain one or more abstract methods. An abstract method is a method that is declared, but contains no implementation. Abstract classes may not be instantiated, and require subclasses to provide implementations for the abstract methods.

Like C++, in Java, an instance of an abstract class cannot be created, we can have references of abstract class type though.
Like C++, an abstract class can contain constructors in Java. And a constructor of abstract class is called when an instance of a inherited class is created
In Java, we can have an abstract class without any abstract method. This allows us to create classes that cannot be instantiated, but can only be inherited.
Abstract classes can also have final methods (methods that cannot be overridden). For example, the following program compiles and runs fine.
Read more

Which class is the superclass for every class ?
Object class

Can we overload main() method?
The main method in Java is no extra-terrestrial method. Apart from the fact that main() is just like any other method & can be overloaded in a similar manner, JVM always looks for the method signature to launch the program.

The normal main method acts as an entry point for the JVM to start the execution of program.
We can overload the main method in Java. But the program doesn’t execute the overloaded main method when we run your program, we need to call the overloaded main method from the actual main method only.
Read more

What is object cloning?
Object cloning means to create an exact copy of the original object. If a class needs to support cloning, it must implement java.lang.Cloneable interface and override clone() method from Object class. Syntax of the clone() method is :

protected Object clone() throws CloneNotSupportedException
If the object’s class doesn’t implement Cloneable interface then it throws an exception ‘CloneNotSupportedException’ .

Read more

How is inheritance in C++ different from Java?

In Java, all classes inherit from the Object class directly or indirectly. Therefore, there is always a single inheritance tree of classes in Java, and Object class is root of the tree.
In Java, members of the grandparent class are not directly accessible. See this G-Fact for more details.
The meaning of protected member access specifier is somewhat different in Java. In Java, protected members of a class “A” are accessible in other class “B” of same package, even if B doesn’t inherit from A (they both have to be in the same package).
Java uses extends keyword for inheritance. Unlike C++, Java doesn’t provide an inheritance specifier like public, protected or private. Therefore, we cannot change the protection level of members of base class in Java, if some data member is public or protected in base class then it remains public or protected in derived class. Like C++, private members of base class are not accessible in derived class.
Unlike C++, in Java, we don’t have to remember those rules of inheritance which are combination of base class access specifier and inheritance specifier.
In Java, methods are virtual by default. In C++, we explicitly use virtual keyword. See this G-Fact for more details.
Java uses a separate keyword interface for interfaces, and abstract keyword for abstract classes and abstract functions.
Unlike C++, Java doesn’t support multiple inheritance. A class cannot inherit from more than one class. A class can implement multiple interfaces though.
In C++, default constructor of parent class is automatically called, but if we want to call parametrized constructor of a parent class, we must use Initializer list. Like C++, default constructor of the parent class is automatically called in Java, but if we want to call parameterized constructor then we must use super to call the parent constructor.
See examples here

Why method overloading is not possible by changing the return type in java?
In C++ and Java, functions can not be overloaded if they differ only in the return type . The return type of functions is not a part of the mangled name which is generated by the compiler for uniquely identifying each function. The No of arguments, Type of arguments & Sequence of arguments are the parameters which are used to generate the unique mangled name for each function. It is on the basis of these unique mangled names that compiler can understand which function to call even if the names are same(overloading).

Can we override private methods in Java?
No, a private method cannot be overridden since it is not visible from any other class. Read more

What is blank final variable?
A final variable in Java can be assigned a value only once, we can assign a value either in declaration or later.

final int i = 10;
i = 30; // Error because i is final.
A blank final variable in Java is a final variable that is not initialized during declaration. Below is a simple example of blank final.

// A simple blank final example
final int i;
i = 30;
Read more

What is “super” keyword in java?
The super keyword in java is a reference variable that is used to refer parent class objects. The keyword “super” came into the picture with the concept of Inheritance. Whenever you create the instance of subclass, an instance of parent class is created implicitly i.e. referred by super reference variable.
Various scenarios of using java super Keyword:

super is used to refer immediate parent instance variable
super is used to call parent class method
super() is used to call immediate parent constructor
Read more

What is static variable in Java?
The static keyword in java is used for memory management mainly. We can apply java static keyword with variables, methods, blocks and nested class. The static keyword belongs to the class than instance of the class.

The static can be:

variable (also known as class variable)
method (also known as class method)
block
nested class

Differences between HashMap and HashTable in Java.
1. HashMap is non synchronized. It is not-thread safe and can’t be shared between many threads without proper synchronization code whereas Hashtable is synchronized. It is thread-safe and can be shared with many threads.
2. HashMap allows one null key and multiple null values whereas Hashtable doesn’t allow any null key or value.
3. HashMap is generally preferred over HashTable if thread synchronization is not needed
Read more

How are Java objects stored in memory?
In Java, all objects are dynamically allocated on Heap. This is different from C++ where objects can be allocated memory either on Stack or on Heap. In C++, when we allocate abject using new(), the object is allocated on Heap, otherwise on Stack if not global or static.
In Java, when we only declare a variable of a class type, only a reference is created (memory is not allocated for the object).

*********************************************************************

 

IPsoft Global Services ( call based 2016, 2017 THROUGHFRESHERWORLD )

DRIVE DATE 3/4/ 2018

Address: 5th Floor, Voyager Building, Ascendas ITPB SEZ, ITPB, Whitefield Road, Bengaluru, Karnataka 560066
Hours: Open 24 hours

Eligibility:
BE/ B.Tech (CS/IT/ECE/EEE) from 2016 and 2017 batch with an aggregate of 65% and above throughout.
Job Description :
Must have excellent communication skills
Should be ready to work in 24X7 environment (rotational shifts)
Good to have basic technical knowledge on:
Basic server administration skills (Good to have any certification or relevant experience on Microsoft/Database/Application servers but NOT MANDATORY)
ITIL certification (good to have)

Job Location : Bangalore

Interview rounds:
Aptitude test
Group Discussion
HR discussion
Technical discussions (2)
Salary : 3 LPA

APPLY LINKS
**************************************************************
http://my-jobhunter.com/bangalore/bangalore-new-links/
**************************************************************

Time and Distance
Time and Work
Compound Interest
Partnership
Problems on Ages
Clock
Area
Permutation and Combination

***************************************
data Structures interview question
***********************************************

What are linear and non linear data Structures?

Linear: A data structure is said to be linear if its elements form a sequence or a linear list. Examples: Array. Linked List, Stacks and Queues
Non-Linear: A data structure is said to be non-linear if traversal of nodes is nonlinear in nature. Example: Graph and Trees.

What are the various operations that can be performed on different Data Structures?

Insertion − Add a new data item in the given collection of data items.
Deletion − Delete an existing data item from the given collection of data items.
Traversal − Access each data item exactly once so that it can be processed.
Searching − Find out the location of the data item if it exists in the given collection of data items.
Sorting − Arranging the data items in some order i.e. in ascending or descending order in case of numerical data and in dictionary order in case of alphanumeric data.

How is an Array different from Linked List?

The size of the arrays is fixed, Linked Lists are Dynamic in size.
Inserting and deleting a new element in an array of elements is expensive, Whereas both insertion and deletion can easily be done in Linked Lists.
Random access is not allowed in Linked Listed.
Extra memory space for a pointer is required with each element of the Linked list.
Arrays have better cache locality that can make a pretty big difference in performance.

What is Stack and where it can be used?

Stack is a linear data structure which the order LIFO(Last In First Out) or FILO(First In Last Out) for accessing elements. Basic operations of stack are : Push, Pop , Peek

Applications of Stack:

Infix to Postfix Conversion using Stack
Evaluation of Postfix Expression
Reverse a String using Stack
Implement two stacks in an array
Check for balanced parentheses in an expression

What is a Queue, how it is different from stack and how is it implemented?

Queue is a linear structure which follows the order is First In First Out (FIFO) to access elements. Mainly the following are basic operations on queue: Enqueue, Dequeue, Front, Rear
The difference between stacks and queues is in removing. In a stack we remove the item the most recently added; in a queue, we remove the item the least recently added. Both Queues and Stacks can be implemented using Arrays and Linked Lists.

What are Infix, prefix, Postfix notations?

Infix notation: X + Y – Operators are written in-between their operands. This is the usual way we write expressions. An expression such as
A * ( B + C ) / D
Postfix notation (also known as “Reverse Polish notation”): X Y + Operators are written after their operands. The infix expression given above is equivalent to
A B C + * D/
Prefix notation (also known as “Polish notation”): + X Y Operators are written before their operands. The expressions given above are equivalent to
/ * A + B C D
Converting between these notations: Click here

What is a Linked List and What are its types?

A linked list is a linear data structure (like arrays) where each element is a separate object. Each element (that is node) of a list is comprising of two items – the data and a reference to the next node.Types of Linked List :

Singly Linked List : In this type of linked list, every node stores address or reference of next node in list and the last node has next address or reference as NULL. For example 1->2->3->4->NULL
Doubly Linked List : Here, here are two references associated with each node, One of the reference points to the next node and one to the previous node. Eg. NULL<-1<->2<->3->NULL
Circular Linked List : Circular linked list is a linked list where all nodes are connected to form a circle. There is no NULL at the end. A circular linked list can be a singly circular linked list or doubly circular linked list. Eg. 1->2->3->1 [The next pointer of last node is pointing to the first]

Which data structures are used for BFS and DFS of a graph?

Queue is used for BFS
Stack is used for DFS. DFS can also be implemented using recursion (Note that recursion also uses function call stack).

Can doubly linked be implemented using a single pointer variable in every node?
Doubly linked list can be implemented using a single pointer. See XOR Linked List – A Memory Efficient Doubly Linked List

How to implement a stack using queue?

A stack can be implemented using two queues. Let stack to be implemented be ‘s’ and queues used to implement be ‘q1’ and ‘q2’. Stack ‘s’ can be implemented in two ways:

Method 1 (By making push operation costly)
Method 2 (By making pop operation costly) See Implement Stack using Queues

How to implement a queue using stack?

A queue can be implemented using two stacks. Let queue to be implemented be q and stacks used to implement q be stack1 and stack2. q can be implemented in two ways:

Method 1 (By making enQueue operation costly)
Method 2 (By making deQueue operation costly) See Implement Queue using Stacks

Which Data Structure Should be used for implementiong LRU cache?

We use two data structures to implement an LRU Cache.

Queue which is implemented using a doubly linked list. The maximum size of the queue will be equal to the total number of frames available (cache size).The most recently used pages will be near front end and least recently pages will be near rear end.
A Hash with page number as key and address of the corresponding queue node as value. See How to implement LRU caching scheme? What data structures should be used?

How to check if a given Binary Tree is BST or not?
If inorder traversal of a binary tree is sorted, then the binary tree is BST. The idea is to simply do inorder traversal and while traversing keep track of previous key value. If current key value is greater, then continue, else return false. See A program to check if a binary tree is BST or not for more details.

Linked List Questions

Linked List Insertion
Linked List Deletion
middle of a given linked list
Nth node from the end of a Linked List

Tree Traversal Questions

Inorder
Preorder and Postoder Traversals
Level order traversal
Height of Binary Tree

Convert a DLL to Binary Tree in-place
See In-place conversion of Sorted DLL to Balanced BST

Convert Binary Tree to DLL in-place
See Convert a given Binary Tree to Doubly Linked List | Set 1, Convert a given Binary Tree to Doubly Linked List | Set 2

Delete a given node in a singly linked list
Given only a pointer to a node to be deleted in a singly linked list, how do you delete it?

Reverse a Linked List
Write a function to reverse a linked list

Detect Loop in a Linked List
Write a C function to detect loop in a linked list.

Which data structure is used for dictionary and spell checker?
Data Structure for Dictionary and Spell Checker?

***********************************************************************************************
sql interview question
******************************************************************************

What is RDBMS?

RDBMS stands for Relational Database Management System. RDBMS store the data into the collection of tables, which is related by common fields between the columns of the table. It also provides relational operators to manipulate the data stored into the tables.

Example: SQL Server.

3. What is SQL?

SQL stands for Structured Query Language , and it is used to communicate with the Database. This is a standard language used to perform tasks such as retrieval, updation, insertion and deletion of data from a database.

Standard SQL Commands are Select.

4. What is a Database?

Database is nothing but an organized form of data for easy access, storing, retrieval and managing of data. This is also known as structured form of data which can be accessed in many ways.

Example: School Management Database, Bank Management Database.

5. What are tables and Fields?

A table is a set of data that are organized in a model with Columns and Rows. Columns can be categorized as vertical, and Rows are horizontal. A table has specified number of column called fields but can have any number of rows which is called record.

Example:.

Table: Employee.

Field: Emp ID, Emp Name, Date of Birth.

Data: 201456, David, 11/15/1960.

sql-512

6. What is a primary key?

A primary key is a combination of fields which uniquely specify a row. This is a special kind of unique key, and it has implicit NOT NULL constraint. It means, Primary key values cannot be NULL.

7. What is a unique key?

A Unique key constraint uniquely identified each record in the database. This provides uniqueness for the column or set of columns.

A Primary key constraint has automatic unique constraint defined on it. But not, in the case of Unique Key.

There can be many unique constraint defined per table, but only one Primary key constraint defined per table.

8. What is a foreign key?

A foreign key is one table which can be related to the primary key of another table. Relationship needs to be created between two tables by referencing foreign key with the primary key of another table.

9. What is a join?

This is a keyword used to query data from more tables based on the relationship between the fields of the tables. Keys play a major role when JOINs are used.

10. What are the types of join and explain each?

There are various types of join which can be used to retrieve data and it depends on the relationship between tables.

Inner join.

Inner join return rows when there is at least one match of rows between the tables.

Right Join.

Right join return rows which are common between the tables and all rows of Right hand side table. Simply, it returns all the rows from the right hand side table even though there are no matches in the left hand side table.

Left Join.

Left join return rows which are common between the tables and all rows of Left hand side table. Simply, it returns all the rows from Left hand side table even though there are no matches in the Right hand side table.

Full Join.

Full join return rows when there are matching rows in any one of the tables. This means, it returns all the rows from the left hand side table and all the rows from the right hand side table.

11. What is normalization?

Normalization is the process of minimizing redundancy and dependency by organizing fields and table of a database. The main aim of Normalization is to add, delete or modify field that can be made in a single table.

12. What is Denormalization.

DeNormalization is a technique used to access the data from higher to lower normal forms of database. It is also process of introducing redundancy into a table by incorporating data from the related tables.

13. What are all the different normalizations?

The normal forms can be divided into 5 forms, and they are explained below -.

First Normal Form (1NF):.

This should remove all the duplicate columns from the table. Creation of tables for the related data and identification of unique columns.

Second Normal Form (2NF):.

Meeting all requirements of the first normal form. Placing the subsets of data in separate tables and Creation of relationships between the tables using primary keys.

Third Normal Form (3NF):.

This should meet all requirements of 2NF. Removing the columns which are not dependent on primary key constraints.

Fourth Normal Form (3NF):.

Meeting all the requirements of third normal form and it should not have multi- valued dependencies.

14. What is a View?

A view is a virtual table which consists of a subset of data contained in a table. Views are not virtually present, and it takes less space to store. View can have data of one or more tables combined, and it is depending on the relationship.

15. What is an Index?

An index is performance tuning method of allowing faster retrieval of records from the table. An index creates an entry for each value and it will be faster to retrieve data.

16. What are all the different types of indexes?

There are three types of indexes -.

Unique Index.

This indexing does not allow the field to have duplicate values if the column is unique indexed. Unique index can be applied automatically when primary key is defined.

Clustered Index.

This type of index reorders the physical order of the table and search based on the key values. Each table can have only one clustered index.

NonClustered Index.

NonClustered Index does not alter the physical order of the table and maintains logical order of data. Each table can have 999 nonclustered indexes.

17. What is a Cursor?

A database Cursor is a control which enables traversal over the rows or records in the table. This can be viewed as a pointer to one row in a set of rows. Cursor is very much useful for traversing such as retrieval, addition and removal of database records.

18. What is a relationship and what are they?

Database Relationship is defined as the connection between the tables in a database. There are various data basing relationships, and they are as follows:.

One to One Relationship.
One to Many Relationship.
Many to One Relationship.
Self-Referencing Relationship.
19. What is a query?

A DB query is a code written in order to get the information back from the database. Query can be designed in such a way that it matched with our expectation of the result set. Simply, a question to the Database.

20. What is subquery?

A subquery is a query within another query. The outer query is called as main query, and inner query is called subquery. SubQuery is always executed first, and the result of subquery is passed on to the main query.

21. What are the types of subquery?

There are two types of subquery – Correlated and Non-Correlated.

A correlated subquery cannot be considered as independent query, but it can refer the column in a table listed in the FROM the list of the main query.

A Non-Correlated sub query can be considered as independent query and the output of subquery are substituted in the main query.

22. What is a stored procedure?

Stored Procedure is a function consists of many SQL statement to access the database system. Several SQL statements are consolidated into a stored procedure and execute them whenever and wherever required.

23. What is a trigger?

A DB trigger is a code or programs that automatically execute with response to some event on a table or view in a database. Mainly, trigger helps to maintain the integrity of the database.

Example: When a new student is added to the student database, new records should be created in the related tables like Exam, Score and Attendance tables.

24. What is the difference between DELETE and TRUNCATE commands?

DELETE command is used to remove rows from the table, and WHERE clause can be used for conditional set of parameters. Commit and Rollback can be performed after delete statement.

TRUNCATE removes all rows from the table. Truncate operation cannot be rolled back.

25. What are local and global variables and their differences?

Local variables are the variables which can be used or exist inside the function. They are not known to the other functions and those variables cannot be referred or used. Variables can be created whenever that function is called.

Global variables are the variables which can be used or exist throughout the program. Same variable declared in global cannot be used in functions. Global variables cannot be created whenever that function is called.

26. What is a constraint?

Constraint can be used to specify the limit on the data type of table. Constraint can be specified while creating or altering the table statement. Sample of constraint are.

NOT NULL.
CHECK.
DEFAULT.
UNIQUE.
PRIMARY KEY.
FOREIGN KEY.
27. What is data Integrity?

Data Integrity defines the accuracy and consistency of data stored in a database. It can also define integrity constraints to enforce business rules on the data when it is entered into the application or database.

28. What is Auto Increment?

Auto increment keyword allows the user to create a unique number to be generated when a new record is inserted into the table. AUTO INCREMENT keyword can be used in Oracle and IDENTITY keyword can be used in SQL SERVER.

Mostly this keyword can be used whenever PRIMARY KEY is used.

29. What is the difference between Cluster and Non-Cluster Index?

Clustered index is used for easy retrieval of data from the database by altering the way that the records are stored. Database sorts out rows by the column which is set to be clustered index.

A nonclustered index does not alter the way it was stored but creates a complete separate object within the table. It point back to the original table rows after searching.

30. What is Datawarehouse?

Datawarehouse is a central repository of data from multiple sources of information. Those data are consolidated, transformed and made available for the mining and online processing. Warehouse data have a subset of data called Data Marts.

31. What is Self-Join?

Self-join is set to be query used to compare to itself. This is used to compare values in a column with other values in the same column in the same table. ALIAS ES can be used for the same table comparison.

32. What is Cross-Join?

Cross join defines as Cartesian product where number of rows in the first table multiplied by number of rows in the second table. If suppose, WHERE clause is used in cross join then the query will work like an INNER JOIN.

33. What is user defined functions?

User defined functions are the functions written to use that logic whenever required. It is not necessary to write the same logic several times. Instead, function can be called or executed whenever needed.

34. What are all types of user defined functions?

Three types of user defined functions are.

Scalar Functions.
Inline Table valued functions.
Multi statement valued functions.
Scalar returns unit, variant defined the return clause. Other two types return table as a return.

35. What is collation?

Collation is defined as set of rules that determine how character data can be sorted and compared. This can be used to compare A and, other language characters and also depends on the width of the characters.

ASCII value can be used to compare these character data.

36. What are all different types of collation sensitivity?

Following are different types of collation sensitivity -.

Case Sensitivity – A and a and B and b.
Accent Sensitivity.
Kana Sensitivity – Japanese Kana characters.
Width Sensitivity – Single byte character and double byte character.
37. Advantages and Disadvantages of Stored Procedure?

Stored procedure can be used as a modular programming – means create once, store and call for several times whenever required. This supports faster execution instead of executing multiple queries. This reduces network traffic and provides better security to the data.

Disadvantage is that it can be executed only in the Database and utilizes more memory in the database server.

38. What is Online Transaction Processing (OLTP)?

Online Transaction Processing (OLTP) manages transaction based applications which can be used for data entry, data retrieval and data processing. OLTP makes data management simple and efficient. Unlike OLAP systems goal of OLTP systems is serving real-time transactions.

Example – Bank Transactions on a daily basis.

39. What is CLAUSE?

SQL clause is defined to limit the result set by providing condition to the query. This usually filters some rows from the whole set of records.

Example – Query that has WHERE condition

Query that has HAVING condition.

40. What is recursive stored procedure?

A stored procedure which calls by itself until it reaches some boundary condition. This recursive function or procedure helps programmers to use the same set of code any number of times.

41. What is Union, minus and Interact commands?

UNION operator is used to combine the results of two tables, and it eliminates duplicate rows from the tables.

MINUS operator is used to return rows from the first query but not from the second query. Matching records of first and second query and other rows from the first query will be displayed as a result set.

INTERSECT operator is used to return rows returned by both the queries.

42. What is an ALIAS command?

ALIAS name can be given to a table or column. This alias name can be referred in WHERE clause to identify the table or column.

Example-.

Select st.StudentID, Ex.Result from student st, Exam as Ex where st.studentID = Ex. StudentID
1
Select st.StudentID, Ex.Result from student st, Exam as Ex where st.studentID = Ex. StudentID

Here, st refers to alias name for student table and Ex refers to alias name for exam table.

43. What is the difference between TRUNCATE and DROP statements?

TRUNCATE removes all the rows from the table, and it cannot be rolled back. DROP command removes a table from the database and operation cannot be rolled back.

44. What are aggregate and scalar functions?

Aggregate functions are used to evaluate mathematical calculation and return single values. This can be calculated from the columns in a table. Scalar functions return a single value based on the input value.

Example -.

Aggregate – max(), count – Calculated with respect to numeric.

Scalar – UCASE(), NOW() – Calculated with respect to strings.

45. How can you create an empty table from an existing table?

Example will be -.

Select * into studentcopy from student where 1=2
1
Select * into studentcopy from student where 1=2

Here, we are copying student table to another table with the same structure with no rows copied.

46. How to fetch common records from two tables?

Common records result set can be achieved by -.

Select studentID from student. <strong>INTERSECT </strong> Select StudentID from Exam
1
Select studentID from student. <strong>INTERSECT </strong> Select StudentID from Exam

47. How to fetch alternate records from a table?

Records can be fetched for both Odd and Even row numbers -.

To display even numbers-.

Select studentId from (Select rowno, studentId from student) where mod(rowno,2)=0
1
Select studentId from (Select rowno, studentId from student) where mod(rowno,2)=0

To display odd numbers-.

Select studentId from (Select rowno, studentId from student) where mod(rowno,2)=1
1
Select studentId from (Select rowno, studentId from student) where mod(rowno,2)=1

from (Select rowno, studentId from student) where mod(rowno,2)=1.[/sql]

48. How to select unique records from a table?

Select unique records from a table by using DISTINCT keyword.

Select DISTINCT StudentID, StudentName from Student.
1
Select DISTINCT StudentID, StudentName from Student.

49. What is the command used to fetch first 5 characters of the string?

There are many ways to fetch first 5 characters of the string -.

Select SUBSTRING(StudentName,1,5) as studentname from student
1
Select SUBSTRING(StudentName,1,5) as studentname from student

Select RIGHT(Studentname,5) as studentname from student
1
Select RIGHT(Studentname,5) as studentname from student

50. Which operator is used in query for pattern matching?

LIKE operator is used for pattern matching, and it can be used as -.

% – Matches zero or more characters.
_(Underscore) – Matching exactly one character.
Example -.

Select * from Student where studentname like ‘a%’
1
Select * from Student where studentname like ‘a%’

Select * from Student where studentname like ‘ami_’
1
Select * from Student where studentname like ‘ami_’

Interview Questions

1. random generate a password with numbers and alphabets.
2. sort algorithms
3. SQL

KibbCom India Pvt. Ltd ( CALL BASED 2017 BATCH )

DRIVE DATE 1st april 2018

Address: Kibbcom India Private Limited, Silver Software Tech park, Basement Floor, Rd No. 7, KIADB Export Promotion Industrial Area, Whitefield, Bengaluru, Karnataka 560066

*****************************
WRITTEN TEST
*************************
Time and Distance
Time and Work
Compound Interest
Partnership
Problems on Ages
Clock
Area
Permutation and Combination
Problems on Numbers
Decimal Fraction
Square Root and Cube Root
Ratio and Proportion
Pipes and Cistern
Alligation or Mixture
****************************************************
READ JAVA , DBMS INTERVIEW QUESTION
*******************************************************
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).
4. 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.
5. What is the base class of all classes?
java.lang.Object
6. What are the access modifiers in Java?
There are 3 access modifiers. Public, protected and private, and the default one if no identifier is specified is called friendly, but programmer cannot specify the friendly identifier explicitly.
7. What is are packages?
A package is a collection of related classes and interfaces providing access protection and namespace management.
8. What is meant by Inheritance and what are its advantages?
Inheritance is the process of inheriting all the features from a class. The advantages of inheritance are reusability of code and accessibility of variables and methods of the super class by subclasses.
9. What is the difference between superclass and subclass?
A super class is a class that is inherited whereas sub class is a class that does the inheriting.
10. What is an abstract class?
An abstract class is a class designed with implementation gaps for subclasses to fill in and is deliberately incomplete.
11. What are the states associated in the thread?
Thread contains ready, running, waiting and dead states.
12. What is synchronization?
Synchronization is the mechanism that ensures that only one thread is accessed the resources at a time.
13. What is deadlock?
When two threads are waiting each other and can’t precede the program is said to be deadlock.
14. What is an applet?
Applet is a dynamic and interactive program that runs inside a web page displayed by a java capable browser
15. What is the lifecycle of an applet?
init() method – Can be called when an applet is first loaded
start() method – Can be called each time an applet is started.
paint() method – Can be called when the applet is minimized or maximized.
stop() method – Can be used when the browser moves off the applet’s page.
destroy() method – Can be called when the browser is finished with the applet.
16. How do you set security in applets?
using setSecurityManager() method
17. What is a layout manager and what are different types of layout managers available in java AWT?
A layout manager is an object that is used to organize components in a container. The different layouts are available are FlowLayout, BorderLayout, CardLayout, GridLayout and GridBagLayout
18. What is JDBC?
JDBC is a set of Java API for executing SQL statements. This API consists of a set of classes and interfaces to enable programs to write pure Java Database applications.
19. What are drivers available?
-a) JDBC-ODBC Bridge driver b) Native API Partly-Java driver
c) JDBC-Net Pure Java driver d) Native-Protocol Pure Java driver
20. What is stored procedure?
Stored procedure is a group of SQL statements that forms a logical unit and performs a particular task. Stored Procedures are used to encapsulate a set of operations or queries to execute on database. Stored procedures can be compiled and executed with different parameters and results and may have any combination of input/output parameters.
21. What is the Java API?
The Java API is a large collection of ready-made software components that provide many useful capabilities, such as graphical user interface (GUI) widgets.
22. Why there are no global variables in Java?
Global variables are globally accessible. Java does not support globally accessible variables due to following reasons:
1)The global variables breaks the referential transparency
2)Global variables creates collisions in namespace.
23. What are Encapsulation, Inheritance and Polymorphism?
Encapsulation is the mechanism that binds together code and data it manipulates and keeps both safe from outside interference and misuse. Inheritance is the process by which one object acquires the properties of another object. Polymorphism is the feature that allows one interface to be used for general class actions.
24. What is the use of bin and lib in JDK?
Bin contains all tools such as javac, appletviewer, awt tool, etc., whereas lib contains API and all packages.
25. What is method overloading and method overriding?
Method overloading: When a method in a class having the same method name with different arguments is said to be method overloading. Method overriding : When a method in a class having the same method name with same arguments is said to be method overriding.
26. What is the difference between this() and super()?
this() can be used to invoke a constructor of the same class whereas super() can be used to invoke a super class constructor.
27. What is Domain Naming Service(DNS)?
It is very difficult to remember a set of numbers(IP address) to connect to the Internet. The Domain Naming Service(DNS) is used to overcome this problem. It maps one particular IP address to a string of characters. For example, www. mascom. com implies com is the domain name reserved for US commercial sites, moscom is the name of the company and www is the name of the specific computer, which is mascom’s server.
28. What is URL?
URL stands for Uniform Resource Locator and it points to resource files on the Internet. URL has four components: http://www. address. com:80/index.html, where http – protocol name, address – IP address or host name, 80 – port number and index.html – file path.
29. What is RMI and steps involved in developing an RMI object?
Remote Method Invocation (RMI) allows java object that executes on one machine and to invoke the method of a Java object to execute on another machine. The steps involved in developing an RMI object are: a) Define the interfaces b) Implementing these interfaces c) Compile the interfaces and their implementations with the java compiler d) Compile the server implementation with RMI compiler e) Run the RMI registry f) Run the application.
30. What is RMI architecture?
RMI architecture consists of four layers and each layer performs specific functions: a) Application layer – contains the actual object definition. b) Proxy layer – consists of stub and skeleton. c) Remote Reference layer – gets the stream of bytes from the transport layer and sends it to the proxy layer. d) Transportation layer – responsible for handling the actual machine-to-machine communication.
31. What is a Java Bean?
A Java Bean is a software component that has been designed to be reusable in a variety of different environments.
32. What are checked exceptions?
Checked exception are those which the Java compiler forces you to catch. e.g. IOException are checked Exceptions.
33. What are runtime exceptions?
Runtime exceptions are those exceptions that are thrown at runtime because of either wrong input data or because of wrong business logic etc. These are not checked by the compiler at compile time.
34. What is the difference between error and an exception?
An error is an irrecoverable condition occurring at runtime. Such as OutOfMemory error. These JVM errors and you can not repair them at runtime. While exceptions are conditions that occur because of bad input etc. e.g. FileNotFoundException will be thrown if the specified file does not exist. Or a NullPointerException will take place if you try using a null reference. In most of the cases it is possible to recover from an exception (probably by giving user a feedback for entering proper values etc.).
35. 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. For example, closing a opened file, closing a opened database Connection.
36. What is the difference between yielding and sleeping?
When a task invokes its yield() method, it returns to the ready state. When a task invokes its sleep() method, it returns to the waiting state.
37. What is the difference between preemptive scheduling and time slicing?
Under preemptive scheduling, the highest priority task executes until it enters the waiting or dead states or a higher priority task comes into existence. Under time slicing, a task executes for a predefined slice of time and then reenters the pool of ready tasks. The scheduler then determines which task should execute next, based on priority and other factors.
38. What is mutable object and immutable object?
If a object value is changeable then we can call it as Mutable object. (Ex., StringBuffer, …) If you are not allowed to change the value of an object, it is immutable object. (Ex., String, Integer, Float, …)
39. What is the purpose of Void class?
The Void class is an uninstantiable placeholder class to hold a reference to the Class object representing the primitive Java type void.
40. What is JIT and its use?
Really, just a very fast compiler… In this incarnation, pretty much a one-pass compiler — no offline computations. So you can’t look at the whole method, rank the expressions according to which ones are re-used the most, and then generate code. In theory terms, it’s an on-line problem.
41. What is nested class?
If all the methods of a inner class is static then it is a nested class.
42. What is HashMap and Map?
Map is Interface and Hashmap is class that implements that.
43. What are different types of access modifiers?
public: Any thing declared as public can be accessed from anywhere. private: Any thing declared as private can’t be seen outside of its class. protected: Any thing declared as protected can be accessed by classes in the same package and subclasses in the other packages. default modifier : Can be accessed only to classes in the same package.
44. What is the difference between Reader/Writer and InputStream/Output Stream?
The Reader/Writer class is character-oriented and the InputStream/OutputStream class is byte-oriented.
45. What is servlet?
Servlets are modules that extend request/response-oriented servers, such as java-enabled web servers. For example, a servlet might be responsible for taking data in an HTML order-entry form and applying the business logic used to update a company’s order database.
46. What is Constructor?
A constructor is a special method whose task is to initialize the object of its class.
It is special because its name is the same as the class name.
They do not have return types, not even void and therefore they cannot return values.
They cannot be inherited, though a derived class can call the base class constructor.
Constructor is invoked whenever an object of its associated class is created.
47. What is an Iterator ?
The Iterator interface is used to step through the elements of a Collection.
Iterators let you process each element of a Collection.
Iterators are a generic way to go through all the elements of a Collection no matter how it is organized.
Iterator is an Interface implemented a different way for every Collection.
48. What is the List interface?
The List interface provides support for ordered collections of objects.
Lists may contain duplicate elements.
49. What is memory leak?
A memory leak is where an unreferenced object that will never be used again still hangs around in memory and doesnt get garbage collected.
50. What is the difference between the prefix and postfix forms of the ++ operator?
The prefix form performs the increment operation and returns the value of the increment operation. The postfix form returns the current value all of the expression and then performs the increment operation on that value.
51. 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.
52. What will happen to the Exception object after exception handling?
Exception object will be garbage collected.
53. Difference between static and dynamic class loading.
Static class loading: The process of loading a class using new operator is called static class loading. Dynamic class loading: The process of loading a class at runtime is called dynamic class loading.
Dynamic class loading can be done by using Class.forName(….).newInstance().
54. Explain the Common use of EJB
The EJBs can be used to incorporate business logic in a web-centric application.
The EJBs can be used to integrate business processes in Business-to-business (B2B) e-commerce applications.In Enterprise Application Integration applications, EJBs can be used to house processing and mapping between different applications.
55. What is JSP?
JSP is a technology that returns dynamic content to the Web client using HTML, XML and JAVA elements. JSP page looks like a HTML page but is a servlet. It contains Presentation logic and business logic of a web application.
56. What is the purpose of apache tomcat?
Apache server is a standalone server that is used to test servlets and create JSP pages. It is free and open source that is integrated in the Apache web server. It is fast, reliable server to configure the applications but it is hard to install. It is a servlet container that includes tools to configure and manage the server to run the applications. It can also be configured by editing XML configuration files.
57. Where pragma is used?
Pragma is used inside the servlets in the header with a certain value. The value is of no-cache that tells that a servlets is acting as a proxy and it has to forward request. Pragma directives allow the compiler to use machine and operating system features while keeping the overall functionality with the Java language. These are different for different compilers.
58. Briefly explain daemon thread.
Daemon thread is a low priority thread which runs in the background performs garbage collection operation for the java runtime system.
59. What is a native method?
A native method is a method that is implemented in a language other than Java.
60. Explain different way of using thread?
A Java thread could be implemented by using Runnable interface or by extending the Thread class. The Runnable is more advantageous, when you are going for multiple inheritance.
61. What are the two major components of JDBC?
One implementation interface for database manufacturers, the other implementation interface for application and applet writers.
62. What kind of thread is the Garbage collector thread?
It is a daemon thread.
63. What are the different ways to handle exceptions?
There are two ways to handle exceptions,
1. By wrapping the desired code in a try block followed by a catch block to catch the exceptions. and
2. List the desired exceptions in the throws clause of the method and let the caller of the method handle those exceptions.
64. How many objects are created in the following piece of code?
MyClass c1, c2, c3;
c1 = new MyClass ();
c3 = new MyClass ();
Answer: Only 2 objects are created, c1 and c3. The reference c2 is only declared and not initialized.
65.What is UNICODE?
Unicode is used for internal representation of characters and strings and it uses 16 bits to represent each other.
***************************************
DBMS QUESTION INTERVIEW
*************************************
What is DBMS?
DBMS stands for Database Management System. It is a collection of programs that enables user to create and maintain a database.
3. What is a Database system?
The database and DBMS software together is called as Database system.
4. What are the advantages of DBMS?
I. Redundancy is controlled.
II. Providing multiple user interfaces.
III. Providing backup and recovery
IV. Unauthorized access is restricted.
V. Enforcing integrity constraints.
5. What is normalization?
It is a process of analysing the given relation schemas based on their Functional Dependencies (FDs) and primary key to achieve the properties
(1).Minimizing redundancy, (2). Minimizing insertion, deletion and update anomalies.
6. What is Data Model?
A collection of conceptual tools for describing data, data relationships data semantics and constraints.
7. What is E-R model?
This data model is based on real world that consists of basic objects called entities and of relationship among these objects. Entities are described in a database by a set of attributes.
8. What is Object Oriented model?
This model is based on collection of objects. An object contains values stored in instance variables with in the object. An object also contains bodies of code that operate on the object. These bodies of code are called methods. Objects that contain same types of values and the same methods are grouped together into classes.
9. What is an Entity?
An entity is a thing or object of importance about which data must be captured.
10. What is DDL (Data Definition Language)?
A data base schema is specifies by a set of definitions expressed by a special language called DDL.
11. What is DML (Data Manipulation Language)?
This language that enable user to access or manipulate data as organised by appropriate data model. Procedural DML or Low level: DML requires a user to specify what data are needed and how to get those data. Non-Procedural DML or High level: DML requires a user to specify what data are needed without specifying how to get those data
12. What is DML Compiler?
It translates DML statements in a query language into low-level instruction that the query evaluation engine can understand.
13. What is Query evaluation engine?
It executes low-level instruction generated by compiler.
14. What is Functional Dependency?
Functional Dependency is the starting point of normalization. Functional Dependency exists when a relation between two attributes allows you to uniquely determine the corresponding attribute�s value.
15. What is 1 NF (Normal Form)?
The first normal form or 1NF is the first and the simplest type of normalization that can be implemented in a database. The main aims of 1NF are to:
1. Eliminate duplicative columns from the same table.
2. Create separate tables for each group of related data and identify each row with a unique column (the primary key).
16. What is Fully Functional dependency?
A functional dependency X Y is full functional dependency if removal of any attribute A from X means that the dependency does not hold any more.
17. What is 2NF?
A relation schema R is in 2NF if it is in 1NF and every non-prime attribute A in R is fully functionally dependent on primary key.
18. What is 3NF?
A relation is in third normal form if it is in Second Normal Form and there are no functional (transitive) dependencies between two (or more) non-primary key attributes.
19. What is BCNF (Boyce-Codd Normal Form)?
A table is in Boyce-Codd normal form (BCNF) if and only if it is in 3NF and every determinant is a candidate key.
20. What is 4NF?
Fourth normal form requires that a table be BCNF and contain no multi-valued dependencies.
21. What is 5NF?
A table is in fifth normal form (5NF) or Project-Join Normal Form (PJNF) if it is in 4NF and it cannot have a lossless decomposition into any number of smaller tables.
22. What is a query?
A query with respect to DBMS relates to user commands that are used to interact with a data base.
23. What is meant by query optimization?
The phase that identifies an efficient execution plan for evaluating a query that has the least estimated cost is referred to as query optimization.
24. What is an attribute?
It is a particular property, which describes the entity.
25. What is RDBMS?
Relational Data Base Management Systems (RDBMS) are database management systems that maintain data records and indices in tables.
26. What�s difference between DBMS and RDBMS?
DBMS provides a systematic and organized way of storing, managing and retrieving from collection of logically related information. RDBMS also provides what DBMS provides but above that it provides relationship integrity.
27. What is SQL?
SQL stands for Structured Query Language. SQL is an ANSI (American National Standards Institute) standard computer language for accessing and manipulating database systems. SQL statements are used to retrieve and update data in a database.
28. What is Stored Procedure?
A stored procedure is a named group of SQL statements that have been previously created and stored in the server database.
29. What is a view?
A view may be a subset of the database or it may contain virtual data that is derived from the database files but is not explicitly stored.
30. What is Trigger?
A trigger is a SQL procedure that initiates an action when an event (INSERT, DELETE or UPDATE) occurs.
31. What is Index?
An index is a physical structure containing pointers to the data.
32. What is extension and intension?
Extension -It is the number of tuples present in a table at any instance. This is time dependent.
Intension -It is a constant value that gives the name, structure of table and the constraints laid on it.
33. What do you mean by atomicity and aggregation?
Atomicity-Atomicity states that database modifications must follow an �all or nothing� rule. Each transaction is said to be �atomic.� If one part of the transaction fails, the entire transaction fails.
Aggregation – A feature of the entity relationship model that allows a relationship set to participate in another relationship set. This is indicated on an ER diagram by drawing a dashed box around the aggregation.
34. What is RDBMS KERNEL?
Two important pieces of RDBMS architecture are the kernel, which is the software, and the data dictionary, which consists of the system- level data structures used by the kernel to manage the database.
35. Name the sub-systems of a RDBMS?
I/O, Security, Language Processing, Process Control, Storage Management, Logging and Recovery, Distribution Control, Transaction Control, Memory Management, Lock Management.
36. How do you communicate with an RDBMS?
You communicate with an RDBMS using Structured Query Language (SQL)
37. Disadvantage in File Processing System?
· Data redundancy & inconsistency.
· Difficult in accessing data.
· Data isolation.
· Data integrity.
· Concurrent access is not possible.
· Security Problems.
38. What is VDL (View Definition Language)?
It specifies user views and their mappings to the conceptual schema.
39. What is SDL (Storage Definition Language)?
This language is to specify the internal schema. This language may Specify the mapping between two schemas.
40. Describe concurrency control?
Concurrency control is the process managing simultaneous operations against a database so that database integrity is no compromised. There are two approaches to concurrency control.
The pessimistic approach involves locking and the optimistic approach involves versioning.
41. Describe the difference between homogeneous and heterogeneous distributed database?
A homogenous database is one that uses the same DBMS at each node. A heterogeneous database is one that may have a different DBMS at each node.
42. What is a distributed database?
A distributed database is a single logical database that is spread across more than one node or locations that are all connected via some communication link.
43. Explain the difference between two and three-tier architectures?
Three-tier architecture includes a client and two server layers.
The application code is stored on the application server and the database is stored on the database server. A two-tier architecture includes a client and one server layer. The database is stored on the database server.
44. Briefly describe the three types of SQL commands?
Data definition language commands are used to create, alter, and drop tables. Data manipulation commands are used to insert, modify, update, and query data in the database. Data control language commands help the DBA to control the database.
45. List some of the properties of a relation?
Relations in a database have a unique name and no multivalued attributes exist. Each row is unique and each attribute within a relation has a unique name. The sequence of both columns and rows is irrelevant.
46. Explain the differences between an intranet and an extranet?
An Internet database is accessible by everyone who has access to a Web site. An intranet database limits access to only people within a given organization.
47. What is SQL Deadlock?
Deadlock is a unique situation in a multi user system that causes two or more users to wait indefinitely for a locked resource.
48. What is a Catalog?
A catalog is a table that contains the information such as structure of each file, the type and storage format of each data item and various constraints on the data .The information stored in the catalog is called Metadata.
49. What is data ware housing & OLAP?
Data warehousing and OLAP (online analytical processing) systems are the techniques used in many companies to extract and analyze useful information from very large databases for decision making .
50. Describe the three levels of data abstraction?
Physical level: The lowest level of abstraction describes how data are stored.
Logical level: The next higher level of abstraction, describes what data are stored in database and what relationship among those data.
View level: The highest level of abstraction describes only part of entire database.

*************************************************************************

THIDFF TECHNOLOGIES ( CALL BASED 2016, 2017 BATCH )
********************************************************************
ONLY THOSE GOT CALL FROM COMPANY FOR INTERVIEW
***************************************************************************
DATE 3-4-2018
DEVELOPER
Address: 6th Floor, B – Block, Uma Sree Dream World, Kudlu Gate Junction, Hosur Road, Bengaluru, Karnataka 560068
************************************************************************************
https://www.glassdoor.co.in/Overview/Working-at-ThiDiff-Technologies-EI_IE910803.11,31.htm
*********************************************************************************************
*****************************************************************************************

Basic Java Interview Questions
Q1. Explain JVM, JRE and JDK?
JVM (Java Virtual Machine): It is an abstract machine. It is a specification that provides run-time environment in which java bytecode can be executed. It follows three notations:

Specification: It is a document that describes the implementation of the Java virtual machine. It is provided by Sun and other companies.
Implementation: It is a program that meets the requirements of JVM specification.
Runtime Instance: An instance of JVM is created whenever you write a java command on the command prompt and run the class.
JRE (Java Runtime Environment) : JRE refers to a runtime environment in which java bytecode can be executed. It implements the JVM (Java Virtual Machine) and provides all the class libraries and other support files that JVM uses at runtime. So JRE is a software package that contains what is required to run a Java program. Basically, it’s an implementation of the JVM which physically exists.

JDK(Java Development Kit) : It is the tool necessary to compile, document and package Java programs. The JDK completely includes JRE which contains tools for Java programmers. The Java Development Kit is provided free of charge. Along with JRE, it includes an interpreter/loader, a compiler (javac), an archiver (jar), a documentation generator (javadoc) and other tools needed in Java development. In short, it contains JRE + development tools.

Refer to this below image and understand how exactly these components reside:

Components – Java Interview Questions – Edureka

Q2. Explain public static void main(String args[]).
public : Public is an access modifier, which is used to specify who can access this method. Public means that this Method will be accessible by any Class.
static : It is a keyword in java which identifies it is class based i.e it can be accessed without creating the instance of a Class.

void : It is the return type of the method. Void defines the method which will not return any value.

main: It is the name of the method which is searched by JVM as a starting point for an application with a particular signature only. It is the method where the main execution occurs.

String args[] : It is the parameter passed to the main method.

Q3. Why Java is platform independent?
Platform independent practically means “write once run anywhere”. Java is called so because of its byte codes which can run on any system irrespective of its underlying operating system.

Q4. Why java is not 100% Object-oriented?
Java is not 100% Object-oriented because it makes use of eight primitive datatypes such as boolean, byte, char, int, float, double, long, short which are not objects.

Q5. What are wrapper classes?
Wrapper classes converts the java primitives into the reference types (objects). Every primitive data type has a class dedicated to it. These are known as wrapper classes because they “wrap” the primitive data type into an object of that class. Refer to the below image which displays different primitive type, wrapper class and constructor argument.

WrapperClass – Java Interview Questions – Edureka

Q6. What are constructors in Java?
In Java, constructor refers to a block of code which is used to initialize an object. It must have the same name as that of the class. Also, it has no return type and it is automatically called when an object is created.

There are two types of constructors:

Default constructor
Parameterized constructor
Q7. What is singleton class and how can we make a class singleton?
Singleton class is a class whose only one instance can be created at any given time, in one JVM. A class can be made singleton by making its constructor private.

Q8. What is the difference between Array list and vector?
Array List Vector
Array List is not synchronized. Vector is synchronized.
Array List is fast as it’s non-synchronized. Vector is slow as it is thread safe.
If an element is inserted into the Array List, it increases its Array size by 50%. Vector defaults to doubling size of its array.
Array List does not define the increment size. Vector defines the increment size.
Array List can only use Iterator for traversing an Array List. Except Hashtable, Vector is the only other class which uses both Enumeration and Iterator.
Q9. What is the difference between equals() and == ?
Equals() method is defined in Object class in Java and used for checking equality of two objects defined by business logic.
“==” or equality operator in Java is a binary operator provided by Java programming language and used to compare primitives and objects. public boolean equals(Object o) is the method provided by the Object class. The default implementation uses == operator to compare two objects. For example: method can be overridden like String class. equals() method is used to compare the values of two objects.

public class Equaltest {
public static void main(String[] args) {
String str1= new String(“ABCD”);
String str2= new String(“ABCD”);
if(Str1 == str2)
{
System.out.println(“String 1 == String 2 is true”);
}
else
{
System.out.println(“String 1 == String 2 is false”);
String Str3 = Str2;
if( Str2 == Str3)
{
System.out.println(“String 2 == String 3 is true”);
}
else
{
System.out.println(“String 2 == String 3 is false”);
}
if(Str1.equals(str2))
{
System.out.println(“String 1 equals string 2 is true”);
}
else
{
System.out.prinltn(“String 1 equals string 2 is false”);
}
}}
Q10. What are the differences between Heap and Stack Memory?
The major difference between Heap and Stack memory are:

Features Stack Heap
Memory Stack memory is used only by one thread of execution. Heap memory is used by all the parts of the application.
Access Stack memory can’t be accessed by other threads. Objects stored in the heap are globally accessible.
Memory Management Follows LIFO manner to free memory. Memory management is based on generation associated to each object.
Lifetime Exists until the end of execution of the thread. Heap memory lives from the start till the end of application execution.
Usage Stack memory only contains local primitive and reference variables to objects in heap space. Whenever an object is created, it’s always stored in the Heap space.

In case you are facing any challenges with these java interview questions, please comment your problems in the section below. Apart from this Java Interview Questions Blog, if you want to get trained from professionals on this technology, you can opt for a structured training from edureka! Click below to know more.

**********************************************************************************************************************

Commonly Asked Data Structure Interview Questions | Set 1
What is a Data Structure?
A data structure is a way of organizing the data so that the data can be used efficiently. Different kinds of data structures are suited to different kinds of applications, and some are highly specialized to specific tasks. For example, B-trees are particularly well-suited for implementation of databases, while compiler implementations usually use hash tables to look up identifiers. (Source: Wiki Page)

What are linear and non linear data Structures?

Linear: A data structure is said to be linear if its elements form a sequence or a linear list. Examples: Array. Linked List, Stacks and Queues
Non-Linear: A data structure is said to be non-linear if traversal of nodes is nonlinear in nature. Example: Graph and Trees.

What are the various operations that can be performed on different Data Structures?

Insertion − Add a new data item in the given collection of data items.
Deletion − Delete an existing data item from the given collection of data items.
Traversal − Access each data item exactly once so that it can be processed.
Searching − Find out the location of the data item if it exists in the given collection of data items.
Sorting − Arranging the data items in some order i.e. in ascending or descending order in case of numerical data and in dictionary order in case of alphanumeric data.

How is an Array different from Linked List?

The size of the arrays is fixed, Linked Lists are Dynamic in size.
Inserting and deleting a new element in an array of elements is expensive, Whereas both insertion and deletion can easily be done in Linked Lists.
Random access is not allowed in Linked Listed.
Extra memory space for a pointer is required with each element of the Linked list.
Arrays have better cache locality that can make a pretty big difference in performance.

What is Stack and where it can be used?

Stack is a linear data structure which the order LIFO(Last In First Out) or FILO(First In Last Out) for accessing elements. Basic operations of stack are : Push, Pop , Peek

Applications of Stack:

Infix to Postfix Conversion using Stack
Evaluation of Postfix Expression
Reverse a String using Stack
Implement two stacks in an array
Check for balanced parentheses in an expression

What is a Queue, how it is different from stack and how is it implemented?

Queue is a linear structure which follows the order is First In First Out (FIFO) to access elements. Mainly the following are basic operations on queue: Enqueue, Dequeue, Front, Rear
The difference between stacks and queues is in removing. In a stack we remove the item the most recently added; in a queue, we remove the item the least recently added. Both Queues and Stacks can be implemented using Arrays and Linked Lists.

What are Infix, prefix, Postfix notations?

Infix notation: X + Y – Operators are written in-between their operands. This is the usual way we write expressions. An expression such as
A * ( B + C ) / D
Postfix notation (also known as “Reverse Polish notation”): X Y + Operators are written after their operands. The infix expression given above is equivalent to
A B C + * D/
Prefix notation (also known as “Polish notation”): + X Y Operators are written before their operands. The expressions given above are equivalent to
/ * A + B C D
Converting between these notations: Click here

What is a Linked List and What are its types?

A linked list is a linear data structure (like arrays) where each element is a separate object. Each element (that is node) of a list is comprising of two items – the data and a reference to the next node.Types of Linked List :

Singly Linked List : In this type of linked list, every node stores address or reference of next node in list and the last node has next address or reference as NULL. For example 1->2->3->4->NULL
Doubly Linked List : Here, here are two references associated with each node, One of the reference points to the next node and one to the previous node. Eg. NULL<-1<->2<->3->NULL
Circular Linked List : Circular linked list is a linked list where all nodes are connected to form a circle. There is no NULL at the end. A circular linked list can be a singly circular linked list or doubly circular linked list. Eg. 1->2->3->1 [The next pointer of last node is pointing to the first]

Which data structures are used for BFS and DFS of a graph?

Queue is used for BFS
Stack is used for DFS. DFS can also be implemented using recursion (Note that recursion also uses function call stack).

Can doubly linked be implemented using a single pointer variable in every node?
Doubly linked list can be implemented using a single pointer. See XOR Linked List – A Memory Efficient Doubly Linked List

How to implement a stack using queue?

A stack can be implemented using two queues. Let stack to be implemented be ‘s’ and queues used to implement be ‘q1’ and ‘q2’. Stack ‘s’ can be implemented in two ways:

Method 1 (By making push operation costly)
Method 2 (By making pop operation costly) See Implement Stack using Queues

How to implement a queue using stack?

A queue can be implemented using two stacks. Let queue to be implemented be q and stacks used to implement q be stack1 and stack2. q can be implemented in two ways:

Method 1 (By making enQueue operation costly)
Method 2 (By making deQueue operation costly) See Implement Queue using Stacks

Which Data Structure Should be used for implementiong LRU cache?

We use two data structures to implement an LRU Cache.

Queue which is implemented using a doubly linked list. The maximum size of the queue will be equal to the total number of frames available (cache size).The most recently used pages will be near front end and least recently pages will be near rear end.
A Hash with page number as key and address of the corresponding queue node as value. See How to implement LRU caching scheme? What data structures should be used?

How to check if a given Binary Tree is BST or not?
If inorder traversal of a binary tree is sorted, then the binary tree is BST. The idea is to simply do inorder traversal and while traversing keep track of previous key value. If current key value is greater, then continue, else return false. See A program to check if a binary tree is BST or not for more details.

Linked List Questions

Linked List Insertion
Linked List Deletion
middle of a given linked list
Nth node from the end of a Linked List

Tree Traversal Questions

Inorder
Preorder and Postoder Traversals
Level order traversal
Height of Binary Tree

Convert a DLL to Binary Tree in-place
See In-place conversion of Sorted DLL to Balanced BST

Convert Binary Tree to DLL in-place
See Convert a given Binary Tree to Doubly Linked List | Set 1, Convert a given Binary Tree to Doubly Linked List | Set 2

Delete a given node in a singly linked list
Given only a pointer to a node to be deleted in a singly linked list, how do you delete it?

Reverse a Linked List
Write a function to reverse a linked list

Detect Loop in a Linked List
Write a C function to detect loop in a linked list.

Which data structure is used for dictionary and spell checker?
Data Structure for Dictionary and Spell Checker?

Can we Overload or Override static methods in java ?

Overriding : Overriding is related to run-time polymorphism. A subclass (or derived class) provides a specific implementation of a method in superclass (or base class) at runtime.
Overloading: Overloading is related to compile time (or static) polymorphism. This feature allows different methods to have same name, but different signatures, especially number of input parameters and type of input paramaters.
Can we overload static methods? The answer is ‘Yes’. We can have two ore more static methods with same name, but differences in input parameters
Can we Override static methods in java? We can declare static methods with same signature in subclass, but it is not considered overriding as there won’t be any run-time polymorphism. Hence the answer is ‘No’. Static methods cannot be overridden because method overriding only occurs in the context of dynamic (i.e. runtime) lookup of methods. Static methods (by their name) are looked up statically (i.e. at compile-time).
Read more

Why the main method is static in java?
The method is static because otherwise there would be ambiguity: which constructor should be called? Especially if your class looks like this:

public class JavaClass
{
protected JavaClass(int x)
{ }
public void main(String[] args)
{

}
}
Should the JVM call new JavaClass(int)? What should it pass for x? If not, should the JVM instantiate JavaClass without running any constructor method? because that will special-case your entire class – sometimes you have an instance that hasn’t been initialized, and you have to check for it in every method that could be called. There are just too many edge cases and ambiguities for it to make sense for the JVM to have to instantiate a class before the entry point is called. That’s why main is static.

What happens if you remove static modifier from the main method?
Program compiles successfully . But at runtime throws an error “NoSuchMethodError”.

What is the scope of variables in Java in following cases?

Member Variables (Class Level Scope) : The member variables must be declared inside class (outside any function). They can be directly accessed anywhere in class
Local Variables (Method Level Scope) : Variables declared inside a method have method level scope and can’t be accessed outside the method.
Loop Variables (Block Scope) : A variable declared inside pair of brackets “{” and “}” in a method has scope withing the brackets only.
Read more

What is “this” keyword in java?
Within an instance method or a constructor, this is a reference to the current object — the object whose method or constructor is being called. You can refer to any member of the current object from within an instance method or a constructor by using this.
Usage of this keyword

Used to refer current class instance variable.
To invoke current class constructor.
It can be passed as an argument in the method call.
It can be passed as argument in the constructor call.
Used to return the current class instance.
Used to invoke current class method (implicitly)

What is an abstract class? How abstract classes are similar or different in Java from C++?
Abstract classes are classes that contain one or more abstract methods. An abstract method is a method that is declared, but contains no implementation. Abstract classes may not be instantiated, and require subclasses to provide implementations for the abstract methods.

Like C++, in Java, an instance of an abstract class cannot be created, we can have references of abstract class type though.
Like C++, an abstract class can contain constructors in Java. And a constructor of abstract class is called when an instance of a inherited class is created
In Java, we can have an abstract class without any abstract method. This allows us to create classes that cannot be instantiated, but can only be inherited.
Abstract classes can also have final methods (methods that cannot be overridden). For example, the following program compiles and runs fine.
Read more

Which class is the superclass for every class ?
Object class

Can we overload main() method?
The main method in Java is no extra-terrestrial method. Apart from the fact that main() is just like any other method & can be overloaded in a similar manner, JVM always looks for the method signature to launch the program.

The normal main method acts as an entry point for the JVM to start the execution of program.
We can overload the main method in Java. But the program doesn’t execute the overloaded main method when we run your program, we need to call the overloaded main method from the actual main method only.
Read more

What is object cloning?
Object cloning means to create an exact copy of the original object. If a class needs to support cloning, it must implement java.lang.Cloneable interface and override clone() method from Object class. Syntax of the clone() method is :

protected Object clone() throws CloneNotSupportedException
If the object’s class doesn’t implement Cloneable interface then it throws an exception ‘CloneNotSupportedException’ .

Read more

How is inheritance in C++ different from Java?

In Java, all classes inherit from the Object class directly or indirectly. Therefore, there is always a single inheritance tree of classes in Java, and Object class is root of the tree.
In Java, members of the grandparent class are not directly accessible. See this G-Fact for more details.
The meaning of protected member access specifier is somewhat different in Java. In Java, protected members of a class “A” are accessible in other class “B” of same package, even if B doesn’t inherit from A (they both have to be in the same package).
Java uses extends keyword for inheritance. Unlike C++, Java doesn’t provide an inheritance specifier like public, protected or private. Therefore, we cannot change the protection level of members of base class in Java, if some data member is public or protected in base class then it remains public or protected in derived class. Like C++, private members of base class are not accessible in derived class.
Unlike C++, in Java, we don’t have to remember those rules of inheritance which are combination of base class access specifier and inheritance specifier.
In Java, methods are virtual by default. In C++, we explicitly use virtual keyword. See this G-Fact for more details.
Java uses a separate keyword interface for interfaces, and abstract keyword for abstract classes and abstract functions.
Unlike C++, Java doesn’t support multiple inheritance. A class cannot inherit from more than one class. A class can implement multiple interfaces though.
In C++, default constructor of parent class is automatically called, but if we want to call parametrized constructor of a parent class, we must use Initializer list. Like C++, default constructor of the parent class is automatically called in Java, but if we want to call parameterized constructor then we must use super to call the parent constructor.
See examples here

Why method overloading is not possible by changing the return type in java?
In C++ and Java, functions can not be overloaded if they differ only in the return type . The return type of functions is not a part of the mangled name which is generated by the compiler for uniquely identifying each function. The No of arguments, Type of arguments & Sequence of arguments are the parameters which are used to generate the unique mangled name for each function. It is on the basis of these unique mangled names that compiler can understand which function to call even if the names are same(overloading).

Can we override private methods in Java?
No, a private method cannot be overridden since it is not visible from any other class. Read more

What is blank final variable?
A final variable in Java can be assigned a value only once, we can assign a value either in declaration or later.

final int i = 10;
i = 30; // Error because i is final.
A blank final variable in Java is a final variable that is not initialized during declaration. Below is a simple example of blank final.

// A simple blank final example
final int i;
i = 30;
Read more

What is “super” keyword in java?
The super keyword in java is a reference variable that is used to refer parent class objects. The keyword “super” came into the picture with the concept of Inheritance. Whenever you create the instance of subclass, an instance of parent class is created implicitly i.e. referred by super reference variable.
Various scenarios of using java super Keyword:

super is used to refer immediate parent instance variable
super is used to call parent class method
super() is used to call immediate parent constructor
Read more

What is static variable in Java?
The static keyword in java is used for memory management mainly. We can apply java static keyword with variables, methods, blocks and nested class. The static keyword belongs to the class than instance of the class.

The static can be:

variable (also known as class variable)
method (also known as class method)
block
nested class

Differences between HashMap and HashTable in Java.
1. HashMap is non synchronized. It is not-thread safe and can’t be shared between many threads without proper synchronization code whereas Hashtable is synchronized. It is thread-safe and can be shared with many threads.
2. HashMap allows one null key and multiple null values whereas Hashtable doesn’t allow any null key or value.
3. HashMap is generally preferred over HashTable if thread synchronization is not needed
Read more

How are Java objects stored in memory?
In Java, all objects are dynamically allocated on Heap. This is different from C++ where objects can be allocated memory either on Stack or on Heap. In C++, when we allocate abject using new(), the object is allocated on Heap, otherwise on Stack if not global or static.
In Java, when we only declare a variable of a class type, only a reference is created (memory is not allocated for the object). To allocate memory to an object, we must use new(). So the object is always allocated memory on heap. Read more

What are C++ features missing in Java?
Try to answer this on your own before seeing the answer – here.

 

Cognizant Technology Solutions Pvt Ltd ( CALL BASED 2016, 2017 BATCH
ANAYLST PROFILE
DRIVE DATE 1ST APRIL 2018
Address: KIOT Campus, NH-47, Kakapalayam Road, Salem, Tamil Nadu 637504

**********************************************************************
DOWNLOAD LASTEST INTERVIEW QUESTION WITH SOLVED PAPER

cognizant-Technology-Solutions-Pvt-Ltd-ITIS (1)

*****************************************************************************

Collabera Technologies Private Limited open walkin 2016, 2017

time 9:30 am to 10 am

analyst profile

contact preson akash

Address: Triton, 3rd floor, 13th cross Road, Anepalya, Anepalya circle, Bengaluru, Karnataka 560030

*****************************************************************************************************

INTERVIEW  QUESTION

****************************************************

) What is a flowchart and why it is important?

A Flowchart shows the complete flow of system through symbols and diagrams. It is important because it makes the system easy to understand for developers and as well nontechnical stakeholders.

2) Define Use Case Model?

Use case model shows a sequence of events and stream of actions regarding any process performed by an actor.

3) What does UML stand for?

It stands for Unified Modeling Language.

4) Do you think Activity Diagram is important and how?

As the name implies, an activity diagram is all about system activities. The main purpose of activity diagram is to show various events taking place in an organization in different departments.

5) Can you name the two types of diagrams heavily used in your field?

The two diagrams are Use Case Diagram and Collaboration Diagram

6) Do you know what is meant by an alternate flow in a use case?

It is the alternative solution or activity in a use case that should be followed in case of any failure in the system.

7) What are exceptions?

These are the unexpected situations or results in an application.

8) What are extends?

Extends are actions that must take place in a use case.

9) Name the two documents related to a use case?

The two documents are FRD (Functional Requirement Document) and SDD (System Design Document).

10) What is the difference between Business Analyst and Business Analysis?

Business Analysis is the process performed by the Business Analyst.

11) As a business analyst, what tools, you think are more helpful?

There are many, but I mostly use, Rational Tools, MS Visio, MS Word, MS Excel, PowerPoint, MS Project.

12) In your previous experience, what kind of documents you have created?

I have worked on, Functional Specification Documents, Technical Specification Documents, Business Requirements Documents, Use Case Diagram, etc.

13) What does INVEST stand for?

INVEST means Independent, Negotiable, Valuable, Estimable, Sized Appropriately, Testable. It can assist project managers and technical team to deliver quality products/services.

14) Define SaaS?

SaaS means Software as a Service. It is related to cloud computing. It is different from other software bundles as you don’t need this type of software to be installed on your machine. All you need is an Internet connection and a Web Browser to use it.

15) What steps are required to develop a product from an idea?

You have to perform, Market Analysis, Competitor Analysis, SWOT Analysis, Personas, Strategic Vision and Feature Set, Prioritize Features, Use Cases, SDLC, Storyboards, Test Cases, Monitoring, Scalability.

16) What do you think is better, the Waterfall Model or Spiral Model?

It all depends on the type and scope of the project. Also, a life cycle model is selected on the basis of organizational culture and various other scenarios to develop the system.

17) How can you explain a user-centered design methodology?

It all depends on the end users. In such scenario, we develop the system with a user’s point of view. Who are the end users, what they require etc. Personas are helpful in this process.

18) How do you define Personas?

Personas are used instead of real users that assist developers and technical team in judging the user behavior in different scenarios. Personas are social roles, performed by any actor or character. It is derived from a Latin word meaning “character”. In marketing terminology, it represents a group of customers/end users.

19) Define Application Usability?

Application usability is the quality of the system that makes the system useful for its end users. System’s usability is good if it is capable of achieving users’ goals.

20) What is a database transaction?

When we perform any activity in a database, such as addition, deletion, modification, searching, etc. is said to be a database transaction.

21) Define OLTP Systems?

OLTP stands for On-Line Transaction Processing. Such systems are capable of performing database transactions and are meant to provide good speed for database transactions. These systems are mainly used for data entry and retrieving data from the database.

22) Do you have any idea about Pugh Matrix?

Pugh Matrix is used to decide about the most optimal and alternate solutions. This technique is now a standard part of Six Sigma technique. It is also known as a problem or design matrix.

23) What does FMEA stand for?

It means Failure Mode and Effects Analysis. It is a failure analysis, that is used mainly in product development, system engineering, and operations management. This analysis is performed to figure out various failure modes and their severity in any system.

24) What is a 100-point method?

This method is used to assign priority to different steps in a process. Each group member is supposed to assign points to different steps. In the end, all the points for each step are calculated. The step having the highest points has the highest priority.

25) What is 8-omega?

It is a business framework that is mainly being adopted by firms and organizations for the betterment of their business. Its key factors are Strategy, People, Process, Technology.

26) Can you define mis-use case?

It is a term derived from use-case. Unlike use case, a mis-use case is something that shows -what kind of malicious activities can be performed by an actor that may result in system failure.

1) As a Business Analyst what is your role in an organization?

A) A Business Analyst plays a vital role in a project for an organization.

i) The main role of a Business Analyst is to find out the needs of an organization, finding out their problems, even predicting the future issues to an extent and suggesting the suitable solutions for the same and drive through the organization’s achievements.

ii) Business Analyst role varies from organization to organization, project to project and even from domain to domain.

iii) BA in a project can play the role of a Business Planner, System Analyst, Data Analyst, Organization Analyst, Application Designer, Subject Area Expert, Technical Architect etc.

iv) Core skills of a BA are a good grip on system engineering concepts, leadership qualities, technical knowledge, writing and verbal communications.

v) BA’s job may vary as per the employer’s requirement like some are limited to IT projects, even few of them extend their responsibilities to areas such as finance, marketing, accounting etc.

#2) How will you be able to handle the changes to requirements?

A) This is a logical question asked in an interview. As a BA, first I’ll get signed a document by the user which states that after a point of time no changes to the requirements are accepted.

In few cases, if the changes to the requirements are accepted then as a BA,

i) Firstly I’ll note down the changes made to the requirements and will prioritize them.

ii) Will also go through those changes and find out the impact of them on the project.

iii) Will calculate the cost, timeline, and resources required to cover the impact of change requirements in the project.

iv) And will make sure that whether those changes affect or create gaps to functional design documents, testing or coding.

#3) Can you name the tools that are helpful for business analysis?

A) The process performed by a BA is termed as Business Analysis. The tools used by a BA are Rational tools, Microsoft Excel, Microsoft Word, Power Point, MS Project, ERP systems.

#4) What is meant by Benchmarking?

A) The process of measuring the quality of policies, programs, products, rules and other measures of an organization against the standard measures or against the other companies is termed as Benchmarking. This is used to the measure the performance of a company to compete in the industry.

The main purpose of benchmarking is to find out the areas of improvement in a company and to analyze how the neighbor companies are achieving their goals.

#5) How can you say that a requirement is good or perfect?

A) The features and standards of a good requirement can be pointed out using a rule called SMART rule.

Specific – The description of a requirement should be perfect and specific enough to understand it.

Measurable – There are various parameters through which the requirement’s success can be measured.

Attainable – Resources should be able to achieve success with the requirement.

Relevant – States that what results are realistically achieved.

Timely – Requirements of a project should be revealed in time.

#6) What makes you unique from others?

A) The answer to this question will test your experience, skills, and individuality. “I am technically sound and can make a strong relationship with the customer. With this unique combination, I can use my knowledge and information to build a user-friendly environment”.

#7) What are the tasks that are not part of a BA’s job?

A) i) A Business Analyst is not intended to organize the project team meetings.

ii) A Business Analyst should not bother regarding the risks and issues tracker of a project.

iii) A Business Analyst should not perform activities like testing (executing the TC’s), coding or programming.

#8) Differentiate a Risk and an issue?

A) ‘Risk’ is nothing but a problem or something that can be predicted earlier so that some improvement plans are used to handle them. Whereas an ‘Issue’ means the risk that had happened or occurred.

The role of a BA is not to solve the issue instead should suggest some plans to control the loss/damage caused. And this should be marked as a precautionary measure for other projects.

Example: On some roads, there are few caution boards stating that “Road under repair, take diversion”. This is called as Risk.

If we travel through the same route which is under repair, then there caused some damage to the vehicle. This is called as an issue.

#9) List out the documents that are used by a BA in a Project?

A) As a Business Analyst we deal with various documents like Functional Specification document, Technical Specification document, Business requirement document, Use case diagram, Requirement Traceability Matrix etc.

#10) What is a misuse case?

A) An activity performed by a user which in turn causes system failure. It may be a malicious activity. As it is misguiding the system function flow, it is termed as misuse case.

#11) How can you handle and manage the difficult stakeholders?

A) Dealing with difficult stakeholders is a major task for a BA. There are many ways to handle such situations, few important points to be noted among them are listed below.

i) Identify that difficult stakeholder among the group of stakeholders, listen and concentrate on their point of view with patience. Be polite to them and do not close off the conversation immediately with such people.

ii) Generally, a stakeholder will be difficult because they are not comfortable with few things in the project. So listen to them and answer such difficult stakeholders in a diplomatic way.

iii) Find out a way to meet them personally and have a one on one discussion. By this, you can show your commitment towards them.

iv) Try to find out and resolve their motivations like are they worried about the budget of the project or Curious about the project whether it is turning exactly as per their vision etc.

v) Continuously engage such difficult stakeholders and make them understand that their contribution is much value for the project.

#12) When can a BA say that the requirements are done?

A) Requirements are considered as complete when they satisfy the below criteria

i) Requirements should be aligned with the objectives of a business. It means that the views of business stakeholders should align with the needs to be built for the project.

ii) All the possible views and ideas of key stakeholders are to be extracted.

iii) A quality of the requirements should meet/satisfy the organization’s set of criteria’s through which the quality of the requirements is tested.

iv) One can say that the requirements are complete when they could be done with in the possible available resources.

v) All the stakeholders of the project should be in consent with the gathered requirements.

#13) What all various diagrams that a BA should have knowledge about?

A) There are various types of diagrams that BA’s use in their work. Few important diagrams among them are,

Activity Diagram – This represents the flow from one activity to the other activity. Activity refers to the operation of the system. Below shown is an example of activity diagram.

activity-diagram

Data Flow Diagram – Graphical representation of the flow of data into and out of the system. This diagram represents how data is shared between organizations. How a DFD looks like is shown below

data-flow-diagram

Use case Diagram – This diagram describes the set of actions that systems perform with one or more actors (users) of the systems. Use case diagram is also called as a Behavioral diagram. Sample use case diagram is shown below

use-case-daigram

Class Diagram – This is the structural diagram that represents the structure of the system by showing its classes, objects, methods or operations, attributes etc. A class diagram is the main building block for detailed modeling which is used for programming. Below shown is an example of a class diagram.

class-diagram

Entity Relationship Diagram – ER Diagram is the graphical representation of entities and the relationships between them. This is a data modeling technique. The example of an ER diagram is as below

entity-relationship-diagram

Sequence Diagram – Sequence diagram describes the interaction between the objects like how they operate and in what time sequence the messages flow from one object to the other. Example for sequence diagram

sequence-diagram

Collaboration Diagram – Collaboration diagram represents the communication that occurs between the objects by showing the messages flow among them.

collaboration-diagram

#14) Brief the difference between Fish model and V model?

A) Fish model consumes more time in dealing with requirements when compared to V model. Even Fish model is a bit expensive than V model. Generally, a Fish model is preferred when there are no uncertainties in the requirements.

#15) Which model is better than Waterfall model and Spiral Model?

A) Selecting the life cycle model for a project is based on its type, scope, and limitations. It is solely dependent on the culture of the organization, their terms, and conditions, policies, a process of developing the system etc.

#16) Differentiate an alternate flow and exception flow of a use case diagram?

A) Basic flow represents the activities carrying out in order as required by the business. Alternate flow represents actions that are performed apart from the basic flow and also be considered as an optional flow. Whereas Exception flow is executed in a case or any errors.

Example: When we open a login page of any website, there is a link “forgot password” to retrieve the password. This is called as alternate flow.

In the same login page if we enter the correct username and password, sometimes we get an error message stating “404 error”. This is called the exception flow.

#17) What does INVEST means?

A) INVEST means Independent, Negotiable, Valuable, Estimable, Sized Appropriately, Testable. With this INVEST process, the project managers and technical teams are able to deliver the good quality of the product and can provide quality service.

#18) What all steps are included in developing a product from a basic idea?

A) In the process of developing a product from an idea, there are many steps to be followed as below,

Market Analysis – This is a business plan through which the characteristics of a market have been studied, like how the market changes and behaves dynamically.

SWOT Analysis – This is a process through which the Strengths, Weaknesses, Opportunities, and Threats of an organization are identified.

Personas – These are typical users of websites or intranet who represents the goals and characteristics of various large groups of users. Personas replicate the real users in functional design.

Competitor Analysis – Evaluation of the strengths and weaknesses of outside competitors.

Strategic Vision and Feature set – The process of developing the goals in present and planning to achieve the same in future by moving towards the vision.

Prioritize Features – All the features of the product that is to be developed are prioritized by the product management to help the development team.

Apart from the above-mentioned steps, there are furthermore terms involved in the process of developing a product. They are Use case, SDLC, Storyboards, Test Cases, Monitoring, and Scalability.

#19) Define Pareto Analysis?

A) Pareto Analysis is a proper technique used in decision-making for quality control activities and also used in tracing out the resolutions for defects. Basically, it is categorized as a decision-making technique based on its statistics that, with a limited number of selected inputs we can have a great impact on the outcome.

It is also termed as 80/20 rule because as per this analysis 80% of the benefits of a project are achieved from 20% of the work.

#20) Can you brief Kano Analysis?

A) Kano analysis is a powerful technique used in classifying the various types of customer requirements of new products. Basically, this Kano Analysis deals with the needs of the end user’s of the product.

The main attributes of this Kano Analysis are

i) Threshold Attributes – These are the properties that a customer wants to be available in the product.

ii) Performance Attributes – These represent some extra properties that are not necessary for a product but can be added for customers enjoyment.

iii) Excitement Attributes – These are the properties that the customers are not aware of but are excited when they found such properties in their product.

Conclusion
Every organization hiring a BA wants to make sure that the hired professional should start contributing his valuable thoughts and ideas from the day one. The output of a BA’s work is utilized by IT people for developing the product and by the non-IT people to see the model of their application product.

In few interviews, you can get a chance to ask questions to the interviewer. Here are few among them

i) What are the different roles in your organization those who interact with Business Analyst?

ii) What kind of challenges should I handle in your organization?

iii) What makes a BA successful in your company?

iv) What is the process followed in your organization, huge process or an informal process?

bytemark company ( call based through employee reference 2016, 2017)
developer

drive date  30-3-2018

Address: 6/A, Amit Plaza, First Floor, 3rd Phase, Bannerghatta Main Rd, JP Nagar, Bengaluru, Karnataka 560076

********************************************************************************************
data structure interview
****************************************************************************
https://www.glassdoor.co.in/Interview/Bytemark-Interview-Questions-E1060886.htm
***************************************************************************

1.What is data structure?

A data structure is a way of organizing data that considers not only the items stored, but also their relationship to each other. Advance knowledge about the relationship between data items allows designing of efficient algorithms for the manipulation of data.

2.Minimum number of queues needed to implement the priority queue?

Two. One queue is used for actual storing of data and another for storing priorities.

3.What are the notations used in Evaluation of Arithmetic Expressions using prefix and postfix forms?

Polish and Reverse Polish notations.

4.List out few of the Application of tree data-structure?

i)The manipulation of Arithmetic expression
ii)Symbol Table construction
iii)Syntax analysis.

5.What is the type of the algorithm used in solving the 8 Queens problem?

Backtracking

6.In RDBMS, what is the efficient data structure used in the internal storage representation?
B+ tree. Because in B+ tree, all the data is stored only in leaf nodes, that makes searching easier. This corresponds to the records that shall be stored in leaf nodes.

7. What is a spanning Tree?

A spanning tree is a tree associated with a network. All the nodes of the graph appear on the tree once. A minimum spanning tree is a spanning tree organized so that the total edge weight between nodes is minimized.

8. List out the areas in which data structures are applied extensively?

Compiler Design, Operating System, Database Management System, Statistical
analysis package, Numerical Analysis, Graphics, Artificial Intelligence, Simulation

9. Translate infix expression into its equivalent post fix expression: (A-B)*(D/E)

(A-B)*(D/E) = [AB-]*[DE/] = AB-DE/*

10. What are priority queues?

A priority queue is a collection of elements such that each element has been assigned a priority.

11. What is a string?

A sequential array of characters is called a string.

12. What is Brute Force algorithm?

Algorithm used to search the contents by comparing each element of array is called Brute Force algorithm.

13. What are the limitations of arrays?

i)Arrays are of fixed size.
ii)Data elements are stored in continuous memory locations which may not be available always.
iii)Adding and removing of elements is problematic because of shifting the locations.

14. How can you overcome the limitations of arrays?

Limitations of arrays can be solved by using the linked list.

15. What is a linked list?

Linked list is a data structure which store same kind of data elements but not in continuous memory locations and size is not fixed. The linked lists are related logically.

16. What is a node?

The data element of a linked list is called a node.

17. What does node consist of?

Node consists of two fields:data field to store the element and link field to store the address of the next node.

18. What is a queue ?

A Queue is a sequential organization of data. A queue is a first in first out type of data structure. An element is inserted at the last position and an element is always taken out from the first position.

19. What are the types of Collision Resolution Techniques and the methods used in each of the type?

Open addressing (closed hashing),The methods used include:Overflow block
Closed addressing (open hashing),The methods used include:Linked list,Binary tree

20. What are the methods available in storing sequential files ?

Straight merging, Natural merging, Polyphase sort, Distribution of Initial runs.

21. Mention some of the problem solving strategies?

The most widely strategies are listed below
i)Divide and conquer
ii)Binary doubling strategy
iii)Dynamic programming

22. What is divide and conquer method?

The basic idea is to divide the problem into several sub problems beyond which cannot be further subdivided. Then solve the sub problems efficiently and join then together to get the solution for the main problem.

23. What is the need for the header?
Header of the linked list is the first element in the list and it stores the number of elements in the list. It points to the first data element of the list.

24. Define leaf?
In a directed tree any node which has out degree o is called a terminal node or a leaf.

25. What are the applications of binary tree?

Binary tree is used in data processing.

26. What are the different types of traversing?

The different types of traversing are
i)Pre-order traversal-yields prefix from of expression.
ii)In-order traversal-yields infix form of expression.
iii)Post-order traversal-yields postfix from of expression.

27. Define pre-order traversal?

i)Process the root node
ii)Process the left subtree
iii)Process the right subtree

28. Define post-order traversal?

i)Process the left subtree
ii)Process the right subtree
iii)Process the root node

29. Define in -order traversal?

i)Process the left subtree
ii)Process the root node
iii)Process the right subtree

30. What is meant by sorting?

Ordering the data in an increasing or decreasing fashion according to some relationship among the data item is called sorting.

31. What’s the major distinction in between Storage structure and file structure and how?

The expression of an specific data structure inside memory of a computer system is termed storage structure in contrast to a storage structure expression in auxiliary memory is normally known as a file structure.

32. Stack can be described as a pointer. Explain?

Because stack will contain a head pointer which will always point to the top of the Stack.All Stack Operations are done using Head Pointer. Hence Stack ca be Described as a Pointer

33. What do you mean by: Syntax Error, Logical Error, Run time Error?

Syntax Error-Syntax Error is due to lack of knowledge in a specific language. It is due to somebody does not know how to use the features of a language.We can know the errors at the time of compilation.
logical Error-It is due to the poor understanding of the requirement or problem.
Run time Error-The exceptions like divide a number by 0,overflow and underflow comes under this.

34. What is mean by d-queue?

D-queue stands for double ended queue. It is a abstract data structure that implements a queue for which elements can be added to front or rear and the elements can be removed from the rear or front. It is also called head-tail linked list

35. What is AVL tree?

Avl tree is self binary tree in which balancing factor lie between the -1 to 1.It is also known as self balancing tree.

36. what is binary tree?

Binary tree is a tree which has maximum no. of childrens either 0 or 1 or 2. i.e., there is at the most 2 branches in every node.

37. What is the difference between a stack and a Queue?

Stack – Represents the collection of elements in Last In First Out order. Operations includes testing null stack, finding the top element in the stack, removal of top most element and adding elements on the top of the stack.
Queue – Represents the collection of elements in First In First Out order.Operations include testing null queue, finding the next element, removal of elements and inserting the elements from the queue.
Insertion of elements is at the end of the queue.Deletion of elements is from the beginning of the queue

38. What actions are performed when a function is called?

i)arguments are passed
ii)local variables are allocated and initialized
iii)transferring control to the function

39. What is precision?

Precision refers the accuracy of the decimal portion of a value. Precision is the number of digits allowed after the decimal point.

40. What do you mean by overflow and underflow?

When new data is to be inserted into the data structure but there is no available space i.e.free storage list is empty this situation is called overflow.When we want to delete data from a data structure that is empty this situation is called underflow

1. Is it possible to find a loop in a Linked list ?
a. Possilbe at O(n)
b. Not possible
c. Possible at O(n^2) only
d. Depends on the position of loop

Solution: a. Possible at O(n)
Have two pointers say P1 and P2 pointing to the first node of the list.
Start a loop and Increment P1 once and P2 twice in each iteration. At any point of time if P1==P2 then there is a loop in that linked list. If P2 reaches NULL (end of linked list) then no loop exists.

2. Two linked lists L1 and L2 intersects at a particular node N1 and from there all other nodes till the end are common. The length of the lists are not same. What are the possibilities to find N1?.

a. Solution exist for certain cases only
b. No linear solution exist
c. Linear solution is possible
d Only Non-linear solution exist.
Solution: c. Linear solution is possible
Have two pointers say P1 pointing to the first node of L1 and P2 to that of L2. Traverse through both the lists. If P1 reaches L1’s last node, point it to the first node of L2 and continue traversing. Do the same thing for P2 when it reaches L2’s last node. (By doing this, we are balancing the difference in the length between the linked lists. The shorter one will get over soon and by redirecting to longer list’s head, it will traverse the extra nodes also.) Finally they will Meet at the Intersection node.

3. void PrintTree (Tree T)
{
if (T != NULL)
{
PrintTree (T-> Left);
PrintElement (T-> Element);
PrintTree (T->Right);
}
}
The above method ‘PrintTree’ results in which of the following traversal
a Inorder
b. Preorder
c. Postorder
d. None of the above
Solution: a. Inorder
Inorder:
void PrintTree (Tree T)
{
if (T != NULL)
{
PrintTree (T-> Left);
PrintElement (T-> Element);
PrintTree (T->Right);
}
}
For preorder use this order
PrintElement (T-> Element);
PrintTree (T-> Left);
PrintTree (T->Right);
For postorder use this order
PrintTree (T-> Left);
PrintTree (T->Right);
PrintElement (T-> Element);

4. Given a Binary Search Tree (BST), print its values in ascending order.

a. Perform Depth first traversal
b. Perform Breadth first traversal
c. Perform Postorder traversal
d. Perform Inorder traversal
Solution: d. Perform Inorder traversal
It is the properfy of BST and Inorder traversal.

5. Is it possible to implement a queue using Linked List ?. Enqueue & Dequeue should be O(1).

a. Not possible to implement.
b Only Enqueue is possible at O(1).
c. Only Dequeue is possible at O(1).
d. Both Enqueue and Dequeue is possible at O(1)
Solution: d. Both Enqueue and Dequeue is possible at O(1)
Have two pointers H pointing to the Head and T pointing to the Tail of the linked list. Perform enqueue at T and perform dequeue at H. Update the pointers after each operations accordingly.

6. Given a Tree, is it possible to find the greatest and least among leaves in linear time?.

a. Solution depends on the tree structure
b.Linear solution exist
c. Only Non-linear solution exist.
d. No linear solution exist
Solution: b. Linear solution exist
Have two variables Min and Max. Perform any tree traversal.Assign the first traversed leaf element to Min and Max for all other leaf elements check with these variables and update it accordingly. If a current element is < Min then update Min with that element. If it is > Min then check with Max.
Note: If you want to find the greatest and least among all nodes perform the checks for each node traversed.

7. Is it possible to find find the greatest and least value among the nodes in a given BST without using any extra variables?

a. No solution exist.
b. Solution need 2 extra variables
c. Solution exist without any extra variables
d Solution need 1 extra variable
Solution:c Solution exist without any extra variables
As per BST property, the left most node should be the least one and the rightmost node should be the greatest. In other words, the first and last node of an Inorder traversal are the least and greatest among the nodes respectively.

8. Is it possible to implement 2 stack in an array?

Condition: None of the stack should indicate an overflow until every slot of an array is used.
a. Only 1 stack can be implemented for the given condition
b. Stacks can not be implemented in array
c. 2 stacks can be implemented for the given condition.
d. 2 stacks can be implemented if the given condition is applied only for 1 stack.
Solution:c. 2 stacks can be implemented for the given condition
Start 1st stack from left (1st position of an array) and 2nd from right (last position say n). Move 1st stack towards right( i.e 1,2,3 …n) and 2nd towards left (i.e n,n-1,n-2…1).

9. Given two keys K1 & K2, write an algorithm to print all the elements between them with K1<=K2 in a BST.

a. Solution need 2 extra spaces
b. Linear solution is possible without using any extra space
c No linear solution exist
d Solution need 1 extra space
Solution:b. Linear solution is possible without using any extra space
Perform an inorder traversal. Once you find K1 print it and continue traversal now, print all other traversed elements until you reach K2.
Note: If K1 == K2 stop once you find K1.

10. How many stacks are required to implement a Queue.

a. One
b. Two
c. Three
d. Two + one extra space.
Solution:b Two
Have two stacks S1 and S2.
For Enqueue, perform push on S1.
For Dequeue, if S2 is empty pop all the elements from S1 and push it to S2. The last element you popped from S1 is an element to be dequeued. If S2 is not empty, then pop the top element in it.

DATA STRUCTURES:

1. Is it possible to find a loop in a Linked list ?

a. Possilbe at O(n)

b. Not possible

c. Possible at O(n^2) only

d. Depends on the position of loop

Solution: a. Possible at O(n)

Have two pointers say P1 and P2 pointing to the first node of the list.
Start a loop and Increment P1 once and P2 twice in each iteration. At any point of time if P1==P2 then there is a loop in that linked list. If P2 reaches NULL (end of linked list) then no loop exists.

2. Two linked lists L1 and L2 intersects at a particular node N1 and from there all other nodes till the end are common. The length of the lists are not same. What are the possibilities to find N1?.

a. Solution exist for certain cases only

b. No linear solution exist

c. Linear solution is possible

d Only Non-linear solution exist.

Solution: c. Linear solution is possible
Have two pointers say P1 pointing to the first node of L1 and P2 to that of L2. Traverse through both the lists. If P1 reaches L1’s last node, point it to the first node of L2 and continue traversing. Do the same thing for P2 when it reaches L2’s last node. (By doing this, we are balancing the difference in the length between the linked lists. The shorter one will get over soon and by redirecting to longer list’s head, it will traverse the extra nodes also.) Finally they will Meet at the Intersection node.

3. void PrintTree (Tree T)

{
if (T != NULL)
{
PrintTree (T-> Left);
PrintElement (T-> Element);
PrintTree (T->Right);
}
}

The above method ‘PrintTree’ results in which of the following traversal

a Inorder

b. Preorder

c. Postorder

d. None of the above

Solution: a. Inorder
Inorder:

void PrintTree (Tree T)

{
if (T != NULL)
{
PrintTree (T-> Left);
PrintElement (T-> Element);
PrintTree (T->Right);
}
}
For preorder use this order
PrintElement (T-> Element);
PrintTree (T-> Left);

PrintTree (T->Right);

For postorder use this order
PrintTree (T-> Left);

PrintTree (T->Right);

PrintElement (T-> Element);

4. Given a Binary Search Tree (BST), print its values in ascending order.

a. Perform Depth first traversal

b. Perform Breadth first traversal

c. Perform Postorder traversal

d. Perform Inorder traversal

Solution: d. Perform Inorder traversal
It is the properfy of BST and Inorder traversal.

5. Is it possible to implement a queue using Linked List ?. Enqueue & Dequeue should be O(1).

a. Not possible to implement.

b Only Enqueue is possible at O(1).

c. Only Dequeue is possible at O(1).

d. Both Enqueue and Dequeue is possible at O(1)

Solution: d. Both Enqueue and Dequeue is possible at O(1)
Have two pointers H pointing to the Head and T pointing to the Tail of the linked list. Perform enqueue at T and perform dequeue at H. Update the pointers after each operations accordingly.

6. Given a Tree, is it possible to find the greatest and least among leaves in linear time?.

a. Solution depends on the tree structure

b.Linear solution exist

c. Only Non-linear solution exist.

d. No linear solution exist

Solution: b. Linear solution exist
Have two variables Min and Max. Perform any tree traversal.Assign the first traversed leaf element to Min and Max for all other leaf elements check with these variables and update it accordingly. If a current element is < Min then update Min with that element. If it is > Min then check with Max.
Note: If you want to find the greatest and least among all nodes perform the checks for each node traversed.

7. Is it possible to find find the greatest and least value among the nodes in a given BST without using any extra variables?

a. No solution exist.

b. Solution need 2 extra variables

c. Solution exist without any extra variables

d Solution need 1 extra variable

Solution:c Solution exist without any extra variables
As per BST property, the left most node should be the least one and the rightmost node should be the greatest. In other words, the first and last node of an Inorder traversal are the least and greatest among the nodes respectively.

8. Is it possible to implement 2 stack in an array?
Condition: None of the stack should indicate an overflow until every slot of an array is used.

a. Only 1 stack can be implemented for the given condition

b. Stacks can not be implemented in array

c. 2 stacks can be implemented for the given condition.

d. 2 stacks can be implemented if the given condition is applied only for 1 stack.

Solution:c. 2 stacks can be implemented for the given condition
Start 1st stack from left (1st position of an array) and 2nd from right (last position say n). Move 1st stack towards right( i.e 1,2,3 …n) and 2nd towards left (i.e n,n-1,n-2…1).

9. Given two keys K1 & K2, write an algorithm to print all the elements between them with K1<=K2 in a BST.

a. Solution need 2 extra spaces

b. Linear solution is possible without using any extra space

c No linear solution exist

d Solution need 1 extra space

Solution:b. Linear solution is possible without using any extra space
Perform an inorder traversal. Once you find K1 print it and continue traversal now, print all other traversed elements until you reach K2.
Note: If K1 == K2 stop once you find K1.

10. How many stacks are required to implement a Queue.

a. One

b. Two

c. Three

d. Two + one extra space.

Solution:b Two
Have two stacks S1 and S2.

For Enqueue, perform push on S1.

For Dequeue, if S2 is empty pop all the elements from S1 and push it to S2. The last element you popped from S1 is an element to be dequeued. If S2 is not empty, then pop the top element in it

*******************************************************************************************
ORCALE COMPANY ( CALL BASED 2017 BATCH ONLY THOSE WHO GOT CALL LETTER )
SELENIUM PROFILE
Oracle India Pvt Ltd, Velocity Block, Prestige Tech Park II
Address: Sy.No.110/1,2&3, Velocity Block, Prestige Technology Park III, Amane Bellandur Khane Village, Varthur Hobli, Marathahalli Ring Road, Bengaluru, Karnataka 560103
****************************************************************************
*************************************
INTERVIEW QUESTION
******************************************

#1) What is Automation Testing?

Automation testing or Test Automation is a process of automating the manual process to test the application/system under test. Automation testing involves the use of a separate testing tool which lets you create test scripts which can be executed repeatedly and doesn’t require any manual intervention.

Q #2) What are the benefits of Automation Testing?

Benefits of Automation testing are:

Supports execution of repeated test cases
Aids in testing a large test matrix
Enables parallel execution
Encourages unattended execution
Improves accuracy thereby reducing human-generated errors
Saves time and money
Q #3) Why should Selenium be selected as a test tool?

Selenium

is a free and open source
have a large user base and helping communities
have cross Browser compatibility (Firefox, Chrome, Internet Explorer, Safari etc.)
have great platform compatibility (Windows, Mac OS, Linux etc.)
supports multiple programming languages (Java, C#, Ruby, Python, Pearl etc.)
has fresh and regular repository developments
supports distributed testing
Q #4) What is Selenium? What are the different Selenium components?

Selenium is one of the most popular automated testing suites. Selenium is designed in a way to support and encourage automation testing of functional aspects of web-based applications and a wide range of browsers and platforms. Due to its existence in the open source community, it has become one of the most accepted tools amongst the testing professionals.

Selenium is not just a single tool or a utility, rather a package of several testing tools and for the same reason, it is referred to as a Suite. Each of these tools is designed to cater different testing and test environment requirements.

The suite package constitutes of the following sets of tools:

Selenium Integrated Development Environment (IDE) – Selenium IDE is a record and playback tool. It is distributed as a Firefox Plugin.
Selenium Remote Control (RC) – Selenium RC is a server that allows a user to create test scripts in the desired programming language. It also allows executing test scripts within the large spectrum of browsers.
Selenium WebDriver – WebDriver is a different tool altogether that has various advantages over Selenium RC. WebDriver directly communicates with the web browser and uses its native compatibility to automate.
Selenium Grid – Selenium Grid is used to distribute your test execution on multiple platforms and environments concurrently.
Q #5) What are the testing types that can be supported by Selenium?

Selenium supports the following types of testing:

Functional Testing
Regression Testing
Q #6) What are the limitations of Selenium?

Following are the limitations of Selenium:

Selenium supports testing of only web-based applications
Mobile applications cannot be tested using Selenium
Captcha and Barcode readers cannot be tested using Selenium
Reports can only be generated using third-party tools like TestNG or JUnit.
As Selenium is a free tool, thus there is no ready vendor support through the user can find numerous helping communities.
The user is expected to possess prior programming language knowledge.
Q #7) What is the difference between Selenium IDE, Selenium RC, and WebDriver?

Feature Selenium IDE Selenium RC WebDriver
Browser Compatibility Selenium IDE comes as a Firefox plugin, thus it supports only Firefox Selenium RC supports a varied range of versions of Mozilla Firefox, Google Chrome, Internet Explorer and Opera WebDriver supports a varied range of versions of Mozilla Firefox, Google Chrome, Internet Explorer and Opera.
Also supports HtmlUnitDriver which is a GUI less or headless browser.
Record and Playback Selenium IDE supports record and playback feature Selenium RC doesn’t supports record and playback feature WebDriver doesn’t support record and playback feature
Server Requirement Selenium IDE doesn’t require any server to be started before executing the test scripts Selenium RC requires server to be started before executing the test scripts WebDriver doesn’t require any server to be started before executing the test scripts
Architecture Selenium IDE is a Javascript based framework Selenium RC is a JavaScript based Framework WebDriver uses the browser’s native compatibility to automation
Object Oriented Selenium IDE is not an object oriented tool Selenium RC is semi object oriented tool WebDriver is a purely object oriented tool
Dynamic Finders
(for locating web elements on a webpage)
Selenium IDE doesn’t support dynamic finders Selenium RC doesn’t support dynamic finders WebDriver supports dynamic finders
Handling Alerts, Navigations, Dropdowns Selenium IDE doesn’t explicitly provides aids to handle alerts, navigations, dropdowns Selenium RC doesn’t explicitly provides aids to handle alerts, navigations, dropdowns WebDriver offers a wide range of utilities and classes that helps in handling alerts, navigations, and dropdowns efficiently and effectively.
WAP (iPhone/Android) Testing Selenium IDE doesn’t support testing of iPhone/Andriod applications Selenium RC doesn’t support testing of iPhone/Andriod applications WebDriver is designed in a way to efficiently support testing of iPhone/Android applications. The tool comes with a large range of drivers for WAP based testing.
For example, AndroidDriver, iPhoneDriver
Listener Support Selenium IDE doesn’t support listeners Selenium RC doesn’t support listeners WebDriver supports the implementation of Listeners
Speed Selenium IDE is fast as it is plugged in with the web-browser that launches the test. Thus, the IDE and browser communicates directly Selenium RC is slower than WebDriver as it doesn’t communicates directly with the browser; rather it sends selenese commands over to Selenium Core which in turn communicates with the browser. WebDriver communicates directly with the web browsers. Thus making it much faster.
Q #8) When should I use Selenium IDE?

Selenium IDE is the simplest and easiest of all the tools within the Selenium Package. Its record and playback feature make it exceptionally easy to learn with minimal acquaintances to any programming language. Selenium IDE is an ideal tool for a naïve user.

Q #9) What is Selenese?

Selenese is the language which is used to write test scripts in Selenium IDE.

Q #10) What are the different types of locators in Selenium?

The locator can be termed as an address that identifies a web element uniquely within the webpage. Thus, to identify web elements accurately and precisely we have different types of locators in Selenium:

ID
ClassName
Name
TagName
LinkText
PartialLinkText
Xpath
CSS Selector
DOM
Q #11) What is the difference between assert and verify commands?

Assert: Assert command checks whether the given condition is true or false. Let’s say we assert whether the given element is present on the web page or not. If the condition is true then the program control will execute the next test step but if the condition is false, the execution would stop and no further test would be executed.

Verify: Verify command also checks whether the given condition is true or false. Irrespective of the condition being true or false, the program execution doesn’t halt i.e. any failure during verification would not stop the execution and all the test steps would be executed.

Q #12) What is an XPath?

XPath is used to locate a web element based on its XML path. XML stands for Extensible Markup Language and is used to store, organize and transport arbitrary data. It stores data in a key-value pair which is very much similar to HTML tags. Both being markup languages and since they fall under the same umbrella, XPath can be used to locate HTML elements.

The fundamental behind locating elements using XPath is the traversing between various elements across the entire page and thus enabling a user to find an element with the reference of another element.

Q #13) What is the difference between “/” and “//” in Xpath?

Single Slash “/” – Single slash is used to create Xpath with absolute path i.e. the xpath would be created to start selection from the document node/start node.

Double Slash “//” – Double slash is used to create Xpath with relative path i.e. the xpath would be created to start selection from anywhere within the document.

Q #14) What is Same origin policy and how it can be handled?

The problem of same origin policy disallows to access the DOM of a document from an origin that is different from the origin we are trying to access the document.

Origin is a sequential combination of scheme, host, and port of the URL. For example, for a URL http://www.softwaretestinghelp.com/resources/, the origin is a combination of http, softwaretestinghelp.com, 80 correspondingly.

Thus the Selenium Core (JavaScript Program) cannot access the elements from an origin that is different from where it was launched. For Example, if I have launched the JavaScript Program from “http://www.softwaretestinghelp.com”, then I would be able to access the pages within the same domain such as “http://www.softwaretestinghelp.com/resources” or “http://www.softwaretestinghelp.com/istqb-free-updates/”. The other domains like google.com, seleniumhq.org would no more be accessible.

So, In order to handle same origin policy, Selenium Remote Control was introduced.

Q #15) When should I use Selenium Grid?

Selenium Grid can be used to execute same or different test scripts on multiple platforms and browsers concurrently so as to achieve distributed test execution, testing under different environments and saving execution time remarkably.

Q #16) What do we mean by Selenium 1 and Selenium 2?

Selenium RC and WebDriver, in a combination, are popularly known as Selenium 2. Selenium RC alone is also referred as Selenium 1.

Q #17) Which is the latest Selenium tool?

WebDriver

Q #18) How do I launch the browser using WebDriver?

The following syntax can be used to launch Browser:
WebDriver driver = new FirefoxDriver();
WebDriver driver = new ChromeDriver();
WebDriver driver = new InternetExplorerDriver();

Q #19) What are the different types of Drivers available in WebDriver?

The different drivers available in WebDriver are:

FirefoxDriver
InternetExplorerDriver
ChromeDriver
SafariDriver
OperaDriver
AndroidDriver
IPhoneDriver
HtmlUnitDriver
Q #20) What are the different types of waits available in WebDriver?

There are two types of waits available in WebDriver:

Implicit Wait
Explicit Wait
Implicit Wait: Implicit waits are used to provide a default waiting time (say 30 seconds) between each consecutive test step/command across the entire test script. Thus, subsequent test step would only execute when the 30 seconds have elapsed after executing the previous test step/command.

Explicit Wait: Explicit waits are used to halt the execution till the time a particular condition is met or the maximum time has elapsed. Unlike Implicit waits, explicit waits are applied for a particular instance only.

Q #21) How to type in a textbox using Selenium?

The user can use sendKeys(“String to be entered”) to enter the string in the textbox.

Syntax:
WebElement username = drv.findElement(By.id(“Email”));
// entering username
username.sendKeys(“sth”);

Q #22) How can you find if an element in displayed on the screen?

WebDriver facilitates the user with the following methods to check the visibility of the web elements. These web elements can be buttons, drop boxes, checkboxes, radio buttons, labels etc.

isDisplayed()
isSelected()
isEnabled()
Syntax:

isDisplayed():
boolean buttonPresence = driver.findElement(By.id(“gbqfba”)).isDisplayed();

isSelected():
boolean buttonSelected = driver.findElement(By.id(“gbqfba”)).isDisplayed();

isEnabled():
boolean searchIconEnabled = driver.findElement(By.id(“gbqfb”)).isEnabled();

Q #23) How can we get a text of a web element?

Get command is used to retrieve the inner text of the specified web element. The command doesn’t require any parameter but returns a string value. It is also one of the extensively used commands for verification of messages, labels, errors etc displayed on the web pages.

Syntax:
String Text = driver.findElement(By.id(“Text”)).getText();

Q #24) How to select value in a dropdown?

The value in the dropdown can be selected using WebDriver’s Select class.

Syntax:

selectByValue:
Select selectByValue = new Select(driver.findElement(By.id(“SelectID_One”)));
selectByValue.selectByValue(“greenvalue”);

selectByVisibleText:
Select selectByVisibleText = new Select (driver.findElement(By.id(“SelectID_Two”)));
selectByVisibleText.selectByVisibleText(“Lime”);

selectByIndex:
Select selectByIndex = new Select(driver.findElement(By.id(“SelectID_Three”)));
selectByIndex.selectByIndex(2);

Q #25) What are the different types of navigation commands?

Following are the navigation commands:
navigate().back() – The above command requires no parameters and takes back the user to the previous webpage in the web browser’s history.

Sample code:
driver.navigate().back();

navigate().forward() – This command lets the user to navigate to the next web page with reference to the browser’s history.

Sample code:
driver.navigate().forward();

navigate().refresh() – This command lets the user to refresh the current web page there by reloading all the web elements.

Sample code:
driver.navigate().refresh();

navigate().to() – This command lets the user to launch a new web browser window and navigate to the specified URL.

Sample code:
driver.navigate().to(“https://google.com”);

Q #26) How to click on a hyper link using linkText?

driver.findElement(By.linkText(“Google”)).click();

The command finds the element using link text and then click on that element and thus the user would be re-directed to the corresponding page.

The above-mentioned link can also be accessed by using the following command.

driver.findElement(By.partialLinkText(“Goo”)).click();

The above command finds the element based on the substring of the link provided in the parenthesis and thus partialLinkText() finds the web element with the specified substring and then clicks on it.

Q #27) How to handle frame in WebDriver?

An inline frame acronym as iframe is used to insert another document within the current HTML document or simply a web page into a web page by enabling nesting.

Select iframe by id
driver.switchTo().frame(“ID of the frame“);

Locating iframe using tagName
driver.switchTo().frame(driver.findElements(By.tagName(“iframe”).get(0));

Locating iframe using index

frame(index)
driver.switchTo().frame(0);

frame(Name of Frame)
driver.switchTo().frame(“name of the frame”);

frame(WebElement element)
Select Parent Window
driver.switchTo().defaultContent();

Q #28) When do we use findElement() and findElements()?

findElement(): findElement() is used to find the first element in the current web page matching to the specified locator value. Take a note that only first matching element would be fetched.

Syntax:

WebElement element = driver.findElements(By.xpath(“//div[@id=’example’]//ul//li”));
findElements(): findElements() is used to find all the elements in the current web page matching to the specified locator value. Take a note that all the matching elements would be fetched and stored in the list of WebElements.

Syntax:
List <WebElement> elementList = driver.findElements(By.xpath(“//div[@id=’example’]//ul//li”));

Q #29) How to find more than one web element in the list?

At times, we may come across elements of same type like multiple hyperlinks, images etc arranged in an ordered or unordered list. Thus, it makes absolute sense to deal with such elements by a single piece of code and this can be done using WebElement List.

Sample Code

1
// Storing the list
2
List <WebElement> elementList = driver.findElements(By.xpath(“//div[@id=’example’]//ul//li”));
3
// Fetching the size of the list
4
int listSize = elementList.size();
5
for (int i=0; i<listSize; i++)
6
{
7
// Clicking on each service provider link
8
serviceProviderLinks.get(i).click();
9
// Navigating back to the previous page that stores link to service providers
10
driver.navigate().back();
11
}
Q #30) What is the difference between driver.close() and driver.quit command?

close(): WebDriver’s close() method closes the web browser window that the user is currently working on or we can also say the window that is being currently accessed by the WebDriver. The command neither requires any parameter nor does it return any value.

quit(): Unlike close() method, quit() method closes down all the windows that the program has opened. Same as close() method, the command neither requires any parameter nor does is return any value.

Q #31) Can Selenium handle windows based pop up?

Selenium is an automation testing tool which supports only web application testing. Therefore, windows pop up cannot be handled using Selenium.

Q #32) How can we handle web-based pop up?

WebDriver offers the users with a very efficient way to handle these pop-ups using Alert interface. There are the four methods that we would be using along with the Alert interface.

void dismiss() – The accept() method clicks on the “Cancel” button as soon as the pop-up window appears.
void accept() – The accept() method clicks on the “Ok” button as soon as the pop-up window appears.
String getText() – The getText() method returns the text displayed on the alert box.
void sendKeys(String stringToSend) – The sendKeys() method enters the specified string pattern into the alert box.
Syntax:
// accepting javascript alert
Alert alert = driver.switchTo().alert();
alert.accept();

Q #33) How can we handle windows based pop up?

Selenium is an automation testing tool which supports only web application testing, that means, it doesn’t support testing of windows based applications. However Selenium alone can’t help the situation but along with some third-party intervention, this problem can be overcome. There are several third-party tools available for handling window based pop-ups along with the selenium like AutoIT, Robot class etc.

Q #34) How to assert title of the web page?

//verify the title of the web page
assertTrue(“The title of the window is incorrect.”,driver.getTitle().equals(“Title of the page”));

Q #35) How to mouse hover on a web element using WebDriver?

WebDriver offers a wide range of interaction utilities that the user can exploit to automate mouse and keyboard events. Action Interface is one such utility which simulates the single user interactions.

Thus, In the following scenario, we have used Action Interface to mouse hover on a drop down which then opens a list of options.

Sample Code:

1
// Instantiating Action Interface
2
Actions actions=new Actions(driver);
3
// howering on the dropdown
4
actions.moveToElement(driver.findElement(By.id(“id of the dropdown”))).perform();
5
// Clicking on one of the items in the list options
6
WebElement subLinkOption=driver.findElement(By.id(“id of the sub link”));
7
subLinkOption.click();
Q #36) How to retrieve CSS properties of an element?

The values of the css properties can be retrieved using a get() method:

Syntax:
driver.findElement(By.id(“id“)).getCssValue(“name of css attribute”);
driver.findElement(By.id(“id“)).getCssValue(“font-size”);

Q #37) How to capture screenshot in WebDriver?

1
import org.junit.After;
2
import org.junit.Before;
3
import org.junit.Test;
4
import java.io.File;
5
import java.io.IOException;
6
import org.apache.commons.io.FileUtils;
7
import org.openqa.selenium.OutputType;
8
import org.openqa.selenium.TakesScreenshot;
9
import org.openqa.selenium.WebDriver;
10
import org.openqa.selenium.firefox.FirefoxDriver;
11

12
public class CaptureScreenshot {
13
WebDriver driver;
14
@Before
15
public void setUp() throws Exception {
16
driver = new FirefoxDriver();
17
driver.get(“https://google.com”);
18
}
19
@After
20
public void tearDown() throws Exception {
21
driver.quit();
22
}
23

24
@Test
25
public void test() throws IOException {
26
// Code to capture the screenshot
27
File scrFile = ((TakesScreenshot)driver).getScreenshotAs(OutputType.FILE);
28
// Code to copy the screenshot in the desired location
29
FileUtils.copyFile(scrFile, new File(“C:\\CaptureScreenshot\\google.jpg”))
30
}
31
}
Q #38) What is Junit?

Junit is a unit testing framework introduced by Apache. Junit is based on Java.

Q #39) What are Junit annotations?

Following are the JUnit Annotations:

@Test: Annotation lets the system know that the method annotated as @Test is a test method. There can be multiple test methods in a single test script.
@Before: Method annotated as @Before lets the system know that this method shall be executed every time before each of the test methods.
@After: Method annotated as @After lets the system know that this method shall be executed every time after each of the test method.
@BeforeClass: Method annotated as @BeforeClass lets the system know that this method shall be executed once before any of the test methods.
@AfterClass: Method annotated as @AfterClass lets the system know that this method shall be executed once after any of the test methods.
@Ignore: Method annotated as @Ignore lets the system know that this method shall not be executed.
Q #40) What is TestNG and how is it better than Junit?

TestNG is an advanced framework designed in a way to leverage the benefits by both the developers and testers. With the commencement of the frameworks, JUnit gained an enormous popularity across the Java applications, Java developers and Java testers with remarkably increasing the code quality. Despite being easy to use and straightforward, JUnit has its own limitations which give rise to the need of bringing TestNG into the picture. TestNG is an open source framework which is distributed under the Apache Software License and is readily available for download.

TestNG with WebDriver provides an efficient and effective test result format that can, in turn, be shared with the stakeholders to have a glimpse on the product’s/application’s health thereby eliminating the drawback of WebDriver’s incapability to generate test reports. TestNG has an inbuilt exception handling mechanism which lets the program to run without terminating unexpectedly.

There are various advantages that make TestNG superior to JUnit. Some of them are:

Added advance and easy annotations
Execution patterns can set
Concurrent execution of test scripts
Test case dependencies can be set
Q #41) How to set test case priority in TestNG?

Setting Priority in TestNG

Code Snippet

1
package TestNG;
2
import org.testng.annotations.*;
3
public class SettingPriority {
4
@Test(priority=0)
5
public void method1() {
6
}
7
@Test(priority=1)
8
public void method2() {
9
}
10
@Test(priority=2)
11
public void method3() {
12
}
13
}
Test Execution Sequence:

Method1
Method2
Method3
Q #42) What is a framework?

The framework is a constructive blend of various guidelines, coding standards, concepts, processes, practices, project hierarchies, modularity, reporting mechanism, test data injections etc. to pillar automation testing.

Q #43) What are the advantages of Automation framework?

The advantage of Test Automation framework

Reusability of code
Maximum coverage
Recovery scenario
Low-cost maintenance
Minimal manual intervention
Easy Reporting
Q #44) What are the different types of frameworks?

Below are the different types of frameworks:

Module Based Testing Framework: The framework divides the entire “Application Under Test” into the number of logical and isolated modules. For each module, we create a separate and independent test script. Thus, when these test scripts taken together builds a larger test script representing more than one module.
Library Architecture Testing Framework: The basic fundamental behind the framework is to determine the common steps and group them into functions under a library and call those functions in the test scripts whenever required.
Data Driven Testing Framework: Data Driven Testing Framework helps the user segregate the test script logic and the test data from each other. It lets the user store the test data into an external database. The data is conventionally stored in “Key-Value” pairs. Thus, the key can be used to access and populate the data within the test scripts.
Keyword Driven Testing Framework: The Keyword Driven testing framework is an extension to Data-driven Testing Framework in a sense that it not only segregates the test data from the scripts, it also keeps the certain set of code belonging to the test script into an external data file.
Hybrid Testing Framework: Hybrid Testing Framework is a combination of more than one above mentioned frameworks. The best thing about such a setup is that it leverages the benefits of all kinds of associated frameworks.
Behavior Driven Development Framework: Behavior Driven Development framework allows automation of functional validations in easily readable and understandable format to Business Analysts, Developers, Testers, etc.
Q #45) How can I read test data from excels?

Test data can efficiently be read from excel using JXL or POI API. See detailed tutorial here.

Q #46) What is the difference between POI and jxl jar?

# JXL jar POI jar
1 JXL supports “.xls” format i.e. binary based format. JXL doesn’t support Excel 2007 and “.xlsx” format i.e. XML based format POI jar supports all of these formats
2 JXL API was last updated in the year 2009 POI is regularly updated and released
3 The JXL documentation is not as comprehensive as that of POI POI has a well prepared and highly comprehensive documentation
4 JXL API doesn’t support rich text formatting POI API supports rich text formatting
5 JXL API is faster than POI API POI API is slower than JXL API
Q #47) What is the difference between Selenium and QTP?

Feature Selenium Quick Test Professional (QTP)
Browser Compatibility Selenium supports almost all the popular browsers like Firefox, Chrome, Safari, Internet Explorer, Opera etc QTP supports Internet Explorer, Firefox and Chrome. QTP only supports Windows Operating System
Distribution Selenium is distributed as an open source tool and is freely available QTP is distributed as a licensed tool and is commercialized
Application under Test Selenium supports testing of only web based applications QTP supports testing of both the web based application and windows based application
Object Repository Object Repository needs to be created as a separate entity QTP automatically creates and maintains Object Repository
Language Support Selenium supports multiple programming languages like Java, C#, Ruby, Python, Perl etc QTP supports only VB Script
Vendor Support As Selenium is a free tool, user would not get the vendor’s support in troubleshooting issues Users can easily get the vendor’s support in case of any issue
Q #48) Can WebDriver test Mobile applications?

WebDriver cannot test Mobile applications. WebDriver is a web-based testing tool, therefore applications on the mobile browsers can be tested.

Q #49) Can captcha be automated?

No, captcha and barcode reader cannot be automated.

Q #50) What is Object Repository? How can we create Object Repository in Selenium?

Object Repository is a term used to refer to the collection of web elements belonging to Application Under Test (AUT) along with their locator values. Thus, whenever the element is required within the script, the locator value can be populated from the Object Repository. Object Repository is used to store locators in a centralized location instead of hardcoding them within the scripts.

How would you make sure that a page is loaded using Selenium and Webdriver?

Ans. In Selenium, you can use the below lines of code to check for the successful loading of a web page. The best approach is by selecting an element from the page & stand by till it becomes clickable.

selenium.waitForPageToLoad(“5000”);
// Or
while (!(selenium.isElementPresent(“any page element “)==true)) {
selenium.setSpeed(“5”);
Thread.sleep(5);
}
Below is the Webdriver specific code to achieve the same objective.

WebDriverWait check = new WebDriverWait(driver, 100);
check.until(ExpectedConditions.anyElement(By.id(id)));

Q: How to launch a batch file in a Selenium Webdriver project?

Ans. It’s usual in a test suite to run a batch file or an executable file for setting up the pre-requisites before starting the automation. You can use the below Java code for this purpose.

Process batch = Runtime.getRuntime.exec(“path of the batch file”);
batch.waitFor();

Q: How do you read a JavaScript variable in Selenium WebDriver?

Ans. It’s easy to access any JavaScript variable from the Selenium Webdriver test scripts. Just you need to use the below Java code snippet.

// Initialize the JS object.
JavascriptExecutor JS = (JavascriptExecutor) webdriver;
// Get the current site title.
String sitetitle = (String)JS.executeScript(“return document.title”);
System.out.println(“My Site Title: ” + sitetitle);

Q: How to run the selenium IDE test suite from the command line?

Ans. We’ve given the command to run the SIDE test suite in the next line.

Java -jar “C:\Selenium Webdriver Questions\selenium-server-standalone-2.33.0.jar” -htmlSuite “*firefox” “http://www.google.com” ” “C:\Selenium Webdriver Questions\SeleniumSuite.HTML”

Q: How to run the Selenium Webdriver test from the command line?

Ans. We can run any Selenium Webdriver test written in Java using the following command.

java -classpath “.;selenium-server-standalone-2.33.0.jar” SampleClass

Q: What are the different exceptions you face in Selenium Webdriver?

Ans.

WebDriverException,
NoAlertPresentException,
NoSuchWindowException,
NoSuchElementException,
TimeoutException.

Q: How would you automatically click a screenshot whenever any exception occurs?

Ans. For this you will have to use <EventFiringWebDriver> class and needs to implement the <onException> method of the <WebDriverEventListener> interface. See the code example given below.

WebDriver browser = new FirefoxDriver();

EventFiringWebDriver eventDriver = new EventFiringWebDriver(browser).register(new AbstractWebDriverEventListener() {

@Override
public void onException(Throwable throwable, WebDriver browser) {

// Take the screenshot using the Webdriver.
File screen = ((TakesScreenshot)driver).getScreenshotAs(OutputType.FILE);

// Now you can copy the screenshot somewhere on your system.
FileUtils.copyFile(screen, new File(“c:\\Selenium Testing Questions\\screen.png”));
}
});

try {

eventDriver.findElement(By.id(“test”));
fail(“Caught the Expected exception.”); // Intentionally causing the exception for demo.

} catch (NoSuchElementException e) {

// Triggering point for the <onException> event.
}

Q: How would you select any particular text using the Selenium Webdriver?

Ans. It seems an easy one at first but you need to do a little more to achieve this.

driver.get(“/”);

WebElement item = driver.findElement(By.xpath(“//p[contains(text(),’Selenium webdriver quesions’)]”));

Actions dummy = new Actions(driver);

dummy.doubleClick(item).build().perform();

Q: Give an example to perform drag and drop action In Selenium WebDriver?

Ans. Yes, we can use the Advanced User Interactions API to perform drag and drop operations in a Selenium Webdriver project.

Code example:

Actions act = new Actions(driver);

act.dragAndDrop(source_locator, target_locator).build().perform();

//Or you can use the below code style.

(new Actions(driver)).dragAndDrop(source_locator, target_locator).perform();

Q: How would you fill a text field without calling the sendKeys()?

Ans. It’s a bit slower than the sendKeys() method but we do have means to type in a text field. See the Java code given below.

JavascriptExecutor JS = (JavascriptExecutor)webdriver;

JS.executeScript(“document.getElementById(User’).value=’admin@testmail.com'”);

JS.executeScript(“document.getElementById(‘Pass’).value=’######'”);

Q: How can you check the state of a checkbox/radio button?

Ans. We can call the isSelected() method to test the status of these elements.

Example Code:

boolean test = driver.findElement(By.xpath(“checkbox/radio button XPath”)).isSelected();

Q: How would you handle the alert popups in Selenium Webdriver?

Ans. First, you’ve to switch the control to the pop up then press the ok or cancel button. After that, turn back to the source page screen.

Code Example:

String srcPage = driver.getWindowHandle();

Alert pop = driver.switchTo().alert(); // shift control to the alert popup.

pop.accept(); // click on ok button.

pop.dismiss(); // click on cancel button.

// Move the control back to source page.

driver.switchTo().window(srcPage); // move back to the source page.

Q: What is the process to start the IE/Chrome browser?

Ans. If you want to start a browser then, just set the system properties as mentioned below.

// For the IE web browser.

System.setProperty(“webdriver.ie.driver”,” iedriver.exe file path”);

WebDriver driver = new InternetExplorerDriver();

// For the Chrome web browser.

System.setProperty(“webdriver.chrome.driver”,”chrome.exe file path”);

WebDriver driver = new ChromeDriver();

Q: How would you simulate the right click operation in WebDriver?

Ans. You can make use of the Actions class features.

Actions test = new Actions(driver); // Here, driver is the object of WebDriver class.

test.moveToElement(element).perform();

test.contextClick().perform();

Q: How would you select a menu item from a drop down menu?

Ans. There can be following two situations.

If the menu has is using the <select> tag then you can call the <selectByValue()> or <selectByIndex()> or <selectByVisibleText()> methods of the Select class.
If the menu doesn’t use the <select> tag then simply find the XPath of that element and perform the click action for its selection.

Q: What is the FirefoxDriver, class or an interface? And which interface does it implement?

Ans. FirefoxDriver is a Java class, and it implements the <WebDriver> interface. It contains the implementations of all the methods available in the <WebDriver> interface.

Q: What is the name of the super interface of the Webdriver?

Ans. SearchContext.

Q: What is the main difference between the close() and quit() methods?

Ans.

close() – it closes the currently active browser window.

quit()- it will close all of the opened browser windows and the browser itself.

Q: What is the best way to check for the highlighted text on a web page?

Ans. Use the below code to verify the highlighted text for an element on the web page.

String clr = driver.findElement(By.xpath(“//a[text()=’TechBeamers’]”)).getCssValue(“color”);

String bkclr = driver.findElement(By.xpath(“//a[text()=’TechBeamers’]”)).getCssValue(“background-color”);

System.out.println(clr);

System.out.println(bkclr);

Q: How would you use a Selenium variable say “size” from the JavaScript?

Ans. ${size}

Q: What is the Selenese command to show the value of a variable in the log file?

Ans. echo()

Let’s now summarize the above post which includes the top 35 Selenium Webdriver questions and do a quick review of the content.

Final Word.
We’ve tried to bring the most pertinent Selenium Webdriver questions in this post, but this topic belongs to an evolving subject. Hence, there would always be the scope of improvements and enhancements. We’ll keep supporting all the new changes in the Selenium Webdriver technology and will add more and more questions that could add to your skills and boost your confidence while you face any job interview.

We’ve already covered a wide range of Selenium interview questions and quizzes on our blog, and this post is like a testimonial that we do introduce a fresh set of questions on a regular basis.

Next, we like you to contribute to our knowledge drive. You can do this by sharing this list of top Selenium Webdriver questions among your friends and on social media using the sharing icons shown below.

Informatica Business Solutions Private Limited ( call based through fresherworld 2016, 2017 )
DRIVE DATE 30/3/2018

SECOND ROUND
Address: No. 66/1, Bagmane Commerz 02, Bagmane Tech Park, C V Raman Nagar, Bengaluru, Karnataka 560093
**************************************************************************************************************
Informatica Business Solutions Pvt Ltd Interview Experience !
WRITTEN TEST : Technical : 75 Minutes
Details of types of questions asked in each of the sections:
The written test was pretty much simple. It was in 2 parts:1. MCQs and 2. Coding. In MCQs, there were questions on only Data Structures and Algorithms. In the coding part, there were 15 questions of coding and debugging.
PERSONAL INTERVIEW (TECHNICAL)
It was conducted in 2 rounds. Students selected in round 1 were interviewed for the second round.
1. Design a File System based on some corresponding database where from you can query (using SQL) and get the same output as you would have got from the data base and then transform the result in XML. He asked me to present an abstract design not very detailed. I drew block diagrams and explained it to him.
2. Write a C++ program to shuffle a given record stored in a file so that the resulting output is random. Optimize it so that each time the program produces a different output.
3. Suggest a database table structure having 3 entities:
a. Flight type
b. FLight No.
c. Pilots
There could be millions of flight type. Each type may contain several flight numbers. a pilot can fly several types of flights. There will be queries like return all the flight nos. flown by a given pilot or no. of pilots flying a given type of flight.
PERSONAL INTERVIEW (HR)
The HR interviewer asked me some typical HR questions:
Favorite subjects? Hobbies?
Why do you want to join our company.
Why do you think you are creative?
Why do you want to go for development?
What is your biggest regret in life?
Other than this which company did you sit for?
Why weren’t you selected in that company?(Answer this very carefully!)
Then they asked me to ask them any questions to them. I asked them about the work culture, what kind of projects will I be working on, the best product of the company etc.
SUMMARY OF EXPERIENCES
Question in the technical interviews were mainly design and deveopment based rather than subject specific. The interviewer was mainly looking for your thought process, how you comprehend the problem at hand and your reasoning.
SUGGESTIONS TO JUNIORS
Since it is a Data Integration company, a sound concept of Data warehouse is advised though I wasn’t asked any question on that. Java and JDBC were also asked from my friends. I you have done some application or web project, that would be of great help. All the best.

Mu Sigma company ( call based drive 2016, 2017 )

package 21 lac

drive date 4th april 2018

Mu-Sigma Placement Paper
***************************************************************************************
http://placement.freshersworld.com/…/aptitude-quest…/3313861
*************************************************************************************

1. 1/4th of 1/2 of 3/4th of 52000 = ?
(1) 4875
(2) 4857
(3) 4785
(4) 4877
(5) None of these
Answer: 1

2. void main()
{
int a[5] ={1,2,3,4,5},i,j=2,b;
for (i =0;i<5;i++ )
func(j,a[i]);
for (i =0;i<5;i++ )
printf(?%d?,a[i]);
}
func(int j,int *a)
{
j=j+1;
a=a+j;
b= b+2;
}
Output: 12345

3. A survey of a village showed that 1 / 10 of the total population speak neither Hindi nor English. 1 / 5 of them cannot speak English and 3 / 7 of them cannot speak Hindi. What percentages of people know only one language?
A) 42.86 %
B) 40 %
C) 34 %
D) None of these

4. Mr Roy found an old bill which shows that he brought 10 hens for Rs_67.92_ the first and the last digits were missing. what was the cost of each hen?

5. Four cities are connected by a road network as shown in the figure. In how many ways can you start from any city and come back to it without travelling on the same road more than once ?
A) 8
B) 12
C) 16
D) 20
Ans. 12.

6. 15 men take 21 days of 8 hrs. each to do a piece of work. How many days of 6 hrs. each would it take for 21 women if 3 women do as much work as 2 men?
(a) 30
(b) 20
(c) 19
(d) 29
Answer: a

7. The cost of 5 chairs and 3 mugs is Rs 1900, and the cost of 8 chairs and 5 mugs is Rs 2900, what is the cost of 5 chairs and 8 mugs?

8. A cylinder is 6 cms in diameter and 6 cms in height. If spheres of the same size are made from the material obtained, what is the diameter of each sphere?
(a) 5 cms
(b) 2 cms
(c) 3 cms
(d) 4 cms
(Ans C)

9. void main()
{
int a[5] ={1,2,3,4,5,6,7},i,j=2,b;
for (i =0;i<7;i++ )
func(j,a[i]);
for (i =0;i<7;i++ )
printf(?%d?,a[i]);
}
func(int j,int *a)
{
j=j+1;
a=a+j;
b= b+2;
}
Output: 1234567

10. If an item costs Rs.3 in ’99 and Rs.203 in ’00.What is the % increase in price?
(a) 200/3 %
(b) 200/6 %
(c) 100%
(d) none of these
(Ans. A)

11. A student scores 55% marks in 8 papers of 100 marks each. He scores 15% of his total marks in English. How much does he score in English?
1) 55
2) 66
3) 77
4) 44
5) None of these

12. What is the smallest number by which 2880 must be divided in order to make it into a perfect square ?
(a) 3
(b) 4
(c) 5
(d) 6

13. A certain number of men can finish a piece of work in 10 days. If however there were 10 men less it will take 10 days more for the work to be finished. How many men were there originally?
(a) 110 men
(b) 130 men
(c) 100 men
(d) none of these
(Ans. A)

14. What will be output of the following program ?
void main()
{
const int i=60;
int *p;
p=&i;
*p=40;
clrscr();
printf(“%d”,i);
getch();
}

15. 4 9/10 + 3/11 + 7/15 = ?
(1) 1 217/330
(2) 1 221/330
(3) 1 211/330
(4) 1 197/330
(5) None of these
Answer: 3

16. A, B, C and D go for a picnic. When A stands on a weighing machine, B also climbs on, and the weight shown was 132 kg. When B stands, C also climbs on, and the machine shows 130 kg. Similarly the weight of C and D is found as 102 kg and that of B and D is 116 kg. What is D’s weight
A. 58kg

B. 78 kg
C. 44 kg
D. None
Answer : C

17. There are 8 people, F, G H J K L M N. 2 groups are to be formed. F will always go with J. G and M will never go tohether. H will always go with L. N will always go with G. find out the two groups.

18. If log 0.317=0.3332 and log 0.318=0.3364 then find log 0.319 ?

19. A person travels in a car with uniform speed. He observes the milestone,which has 2 digits. After one hour he observes another milestone with same digits reversed. After another hour he observes another milestone with same 2 digits separated by 0. Find the speed of the car?
Ans: 45

20.
#include main()
{
int i;
for (i=1;i<100; i++)
printf(“%d %0x\n”,i,i);
}
/* Ans:- i is from 1 to 99 for the first format,
for the second format 1to9, ato f, 10 to 19,1ato1f, 20 to 29, etc */

Mu Sigma Placement Paper

1: The average age of a class of 39 students is 15 years .If the age of the teacher be included, then the average increases by 3 months. Find the age of the teacher.
A. 25 years
B. 27 years
C. 35 years
D. 28 years

2: Three years ago, the average age of A, B and C was 27 years and that of B and C, 5 years ago was 20 years. A�s present age is?
A. 30 yrs
B. 35 yrs
C. 40 yrs
D. 48 yrs

3: The average of eight numbers is 14. The average of six of these numbers is 16.The average of the remaining two numbers is?
A.4
B. 8
C.16
D. None

4: In an examination, 35% of the students passed and 455 failed. How many students appeared for the examination?
A. 490
B. 700
C. 845
D. 1300

5: The average age of a class of 39 students is 15 years .If the age of the teacher be included, then the average increases by 3 months .Find the age of the teacher.
A. 25 years
B. 27 years
C. 35 years
D. 28 years

6: The average of six numbers is 30.If the average of first four is 25 and that of last three is 35, the fourth number is?
A. 25
B. 30
C.35
D.40

7: 2 is what percent of 50?
A.2%
B.10%
C.100%
D.4%

8: 5% of (25% of Rs. 1600) is?
A.Rs. 5
B.Rs. 17.50
C. Rs. 20
D.Rs. 25

9: The average age of 30 students is 9 years .If the age of their teacher is included, it becomes 10 years. The age of the teacher (in years) is?
A. 27
B. 31
C. 35
D. 40

10: At an election a candidate who gets 84% of the votes is elected by a majority of 476 votes. What is the total number of votes polled?
A. 672
B. 700
C. 749
D. 848

11: The average of ten numbers is 7. If each number is multiplied by 12; then the average of new set of numbers is?
A 7
B. 19
C. 82
D. 84

12: A batsman makes a score of 87 runs in the 17th inning and thus increases his average by 3 . Find his average after 17th inning.
A. 39
B. 38
C. 38.5
D. 39.5

13: Out of four numbers, the average of first three is 16 and that of the last three is 15. If the last number is 18, the first number is?
A. 20
B. 21
C. 23
D. 25

14: Narasimha, Madhu and Pavan started a business by investing Rs. 1, 20,000, Rs. 1, 35,000 and Rs 1, 50,000 respectively. Find the share of Pavan, out of an annual profit of Rs 56,700.
A. Rs .16, 800
B. Rs.18, 900
C. Rs.21, 000
D. None

15: Anand and Deepak started a business investing Rs. 22,500 and Rs.35, 000 respectively. Out of a total profit of Rs. 13,800, Deepak�s share is?
A. Rs .5400
B. Rs. 7200
C. Rs. 84,000
D. 94,000

16: A starts business with Rs. 35,000 and after 5 months, B joins with A as his partner. After a year, the profit is divided in the ratio 2:3. What is B�s contribution in the capital?
A. Rs .7500
B. Rs. 8000
C. Rs. 8500
D. Rs. 9000

17: A & B are partners in a business. A contributes 1/4 of the capital for 15 months and B received 2/3 of the profit .For how long B�s money was used?
A. 6 months
B. 9 months
C. 10 months
D. 1 year

18: X and Y invested in a business. They earned the profit, which they divided in the ratio of 2:3. If X invested Rs. 40,000, the amount invested by Y is?
A. Rs .60, 000
B. Rs. 8000
C. Rs. 50,000
D. Rs. 90,000

19: A, B and C enter into a partnership and their shares are in the ratio 1/2:1/3:1/4.After 2 months, A withdraws half of his capital and after 10 months, a profit of Rs. 378 is divided among them. What is B�s share?
A. Rs .129
B. Rs. 144
C. Rs. 156
D. Rs. 168

20: A, B, C enters into a partnership investing Rs 35000 Rs 45000 and Rs 55000 respectively. The respective shares of A, B and C in annual profit of Rs 40,500 are
A. Rs.10, 500, Rs.13, 500, Rs.16, 500
B. Rs.11, 500, Rs.13, 000, Rs.16, 000
C. Rs.11, 000, Rs.14, 000, Rs.15, 500
D. Rs.11, 500, Rs.12, 500 Rs16, 500

21: Q is not equal to zero and k = (Q x n � s)/2 find n?
A. (2 x k + s)/Q
B. (2 x s x k)/Q
C. (2 x k � s)/Q
D. (2 x k + s x Q)/Q (e) (k + s)/Q

22: What does the hexa-number E78 in radix 7?
A. 12455
B. 14153
C. 14256
D. 13541

23: Printing process in which ink is applied to paper or board from raised portions of printing plates or type is called-
A. Printing, Letterpress
B. Printing, Flexographic
C. Printing, Silk screen
D. None of the above

24: A Printing Machine that transfers impressions from Flat Plate to Rubber Cylinder, thence to paper is called-
A. Laser Printer
B. Press, Offset
C. Digital Printer
D. All of the above

25: What is the remainder of (3682*3684*3686) divided by 19?
A. 0
B. 12
C. 1
D. 11

26: A puts a share of 1/3, B puts a share of 1/2, and the remaining share is put by c and start a business their total profit is Rs 4800, what is the share of A?
A. 400
B. 800
C. 1200
D. None

27: After replacing an old member by a new member, it was found that the average age of five members of a club is the same as it was 3 years ago. What is the difference between the ages of the replaced and the new member?
A. 8 yrs
B. 15 yrs
C. 4 yrs
D. 2 yrs

28: Three years ago, the average age of a family of 5 members was 17 years. A baby having been born, the average age of the family is the same today. The present age of the baby is?
A. 3 yrs
B. 2.4 yrs
C. 2 yrs
D. 1.5 yrs

29: The average of six numbers is 30.If the average of first four is 25 and that of last three is 35, the fourth number is?
A. 25
B. 30
C.35
D.40

30: The average weight of 6 men decreases by 3 kg when one of them weighing 80 kg is replaced by a new man. The weight of the new man is?
A. 56kg
B. 58 kg
C. 62 kg
D. 76 kg

Mu Sigma Model Question Paper

Aptitude Questions

1. 2 hours after a freight train leaves Delhi a passenger train leaves the same station travelling in the same direction at an average speed of 16 km/hr. After travelling 4 hrs the passenger train overtakes the freight train. The average speed of the freight train was?
a) 30
b) 40
c) 58
d) 60
Ans: b

2. 1/3 of girls , 1/2 of boys go to canteen .What factor and total number of classmates go to canteen?
Ans: Cannot be determined.

3. The cost of an item is Rs 12.60. If the profit is 10% over selling price what is the selling price?
Ans: Rs 13.86/-

4. An equilateral triangle of sides 3 inch each is given. How many equilateral triangles of side 1 inch can be formed from it?
Ans: 9

5. 20% of a 6 litre solution and 60% of 4 litre solution are mixed. What percentage of the mixture of solution?
Ans: 36%

6. There are 12 boys and 15 girls, How many different dancing groups can be formed with 2 boys and 3 girls. Which of the following fractions is less than 1/3?
a) 22/62
b) 15/46
c) 2/3
d) 1
Ans: b

7. Find the value of ( 0.75 * 0.75 * 0.75 – 0.001 ) / ( 0.75 * 0.75 – 0.075 + 0.01)?
a) 0.845
b) 1.908
c) 2.312
d) 0.001
Ans: a

8. If a man buys 1 lt of milk for Rs.12 and mixes it with 20% water and sells it for Rs.15, then what is the percentage of gain?

9. If a sum of money compound annually amounts of thrice itself in 3 years. In how many years will it become 9 times itself?
a) 6
b) 8
c) 10
d) 12
Ans: a

10. A man spends half of his salary on household expenses, 1/4th for rent, 1/5th for travel expenses, the man deposits the rest in a bank. If his monthly deposits in the bank amount 50, what is his monthly salary ?
a) Rs.500
b) Rs.1500
c) Rs.1000
d) Rs. 900
Ans: c

11. If 9x-3y=12 and 3x-5y=7 then 6x-2y = ?
a) -5
b) 4
c) 2
d) 8
Ans: d

12. The price of a product is reduced by 30% . By what percentage should it be increased to make it 100%?
Ans: 42.857%

13. There are 6 red shoes & 4 green shoes . If two of red shoes are drawn what is the probability of getting red shoes?
Ans: 6c2/10c2

14. If A/B = 3/5,then 15A = ?
Ans: 9B

15. City A’s population is 68000, decreasing at a rate of 80 people per year. City B having population 42000 is increasing at a rate of 120 people per year. In how many years both the cities will have same population?
Ans: 130 years

16. There are two circles, one circle is inscribed and another circle is circumscribed over a square. What is the ratio of area of inner to outer circle?
Ans: 1 : 2

17. A can have a piece of work done in 8 days, B can work three times faster than the A, C can work five times faster than A. How many days will they take to do the work together ?
a) 3 days
b) 8/9 days
c) 4 days
d) can’t say
Ans: b

18. Pipe A can fill a tank in 30 mins and Pipe B can fill it in 28 mins.If 3/4th of the tank is filled by Pipe B alone and both are opened, how much time is required by both the pipes to fill the tank completely?

19. Two trains move in the same direction at 50 kmph and 32 kmph respectively. A man in the slower train observes the 15 seconds elapse before the faster train completely passes by him. What is the length of faster train?
a) 100m
b) 75m
c) 120m
d) 50m
Ans: b
**************************************************************************************************
GD Topics
********************************************************
Are digital payments secure enough for the Indian economy to go cashless?
Ban 500, 1000 notes – Corruption Uprooted or just changing clothes!
Can we dream of hosting the Olympics?
Chinese Goods vs Indian Goods
Do we really need Smart Cities?
Economic growth is more important than Ecological protection
EQ or IQ
Extra curricular activities should be made compulsory in school
Facebook needs to clarify policies on content removal!
How demonetization is affecting common people more than black money holders?
How is Technology impacting the Banking sector?
Is compulsory attendance really needed in college?
Is it fair to spare political parties from income tax investigation?
Is the youth of India confident or confused?
**********************************************************************
. Which two method you need to implement for key Object in HashMap ?
In order to use any object as Key in HashMap, it must implements equals and hashcode method in Java. Read How HashMap works in Java for detailed explanation on how equals and hashcode method is used to put and get object from HashMap.

2. What is immutable object? Can you write immutable object?Immutable classes are Java classes whose objects can not be modified once created. Any modification in Immutable object result in new object. For example is String is immutable in Java. Mostly Immutable are also final in Java, in order to prevent sub class from overriding methods in Java which can compromise Immutability. You can achieve same functionality by making member as non final but private and not modifying them except in constructor.

3. What is the difference between creating String as new() and literal?
When we create string with new() Operator, it’s created in heap and not added into string pool while String created using literal are created in String pool itself which exists in PermGen area of heap.

String s = new String(“Test”);

does not put the object in String pool , we need to call String.intern() method which is used to put them into String pool explicitly. its only when you create String object as String literal e.g. String s = “Test” Java automatically put that into String pool.

4. What is difference between StringBuffer and StringBuilder in Java ?

Classic Java questions which some people thing tricky and some consider very easy. StringBuilder in Java is introduced in Java 5 and only difference between both of them is that Stringbuffer methods are synchronized while StringBuilder is non synchronized. See StringBuilder vs StringBuffer for more differences.

5. Write code to find the First non repeated character in the String ?
Another good Java interview question, This question is mainly asked by Amazon and equivalent companies. See first non repeated character in the string : Amazon interview question

6. What is the difference between ArrayList and Vector ?
This question is mostly used as a start up question in Technical interviews on the topic of Collection framework . Answer is explained in detail here Difference between ArrayList and Vector .

7. How do you handle error condition while writing stored procedure or accessing stored procedure from java?
This is one of the tough Java interview question and its open for all, my friend didn’t know the answer so he didn’t mind telling me. my take is that stored procedure should return error code if some operation fails but if stored procedure itself fail than catching SQLException is only choice.

8. What is difference between Executor.submit() and Executer.execute() method ?
There is a difference when looking at exception handling. If your tasks throws an exception and if it was submitted with execute this exception will go to the uncaught exception handler (when you don’t have provided one explicitly, the default one will just print the stack trace to System.err). If you submitted the task with submit any thrown exception, checked exception or not, is then part of the task’s return status. For a task that was submitted with submit and that terminates with an exception, the Future.get will re-throw this exception, wrapped in an ExecutionException.

9. What is the difference between factory and abstract factory pattern?
Abstract Factory provides one more level of abstraction. Consider different factories each extended from an Abstract Factory and responsible for creation of different hierarchies of objects based on the type of factory. E.g. AbstractFactory extended by AutomobileFactory, UserFactory, RoleFactory etc. Each individual factory would be responsible for creation of objects in that genre.
You can also refer What is Factory method design pattern in Java to know more details.

10. What is Singleton? is it better to make whole method synchronized or only critical section synchronized ?
Singleton in Java is a class with just one instance in whole Java application, for example java.lang.Runtime is a Singleton class. Creating Singleton was tricky prior Java 4 but once Java 5 introduced Enum its very easy. see my article How to create thread-safe Singleton in Java for more details on writing Singleton using enum and double checked locking which is purpose of this Java interview question.

11. Can you write critical section code for singleton?
This core Java question is followup of previous question and expecting candidate to write Java singleton using double checked locking. Remember to use volatile variable to make Singleton thread-safe.

12. Can you write code for iterating over hashmap in Java 4 and Java 5 ?
Tricky one but he managed to write using while and for loop.

13. When do you override hashcode and equals() ?
Whenever necessary especially if you want to do equality check or want to use your object as key in HashMap.

14. What will be the problem if you don’t override hashcode() method ?
You will not be able to recover your object from hash Map if that is used as key in HashMap.
See here How HashMap works in Java for detailed explanation.

15. Is it better to synchronize critical section of getInstance() method or whole getInstance() method ?
Answer is critical section because if we lock whole method than every time some one call this method will have to wait even though we are not creating any object)

16. What is the difference when String is gets created using literal or new() operator ?
When we create string with new() its created in heap and not added into string pool while String created using literal are created in String pool itself which exists in Perm area of heap.

17. Does not overriding hashcode() method has any performance implication ?
This is a good question and open to all , as per my knowledge a poor hashcode function will result in frequent collision in HashMap which eventually increase time for adding an object into Hash Map.

18. What’s wrong using HashMap in multithreaded environment? When get() method go to infinite loop ?
Another good question. His answer was during concurrent access and re-sizing.

19. What do you understand by thread-safety ? Why is it required ? And finally, how to achieve thread-safety in Java Applications ?

Java Memory Model defines the legal interaction of threads with the memory in a real computer system. In a way, it describes what behaviors are legal in multi-threaded code. It determines when a Thread can reliably see writes to variables made by other threads. It defines semantics for volatile, final & synchronized, that makes guarantee of visibility of memory operations across the Threads.

Let’s first discuss about Memory Barrier which are the base for our further discussions. There are two type of memory barrier instructions in JMM – read barriers and write barrier.

A read barrier invalidates the local memory (cache, registers, etc) and then reads the contents from the main memory, so that changes made by other threads becomes visible to the current Thread.
A write barrier flushes out the contents of the processor’s local memory to the main memory, so that changes made by the current Thread becomes visible to the other threads.
JMM semantics for synchronized
When a thread acquires monitor of an object, by entering into a synchronized block of code, it performs a read barrier (invalidates the local memory and reads from the heap instead). Similarly exiting from a synchronized block as part of releasing the associated monitor, it performs a write barrier (flushes changes to the main memory)
Thus modifications to a shared state using synchronized block by one Thread, is guaranteed to be visible to subsequent synchronized reads by other threads. This guarantee is provided by JMM in presence of synchronized code block.

JMM semantics for Volatile fields
Read & write to volatile variables have same memory semantics as that of acquiring and releasing a monitor using synchronized code block. So the visibility of volatile field is guaranteed by the JMM. Moreover afterwards Java 1.5, volatile reads and writes are not reorderable with any other memory operations (volatile and non-volatile both). Thus when Thread A writes to a volatile variable V, and afterwards Thread B reads from variable V, any variable values that were visible to A at the time V was written are guaranteed now to be visible to B.

Let’s try to understand the same using the following code

Data data = null;
volatile boolean flag = false;

Thread A
————-
data = new Data();
flag = true; <– writing to volatile will flush data as well as flag to main memory

Thread B
————-
if(flag==true){ <– as=”” barrier=”” data.=”” flag=”” font=”” for=”” from=”” perform=”” read=”” reading=”” volatile=”” well=”” will=””>
use data; <!— data is guaranteed to visible even though it is not declared volatile because of the JMM semantics of volatile flag.
}

20. What will happen if you call return statement or System.exit on try or catch block ? will finally block execute?
This is a very popular tricky Java question and its tricky because many programmer think that finally block always executed. This question challenge that concept by putting return statement in try or catch block or calling System.exit from try or catch block. Answer of this tricky question in Java is that finally block will execute even if you put return statement in try block or catch block but finally block won’t run if you call System.exit form try or catch.

19. Can you override private or static method in Java ?
Another popular Java tricky question, As I said method overriding is a good topic to ask trick questions in Java. Anyway, you can not override private or static method in Java, if you create similar method with same return type and same method arguments that’s called method hiding.

20. What will happen if we put a key object in a HashMap which is already there ?
This tricky Java questions is part of How HashMap works in Java, which is also a popular topic to create confusing and tricky question in Java. well if you put the same key again than it will replace the old mapping because HashMap doesn’t allow duplicate keys.

21. If a method throws NullPointerException in super class, can we override it with a method which throws RuntimeException?
One more tricky Java questions from overloading and overriding concept. Answer is you can very well throw super class of RuntimeException in overridden method but you can not do same if its checked Exception.

22. What is the issue with following implementation of compareTo() method in Java

public int compareTo(Object o){
Employee emp = (Employee) emp;
return this.id – o.id;
}

23. How do you ensure that N thread can access N resources without deadlock
If you are not well versed in writing multi-threading code then this is real tricky question for you. This Java question can be tricky even for experienced and senior programmer, who are not really exposed to deadlock and race conditions. Key point here is order, if you acquire resources in a particular order and release resources in reverse order you can prevent deadlock.

24. What is difference between CyclicBarrier and CountDownLatch in Java
Relatively newer Java tricky question, only been introduced form Java 5. Main difference between both of them is that you can reuse CyclicBarrier even if Barrier is broken but you can not reuse CountDownLatch in Java. See CyclicBarrier vs CountDownLatch in Java for more differences.

25. Can you access non static variable in static context?
Another tricky Java question from Java fundamentals. No you can not access static variable in non static context in Java. Read why you can not access non-static variable from static method to learn more about this tricky Java questions.
***************************************************************************************************************
data structure question
*************************************************

What is a Data Structure?
A data structure is a way of organizing the data so that the data can be used efficiently. Different kinds of data structures are suited to different kinds of applications, and some are highly specialized to specific tasks. For example, B-trees are particularly well-suited for implementation of databases, while compiler implementations usually use hash tables to look up identifiers. (Source: Wiki Page)

What are linear and non linear data Structures?

Linear: A data structure is said to be linear if its elements form a sequence or a linear list. Examples: Array. Linked List, Stacks and Queues
Non-Linear: A data structure is said to be non-linear if traversal of nodes is nonlinear in nature. Example: Graph and Trees.

What are the various operations that can be performed on different Data Structures?

Insertion − Add a new data item in the given collection of data items.
Deletion − Delete an existing data item from the given collection of data items.
Traversal − Access each data item exactly once so that it can be processed.
Searching − Find out the location of the data item if it exists in the given collection of data items.
Sorting − Arranging the data items in some order i.e. in ascending or descending order in case of numerical data and in dictionary order in case of alphanumeric data.

How is an Array different from Linked List?

The size of the arrays is fixed, Linked Lists are Dynamic in size.
Inserting and deleting a new element in an array of elements is expensive, Whereas both insertion and deletion can easily be done in Linked Lists.
Random access is not allowed in Linked Listed.
Extra memory space for a pointer is required with each element of the Linked list.
Arrays have better cache locality that can make a pretty big difference in performance.

What is Stack and where it can be used?

Stack is a linear data structure which the order LIFO(Last In First Out) or FILO(First In Last Out) for accessing elements. Basic operations of stack are : Push, Pop , Peek

Applications of Stack:

Infix to Postfix Conversion using Stack
Evaluation of Postfix Expression
Reverse a String using Stack
Implement two stacks in an array
Check for balanced parentheses in an expression

What is a Queue, how it is different from stack and how is it implemented?

Queue is a linear structure which follows the order is First In First Out (FIFO) to access elements. Mainly the following are basic operations on queue: Enqueue, Dequeue, Front, Rear
The difference between stacks and queues is in removing. In a stack we remove the item the most recently added; in a queue, we remove the item the least recently added. Both Queues and Stacks can be implemented using Arrays and Linked Lists.

What are Infix, prefix, Postfix notations?

Infix notation: X + Y – Operators are written in-between their operands. This is the usual way we write expressions. An expression such as
A * ( B + C ) / D
Postfix notation (also known as “Reverse Polish notation”): X Y + Operators are written after their operands. The infix expression given above is equivalent to
A B C + * D/
Prefix notation (also known as “Polish notation”): + X Y Operators are written before their operands. The expressions given above are equivalent to
/ * A + B C D
Converting between these notations: Click here

What is a Linked List and What are its types?

A linked list is a linear data structure (like arrays) where each element is a separate object. Each element (that is node) of a list is comprising of two items – the data and a reference to the next node.Types of Linked List :

Singly Linked List : In this type of linked list, every node stores address or reference of next node in list and the last node has next address or reference as NULL. For example 1->2->3->4->NULL
Doubly Linked List : Here, here are two references associated with each node, One of the reference points to the next node and one to the previous node. Eg. NULL<-1<->2<->3->NULL
Circular Linked List : Circular linked list is a linked list where all nodes are connected to form a circle. There is no NULL at the end. A circular linked list can be a singly circular linked list or doubly circular linked list. Eg. 1->2->3->1 [The next pointer of last node is pointing to the first]

Which data structures are used for BFS and DFS of a graph?

Queue is used for BFS
Stack is used for DFS. DFS can also be implemented using recursion (Note that recursion also uses function call stack).

Can doubly linked be implemented using a single pointer variable in every node?
Doubly linked list can be implemented using a single pointer. See XOR Linked List – A Memory Efficient Doubly Linked List

How to implement a stack using queue?

A stack can be implemented using two queues. Let stack to be implemented be ‘s’ and queues used to implement be ‘q1’ and ‘q2’. Stack ‘s’ can be implemented in two ways:

Method 1 (By making push operation costly)
Method 2 (By making pop operation costly) See Implement Stack using Queues

How to implement a queue using stack?

A queue can be implemented using two stacks. Let queue to be implemented be q and stacks used to implement q be stack1 and stack2. q can be implemented in two ways:

Method 1 (By making enQueue operation costly)
Method 2 (By making deQueue operation costly) See Implement Queue using Stacks

Which Data Structure Should be used for implementiong LRU cache?

We use two data structures to implement an LRU Cache.

Queue which is implemented using a doubly linked list. The maximum size of the queue will be equal to the total number of frames available (cache size).The most recently used pages will be near front end and least recently pages will be near rear end.
A Hash with page number as key and address of the corresponding queue node as value. See How to implement LRU caching scheme? What data structures should be used?

How to check if a given Binary Tree is BST or not?
If inorder traversal of a binary tree is sorted, then the binary tree is BST. The idea is to simply do inorder traversal and while traversing keep track of previous key value. If current key value is greater, then continue, else return false. See A program to check if a binary tree is BST or not for more details.

Linked List Questions

Linked List Insertion
Linked List Deletion
middle of a given linked list
Nth node from the end of a Linked List

Tree Traversal Questions

Inorder
Preorder and Postoder Traversals
Level order traversal
Height of Binary Tree

Convert a DLL to Binary Tree in-place
See In-place conversion of Sorted DLL to Balanced BST

Convert Binary Tree to DLL in-place
See Convert a given Binary Tree to Doubly Linked List | Set 1, Convert a given Binary Tree to Doubly Linked List | Set 2

Delete a given node in a singly linked list
Given only a pointer to a node to be deleted in a singly linked list, how do you delete it?

Reverse a Linked List
Write a function to reverse a linked list

Detect Loop in a Linked List
Write a C function to detect loop in a linked list.

Allstate Solutions Private Limited ( call based 2016, 2017)

drive date 28-3-2018

Address: RMZ Ecoworld , 7th Floor, Building No. 1, Devarabeesanahalli Village,, Varthur, Hobli, Bengaluru, Karnataka 560103

INTERVIEW REVIEW

***********************************************************
read data structure , dbms

*****************************************************************

****************************************************************************
https://www.glassdoor.co.in/Interview/Allstate-Interview-Questions-E2341.htm
************************************************************

Compare two strings represented as linked lists
Given two linked lists, represented as linked lists (every character is a node in linked list). Write a function compare() that works similar to strcmp(), i.e., it returns 0 if both strings are same, 1 if first linked list is lexicographically greater, and -1 if second string is lexicographically greater.

Examples:

Input: list1 = g->e->e->k->s->a
list2 = g->e->e->k->s->b
Output: -1

Input: list1 = g->e->e->k->s->a
list2 = g->e->e->k->s
Output: 1

Input: list1 = g->e->e->k->s
list2 = g->e->e->k->s
Output: 0

/ Java program to compare two strings represented as a linked list

// Linked List Class
class LinkedList {

Node head; // head of list
static Node a, b;

/* Node Class */
static class Node {

char data;
Node next;

// Constructor to create a new node
Node(char d) {
data = d;
next = null;
}
}

int compare(Node node1, Node node2) {

if (node1 == null && node2 == null) {
return 1;
}
while (node1 != null && node2 != null && node1.data == node2.data) {
node1 = node1.next;
node2 = node2.next;
}

// if the list are diffrent in size
if (node1 != null && node2 != null) {
return (node1.data > node2.data ? 1 : -1);
}

// if either of the list has reached end
if (node1 != null && node2 == null) {
return 1;
}
if (node1 == null && node2 != null) {
return -1;
}
return 0;
}

public static void main(String[] args) {

LinkedList list = new LinkedList();
Node result = null;

list.a = new Node(‘g’);
list.a.next = new Node(‘e’);
list.a.next.next = new Node(‘e’);
list.a.next.next.next = new Node(‘k’);
list.a.next.next.next.next = new Node(‘s’);
list.a.next.next.next.next.next = new Node(‘b’);

list.b = new Node(‘g’);
list.b.next = new Node(‘e’);
list.b.next.next = new Node(‘e’);
list.b.next.next.next = new Node(‘k’);
list.b.next.next.next.next = new Node(‘s’);
list.b.next.next.next.next.next = new Node(‘a’);

int value;
value = list.compare(a, b);
System.out.println(value);

}
}

Union and Intersection of two Linked Lists
Given two Linked Lists, create union and intersection lists that contain union and intersection of the elements present in the given lists. Order of elments in output lists doesn’t matter.

Example:

Input:
List1: 10->15->4->20
lsit2: 8->4->2->10
Output:
Intersection List: 4->10
Union List: 2->8->20->4->15->10

/ Java program to find union and intersection of two unsorted
// linked lists
class LinkedList
{
Node head; // head of list

/* Linked list Node*/
class Node
{
int data;
Node next;
Node(int d)
{
data = d;
next = null;
}
}

/* Function to get Union of 2 Linked Lists */
void getUnion(Node head1, Node head2)
{
Node t1 = head1, t2 = head2;

//insert all elements of list1 in the result
while (t1 != null)
{
push(t1.data);
t1 = t1.next;
}

// insert those elements of list2 that are not present
while (t2 != null)
{
if (!isPresent(head, t2.data))
push(t2.data);
t2 = t2.next;
}
}

void getIntersection(Node head1, Node head2)
{
Node result = null;
Node t1 = head1;

// Traverse list1 and search each element of it in list2.
// If the element is present in list 2, then insert the
// element to result
while (t1 != null)
{
if (isPresent(head2, t1.data))
push(t1.data);
t1 = t1.next;
}
}

/* Utility function to print list */
void printList()
{
Node temp = head;
while(temp != null)
{
System.out.print(temp.data+” “);
temp = temp.next;
}
System.out.println();
}

/* Inserts a node at start of linked list */
void push(int new_data)
{
/* 1 & 2: Allocate the Node &
Put in the data*/
Node new_node = new Node(new_data);

/* 3. Make next of new Node as head */
new_node.next = head;

/* 4. Move the head to point to new Node */
head = new_node;
}

/* A utilty function that returns true if data is present
in linked list else return false */
boolean isPresent (Node head, int data)
{
Node t = head;
while (t != null)
{
if (t.data == data)
return true;
t = t.next;
}
return false;
}

/* Drier program to test above functions */
public static void main(String args[])
{
LinkedList llist1 = new LinkedList();
LinkedList llist2 = new LinkedList();
LinkedList unin = new LinkedList();
LinkedList intersecn = new LinkedList();

/*create a linked lits 10->15->5->20 */
llist1.push(20);
llist1.push(4);
llist1.push(15);
llist1.push(10);

/*create a linked lits 8->4->2->10 */
llist2.push(10);
llist2.push(2);
llist2.push(4);
llist2.push(8);

intersecn.getIntersection(llist1.head, llist2.head);
unin.getUnion(llist1.head, llist2.head);

System.out.println(“First List is”);
llist1.printList();

System.out.println(“Second List is”);
llist2.printList();

System.out.println(“Intersection List is”);
intersecn.printList();

System.out.println(“Union List is”);
unin.printList();
}

Dynamic Programming | Set 4 (Longest Common Subsequence)
We have discussed Overlapping Subproblems and Optimal Substructure properties in Set 1 and Set 2 respectively. We also discussed one example problem in Set 3. Let us discuss Longest Common Subsequence (LCS) problem as one more example problem that can be solved using Dynamic Programming.

LCS Problem Statement: Given two sequences, find the length of longest subsequence present in both of them. A subsequence is a sequence that appears in the same relative order, but not necessarily contiguous. For example, “abc”, “abg”, “bdf”, “aeg”, ‘”acefg”, .. etc are subsequences of “abcdefg”. So a string of length n has 2^n different possible subsequences.

It is a classic computer science problem, the basis of diff (a file comparison program that outputs the differences between two files), and has applications in bioinformatics.

Examples:
LCS for input Sequences “ABCDGH” and “AEDFHR” is “ADH” of length 3.
LCS for input Sequences “AGGTAB” and “GXTXAYB” is “GTAB” of length 4.

1) Optimal Substructure:
Let the input sequences be X[0..m-1] and Y[0..n-1] of lengths m and n respectively. And let L(X[0..m-1], Y[0..n-1]) be the length of LCS of the two sequences X and Y. Following is the recursive definition of L(X[0..m-1], Y[0..n-1]).

If last characters of both sequences match (or X[m-1] == Y[n-1]) then
L(X[0..m-1], Y[0..n-1]) = 1 + L(X[0..m-2], Y[0..n-2])

If last characters of both sequences do not match (or X[m-1] != Y[n-1]) then
L(X[0..m-1], Y[0..n-1]) = MAX ( L(X[0..m-2], Y[0..n-1]), L(X[0..m-1], Y[0..n-2])

Examples:
1) Consider the input strings “AGGTAB” and “GXTXAYB”. Last characters match for the strings. So length of LCS can be written as:
L(“AGGTAB”, “GXTXAYB”) = 1 + L(“AGGTA”, “GXTXAY”)

2) Overlapping Subproblems:
Following is simple recursive implementation of the LCS problem. The implementation simply follows the recursive structure mentioned above.

/* A Naive recursive implementation of LCS problem in java*/
public class LongestCommonSubsequence
{

/* Returns length of LCS for X[0..m-1], Y[0..n-1] */
int lcs( char[] X, char[] Y, int m, int n )
{
if (m == 0 || n == 0)
return 0;
if (X[m-1] == Y[n-1])
return 1 + lcs(X, Y, m-1, n-1);
else
return max(lcs(X, Y, m, n-1), lcs(X, Y, m-1, n));
}

/* Utility function to get max of 2 integers */
int max(int a, int b)
{
return (a > b)? a : b;
}

public static void main(String[] args)
{
LongestCommonSubsequence lcs = new LongestCommonSubsequence();
String s1 = “AGGTAB”;
String s2 = “GXTXAYB”;

char[] X=s1.toCharArray();
char[] Y=s2.toCharArray();
int m = X.length;
int n = Y.length;

System.out.println(“Length of LCS is” + ” ” +
lcs.lcs( X, Y, m, n ) );
}

}

When is a binary search best applied?

A binary search is an algorithm that is best applied to search a list when the elements are already in order or sorted. The list is searched starting in the middle, such that if that middle value is not the target search key, it will check to see if it will continue the search on the lower half of the list or the higher half. The split and search will then continue in the same manner.

4) What is a linked list?

A linked list is a sequence of nodes in which each node is connected to the node following it. This forms a chain-like link for data storage.

5) How do you reference all the elements in a one-dimension array?

To reference all the elements in a one -dimension array, you need to use an indexed loop, So that, the counter runs from 0 to the array size minus one. In this manner, You can reference all the elements in sequence by using the loop counter as the array subscript.

6) In what areas do data structures are applied?

Data structures are essential in almost every aspect where data is involved. In general, algorithms that involve efficient data structure is applied in the following areas: numerical analysis, operating system, A.I., compiler design, database management, graphics, and statistical analysis, to name a few.

7) What is LIFO?

LIFO is a short form of Last In First Out. It refers how data is accessed, stored and retrieved. Using this scheme, data that was stored last should be the one to be extracted first. This also means that in order to gain access to the first data, all the other data that was stored before this first data must first be retrieved and extracted.

8 ) What is a queue?

A queue is a data structure that can simulate a list or stream of data. In this structure, new elements are inserted at one end, and existing elements are removed from the other end.

9) What are binary trees?

A binary tree is one type of data structure that has two nodes, a left node, and a right node. In programming, binary trees are an extension of the linked list structures.

10) Which data structures are applied when dealing with a recursive function?

Recursion, is a function that calls itself based on a terminating condition, makes use of the stack. Using LIFO, a call to a recursive function saves the return address so that it knows how to return to the calling function after the call terminates.

11) What is a stack?

A stack is a data structure in which only the top element can be accessed. As data is stored in the stack, each data is pushed downward, leaving the most recently added data on top.

12) Explain Binary Search Tree

A binary search tree stores data in such a way that they can be retrieved very efficiently. The left subtree contains nodes whose keys are less than the node’s key value, while the right subtree contains nodes whose keys are greater than or equal to the node’s key value. Moreover, both subtrees are also binary search trees.

13) What are multidimensional arrays?

Multidimensional arrays make use of multiple indexes to store data. It is useful when storing data that cannot be represented using single dimensional indexing, such as data representation in a board game, tables with data stored in more than one column.

14) Are linked lists considered linear or non-linear data structures?

It depends on where you intend to apply linked lists. If you based it on storage, a linked list is considered non-linear. On the other hand, if you based it on access strategies, then a linked list is considered linear.

15) How does dynamic memory allocation help in managing data?

Apart from being able to store simple structured data types, dynamic memory allocation can combine separately allocated structured blocks to form composite structures that expand and contract as needed.

16) What is FIFO?

FIFO stands for First-in, First-out, and is used to represent how data is accessed in a queue. Data has been inserted into the queue list the longest is the one that is removed first.

17) What is an ordered list?

An ordered list is a list in which each node’s position in the list is determined by the value of its key component, so that the key values form an increasing sequence, as the list is traversed.

18) What is merge sort?

Merge sort, is a divide-and-conquer approach for sorting the data. In a sequence of data, adjacent ones are merged and sorted to create bigger sorted lists. These sorted lists are then merged again to form an even bigger sorted list, which continues until you have one single sorted list.

19) Differentiate NULL and VOID

Null is a value, whereas Void is a data type identifier. A variable that is given a Null value indicates an empty value. The void is used to identify pointers as having no initial size.

20) What is the primary advantage of a linked list?

A linked list is an ideal data structure because it can be modified easily. This means that editing a linked list works regardless of how many elements are in the list.

21) What is the difference between a PUSH and a POP?

Pushing and popping applies to the way data is stored and retrieved in a stack. A push denotes data being added to it, meaning data is being “pushed” into the stack. On the other hand, a pop denotes data retrieval, and in particular, refers to the topmost data being accessed.

22) What is a linear search?

A linear search refers to the way a target key is being searched in a sequential data structure. In this method, each element in the list is checked and compared against the target key. The process is repeated until found or if the end of the file has been reached.

23) How does variable declaration affect memory allocation?

The amount of memory to be allocated or reserved would depend on the data type of the variable being declared. For example, if a variable is declared to be of integer type, then 32 bits of memory storage will be reserved for that variable.

24) What is the advantage of the heap over a stack?

The heap is more flexible than the stack. That’s because memory space for the heap can be dynamically allocated and de-allocated as needed. However, the memory of the heap can at times be slower when compared to that stack.

25) What is a postfix expression?

A postfix expression is an expression in which each operator follows its operands. The advantage of this form is that there is no need to group sub-expressions in parentheses or to consider operator precedence.

26) What is Data abstraction?

Data abstraction is a powerful tool for breaking down complex data problems into manageable chunks. This is applied by initially specifying the data objects involved and the operations to be performed on these data objects without being overly concerned with how the data objects will be represented and stored in memory.

27) How do you insert a new item in a binary search tree?

Assuming that the data to be inserted is a unique value (that is, not an existing entry in the tree), check first if the tree is empty. If it’s empty, just insert the new item in the root node. If it’s not empty, refer to the new item’s key. If it’s smaller than the root’s key, insert it into the root’s left subtree, otherwise, insert it into the root’s right subtree.

28) How does a selection sort work for an array?

The selection sort is a fairly intuitive sorting algorithm, though not necessarily efficient. In this process, the smallest element is first located and switched with the element at subscript zero, thereby placing the smallest element in the first position.

The smallest element remaining in the subarray is then located next to subscripts 1 through n-1 and switched with the element at subscript 1, thereby placing the second smallest element in the second position. The steps are repeated in the same manner till the last element.

29) How do signed and unsigned numbers affect memory?

In the case of signed numbers, the first bit is used to indicate whether positive or negative, which leaves you with one bit short. With unsigned numbers, you have all bits available for that number. The effect is best seen in the number range (an unsigned 8-bit number has a range 0-255, while the 8-bit signed number has a range -128 to +127

*******************************************************************************************************************
Physical Level: At physical level, the information about location of database objects in data store is kept. Various users are DBMS are unaware about the locations of these objects.

Conceptual Level: At conceptual level, data is represented in the form of various database tables. For Example, STUDENT database may contain STUDENT and COURSE tables which will be visible to users but users are unaware about their storage.

External Level: An external level specifies a view of the data in terms of conceptual level tables. Each external level view is used to cater the needs of a particular category of users. For Example, FACULTY of a university is interested in looking course details of students, STUDENTS are interested in looking all details related to academics, accounts, courses and hostel details as well. So, different views can be generated for different users.

Data Independence

Data independence means change of data at one level should not affect another level. Two types of data independence are required in this architecture:

Physical Data Independence: Any change in physical location of tables and indexes should not affect conceptual level or external view of data. This data independence is easy to achieve and implemented by most of the DBMS.

Conceptual Data Independence: The data at conceptual level schema and external level schema must be independent. This means, change in conceptual schema should not affect external schema. e.g.; Adding or deleting attributes of a table should not affect the user’s view of table. But this type of independence is difficult to achieve as compared to physical data independence because the changes in conceptual schema are reflected in user’s view.

Phases of database design

Database designing for a real world application starts from capturing the requirements to physical implementation using DBMS software which consists of following steps shown in Figure 2.

Conceptual Design: The requirements of database are captured using high level conceptual data model. For Example, ER model is used for conceptual design of database.

Logical Design: Logical Design represents data in the form of relational model. ER diagram produced in conceptual design phase is used to convert the data into Relational Model.

Physical Design: In physical design, data in relational model is implemented using commercial DBMS like Oracle, DB2.phases-of-db
Figure 2
Advantages of DBMS

DBMS helps in efficient organization of data in database which has following advantages over typical file system.

Minimized redundancy and data consistency: Data is normalized in DBMS to minimize the redundancy which helps in keeping data consistent. For Example, student information can be kept at one place in DBMS and accessed by different users.
Simplified Data Access: A user need only name of the relation not exact location to access data, so the process is very simple.
Multiple data views: Different views of same data can be created to cater the needs of different users. For Example, faculty salary information can be hidden from student view of data but shown in admin view.
Data Security: Only authorized users are allowed to access the data in DBMS. Also, data can be encrypted by DBMS which makes it secure.
Concurrent access to data: Data can be accessed concurrently by different users at same time in DBMS.
Backup and Recovery mechanism: DBMS backup and recovery mechanism helps to avoid data loss and data inconsistency in case of catastrophic failures.

OPEN WALKIN OPENWALKIN

Ahana Systems and Solutions Pvt. Ltd (OPEN WALKIN FOR 2016, 2017 BATCH)

JAVA DEVELOPEMENT

28 MARCH TO 29 MARCH

Address: # 202 & 203 Anand Chambers, 14th Cross ElephantRock Road, South End Circle, Bengaluru, Karnataka 560011

*******************************************************
INTERVIEW QUESTION
*********************************************************

Time and Distance
Time and Work
Compound Interest
Partnership
Problems on Ages
Clock
Area
Permutation and Combination
Problems on Numbers
Decimal Fraction

A and B invest in a business in the ratio 3 : 2. If 5% of the total profit goes to charity and A’s share is Rs. 855, the total profit is:

A. Rs. 1425
B. Rs. 1500
C. Rs. 1537.50
D. Rs. 1576
View Answer Discuss in Forum Workspace Report
2.
A, B and C jointly thought of engaging themselves in a business venture. It was agreed that A would invest Rs. 6500 for 6 months, B, Rs. 8400 for 5 months and C, Rs. 10,000 for 3 months. A wants to be the working member for which, he was to receive 5% of the profits. The profit earned was Rs. 7400. Calculate the share of B in the profit.

A. Rs. 1900
B. Rs. 2660
C. Rs. 2800
D. Rs. 2840
View Answer Discuss in Forum Workspace Report
3.
A, B and C enter into a partnership in the ratio : : . After 4 months, A increases his share 50%. If the total profit at the end of one year be Rs. 21,600, then B’s share in the profit is:

A. Rs. 2100
B. Rs. 2400
C. Rs. 3600
D. Rs. 4000
View Answer Discuss in Forum Workspace Report
4.
A, B, C subscribe Rs. 50,000 for a business. A subscribes Rs. 4000 more than B and B Rs. 5000 more than C. Out of a total profit of Rs. 35,000, A receives:

A. Rs. 8400
B. Rs. 11,900
C. Rs. 13,600
D. Rs. 14,700
View Answer Discuss in Forum Workspace Report
5.
Three partners shared the profit in a business in the ratio 5 : 7 : 8. They had partnered for 14 months, 8 months and 7 months respectively. What was the ratio of their investments?

A. 5 : 7 : 8
B. 20 : 49 : 64
C. 38 : 28 : 21
D. None of these

A starts business with Rs. 3500 and after 5 months, B joins with A as his partner. After a year, the profit is divided in the ratio 2 : 3. What is B’s contribution in the capital?

A. Rs. 7500
B. Rs. 8000
C. Rs. 8500
D. Rs. 9000
View Answer Discuss in Forum Workspace Report
7.
A and B entered into partnership with capitals in the ratio 4 : 5. After 3 months, A withdrew of his capital and B withdrew of his capital. The gain at the end of 10 months was Rs. 760. A’s share in this profit is:

A. Rs. 330
B. Rs. 360
C. Rs. 380
D. Rs. 430
View Answer Discuss in Forum Workspace Report
8.
A and B started a partnership business investing some amount in the ratio of 3 : 5. C joined then after six months with an amount equal to that of B. In what proportion should the profit at the end of one year be distributed among A, B and C?

A. 3 : 5 : 2
B. 3 : 5 : 5
C. 6 : 10 : 5
D. Data inadequate

A, B, C rent a pasture. A puts 10 oxen for 7 months, B puts 12 oxen for 5 months and C puts 15 oxen for 3 months for grazing. If the rent of the pasture is Rs. 175, how much must C pay as his share of rent?

A. Rs. 45
B. Rs. 50
C. Rs. 55
D. Rs. 60
View Answer Discuss in Forum Workspace Report
10.
A and B started a business in partnership investing Rs. 20,000 and Rs. 15,000 respectively. After six months, C joined them with Rs. 20,000. What will be B’s share in total profit of Rs. 25,000 earned at the end of 2 years from the starting of the business?

A. Rs. 7500
B. Rs. 9000
C. Rs. 9500
D. Rs. 10,000
A began a business with Rs. 85,000. He was joined afterwards by B with Rs. 42,500. For how much period does B join, if the profits at the end of the year are divided in the ratio of 3 : 1?

A. 4 months
B. 5 months
C. 6 months
D. 8 months
View Answer Discuss in Forum Workspace Report
12.
Aman started a business investing Rs. 70,000. Rakhi joined him after six months with an amount of Rs.. 1,05,000 and Sagar joined them with Rs. 1.4 lakhs after another six months. The amount of profit earned should be distributed in what ratio among Aman, Rakhi and Sagar respectively, 3 years after Aman started the business?

A. 7 : 6 : 10
B. 12 : 15 : 16
C. 42 : 45 : 56
D. Cannot be determined

The sum of ages of 5 children born at the intervals of 3 years each is 50 years. What is the age of the youngest child?

A. 4 years
B. 8 years
C. 10 years
D. None of these
View Answer Discuss in Forum Workspace Report
3.
A father said to his son, “I was as old as you are at the present at the time of your birth”. If the father’s age is 38 years now, the son’s age five years back was:

A. 14 years
B. 19 years
C. 33 years
D. 38 years
View Answer Discuss in Forum Workspace Report
4.
A is two years older than B who is twice as old as C. If the total of the ages of A, B and C be 27, the how old is B?

A. 7
B. 8
C. 9
D. 10
E. 11
View Answer Discuss in Forum Workspace Report
5.
Present ages of Sameer and Anand are in the ratio of 5 : 4 respectively. Three years hence, the ratio of their ages will become 11 : 9 respectively. What is Anand’s present age in years?

A. 24
B. 27
C. 40
D. Cannot be determined
E. None of these

JAVA ,DBMS INTERVIEW QUESTION
******************************************

How to reverse Singly Linked List?
Find out duplicate number between 1 to N numbers.
Find out middle index where sum of both ends are equal.
Write a singleton class.
Write a program to create deadlock between two threads.
Write a program to reverse a string using recursive algorithm.
Write a program to reverse a number.
Write a program to convert decimal number to binary format.
Write a program to find perfect number or not.
Write a program to implement ArrayList.
Write a program to find maximum repeated words from a file.
Wrie a program to find out duplicate characters in a string.
Write a program to find top two maximum numbers in a array.
Write a program to sort a map by value.
Write a program to find common elements between two arrays.
How to swap two numbers without using temporary variable?
Write a program to print fibonacci series.
Write a program to find sum of each digit in the given number using recursion.
Write a program to check the given number is a prime number or not?
Write a program to find the given number is Armstrong number or not?
Write a program to convert binary to decimal number.
Write a program to check the given number is binary number or not?
Write a program for Bubble Sort in java.
Write a program for Insertion Sort in java.
Write a program to implement hashcode and equals.
How to get distinct elements from an array by avoiding duplicate elements?
Write a program to get distinct word list from the given file.
Write a program to get a line with max word count from the given file.
Write a program to convert string to number without using Integer.parseInt() method.
Write a program to find two lines with max characters in descending order.
Write a program to find the sum of the first 1000 prime numbers.
Find longest substring without repeating characters.
Write a program to remove duplicates from sorted array.
How to sort a Stack using a temporary Stack?
Write a program to print all permutations of a given string.
Implement Binary Search Tree (BST)
Find min and max value from Binary Search Tree (BST)
Find height of a Binary Search Tree (BST)
Implement Binary Search Tree (BST) Level order traversal (breadth first).
Implement Binary Search Tree (BST) pre-order traversal (depth first).
Implement Binary Search Tree (BST) in-order traversal (depth first).
Implement Binary Search Tree (BST) post-order traversal (depth first).
******************************************************************************
*************************************************
DBMS INTERVIEW

***************************************************

Commonly asked DBMS interview questions | Set 1
What are advantages of DBMS over traditional file based systems?
Ans: Database management systems were developed to handle the following difficulties of typical file-processing systems supported by conventional operating systems.
1. Data redundancy and inconsistency
2. Difficulty in accessing data
3. Data isolation – multiple files and formats
4. Integrity problems
5. Atomicity of updates
6. Concurrent access by multiple users
7. Security problems
Source: http://cs.nyu.edu/courses/spring01/G22.2433-001/mod1.2.pdf

What are super, primary, candidate and foreign keys?
Ans: A superkey is a set of attributes of a relation schema upon which all attributes of the schema are functionally dependent. No two rows can have the same value of super key attributes.
A Candidate key is minimal superkey, i.e., no proper subset of Candidate key attributes can be a superkey.
A Primary Key is one of the candidate keys. One of the candidate keys is selected as most important and becomes the primary key. There cannot be more that one primary keys in a table.
Foreign key is a field (or collection of fields) in one table that uniquely identifies a row of another table. See this for an example.

What is the difference between primary key and unique constraints?
Ans: Primary key cannot have NULL value, the unique constraints can have NULL values. There is only one primary key in a table, but there can be multiple unique constrains.

What is database normalization?
Ans: It is a process of analyzing the given relation schemas based on their functional dependencies and primary keys to achieve the following desirable properties:
1) Minimizing Redundancy
2) Minimizing the Insertion, Deletion, And Update Anomalies
Relation schemas that do not meet the properties are decomposed into smaller relation schemas that could meet desirable properties.
Source: http://cs.tsu.edu/ghemri/CS346/ClassNotes/Normalization.pdf

What is SQL?
SQL is Structured Query Language designed for inserting and modifying in a relational database system.

What are the differences between DDL, DML and DCL in SQL?
Ans: Following are some details of three.
DDL stands for Data Definition Language. SQL queries like CREATE, ALTER, DROP and RENAME come under this.
DML stands for Data Manipulation Language. SQL queries like SELECT, INSERT and UPDATE come under this.
DCL stands for Data Control Language. SQL queries like GRANT and REVOKE come under this.

What is the difference between having and where clause?
Ans: HAVING is used to specify a condition for a group or an aggregate function used in select statement. The WHERE clause selects before grouping. The HAVING clause selects rows after grouping. Unlike HAVING clause, the WHERE clause cannot contain aggregate functions. (See this for examples).
See Having vs Where Clause? for more details

How to print duplicate rows in a table?
Ans: See http://quiz.geeksforgeeks.org/how-to-print-duplicate-rows-in-a-table/

What is Join?
Ans: An SQL Join is used to combine data from two or more tables, based on a common field between them. For example, consider the following two tables.

Student Table

ENROLLNO STUDENTNAME ADDRESS
1000 geek1 geeksquiz1
1001 geek2 geeksquiz2
1002 geek3 geeksquiz3
StudentCourse Table

COURSEID ENROLLNO
1 1000
2 1000
3 1000
1 1002
2 1003
Following is join query that shows names of students enrolled in different courseIDs.

SELECT StudentCourse.CourseID, Student.StudentName
FROM StudentCourse
INNER JOIN Customers
ON StudentCourse.EnrollNo = Student.EnrollNo
ORDER BY StudentCourse.CourseID;
The above query would produce following result.

COURSEID STUDENTNAME
1 geek1
1 geek2
2 geek1
2 geek3
3 geek1

What is Identity?
Ans: Identity (or AutoNumber) is a column that automatically generates numeric values. A start and increment value can be set, but most DBA leave these at 1. A GUID column also generates numbers; the value of this cannot be controlled. Identity/GUID columns do not need to be indexed.

What is a view in SQL? How to create one
Ans: A view is a virtual table based on the result-set of an SQL statement. We can create using create view syntax.

CREATE VIEW view_name AS
SELECT column_name(s)
FROM table_name
WHERE condition

What are the uses of view?
1. Views can represent a subset of the data contained in a table; consequently, a view can limit the degree of exposure of the underlying tables to the outer world: a given user may have permission to query the view, while denied access to the rest of the base table.
2. Views can join and simplify multiple tables into a single virtual table
3. Views can act as aggregated tables, where the database engine aggregates data (sum, average etc.) and presents the calculated results as part of the data
4. Views can hide the complexity of data; for example a view could appear as Sales2000 or Sales2001, transparently partitioning the actual underlying table
5. Views take very little space to store; the database contains only the definition of a view, not a copy of all the data which it presentsv.
6. Depending on the SQL engine used, views can provide extra security
Source: Wiki Page

What is a Trigger?
Ans: A Trigger is a code that associated with insert, update or delete operations. The code is executed automatically whenever the associated query is executed on a table. Triggers can be useful to maintain integrity in database.

What is a stored procedure?
Ans: A stored procedure is like a function that contains a set of operations compiled together. It contains a set of operations that are commonly used in an application to do some common database tasks.

What is the difference between Trigger and Stored Procedure?
Ans: Unlike Stored Procedures, Triggers cannot be called directly. They can only be associated with queries.

What is a transaction? What are ACID properties?
Ans: A Database Transaction is a set of database operations that must be treated as whole, means either all operations are executed or none of them.
An example can be bank transaction from one account to another account. Either both debit and credit operations must be executed or none of them.
ACID (Atomicity, Consistency, Isolation, Durability) is a set of properties that guarantee that database transactions are processed reliably.

What are indexes?
Ans: A database index is a data structure that improves the speed of data retrieval operations on a database table at the cost of additional writes and the use of more storage space to maintain the extra copy of data.
Data can be stored only in one order on disk. To support faster access according to different values, faster search like binary search for different values is desired, For this purpose, indexes are created on tables. These indexes need extra space on disk, but they allow faster search according to different frequently searched values.

What are clustered and non-clustered Indexes?
Ans: Clustered indexes is the index according to which data is physically stored on disk. Therefore, only one clustered index can be created on a given database table.
Non-clustered indexes don’t define physical ordering of data, but logical ordering. Typically, a tree is created whose leaf point to disk records. B-Tree or B+ tree are used for this purpos

THIDFF TECHNOLOGIES ( CALL BASED 2016, 2017 BATCH )

********************************************************************
ONLY THOSE GOT CALL FROM COMPANY FOR INTERVIEW

***************************************************************************
DATE   28-3-2018

DEVELOPER
Address: 6th Floor, B – Block, Uma Sree Dream World, Kudlu Gate Junction, Hosur Road, Bengaluru, Karnataka 560068

************************************************************************************

https://www.glassdoor.co.in/Overview/Working-at-ThiDiff-Technologies-EI_IE910803.11,31.htm
*********************************************************************************************
*****************************************************************************************

Basic Java Interview Questions
Q1. Explain JVM, JRE and JDK?
JVM (Java Virtual Machine): It is an abstract machine. It is a specification that provides run-time environment in which java bytecode can be executed. It follows three notations:

Specification: It is a document that describes the implementation of the Java virtual machine. It is provided by Sun and other companies.
Implementation: It is a program that meets the requirements of JVM specification.
Runtime Instance: An instance of JVM is created whenever you write a java command on the command prompt and run the class.
JRE (Java Runtime Environment) : JRE refers to a runtime environment in which java bytecode can be executed. It implements the JVM (Java Virtual Machine) and provides all the class libraries and other support files that JVM uses at runtime. So JRE is a software package that contains what is required to run a Java program. Basically, it’s an implementation of the JVM which physically exists.

JDK(Java Development Kit) : It is the tool necessary to compile, document and package Java programs. The JDK completely includes JRE which contains tools for Java programmers. The Java Development Kit is provided free of charge. Along with JRE, it includes an interpreter/loader, a compiler (javac), an archiver (jar), a documentation generator (javadoc) and other tools needed in Java development. In short, it contains JRE + development tools.

Refer to this below image and understand how exactly these components reside:

Components – Java Interview Questions – Edureka

Q2. Explain public static void main(String args[]).
public : Public is an access modifier, which is used to specify who can access this method. Public means that this Method will be accessible by any Class.
static : It is a keyword in java which identifies it is class based i.e it can be accessed without creating the instance of a Class.

void : It is the return type of the method. Void defines the method which will not return any value.

main: It is the name of the method which is searched by JVM as a starting point for an application with a particular signature only. It is the method where the main execution occurs.

String args[] : It is the parameter passed to the main method.

Q3. Why Java is platform independent?
Platform independent practically means “write once run anywhere”. Java is called so because of its byte codes which can run on any system irrespective of its underlying operating system.

Q4. Why java is not 100% Object-oriented?
Java is not 100% Object-oriented because it makes use of eight primitive datatypes such as boolean, byte, char, int, float, double, long, short which are not objects.

Q5. What are wrapper classes?
Wrapper classes converts the java primitives into the reference types (objects). Every primitive data type has a class dedicated to it. These are known as wrapper classes because they “wrap” the primitive data type into an object of that class. Refer to the below image which displays different primitive type, wrapper class and constructor argument.

WrapperClass – Java Interview Questions – Edureka

Q6. What are constructors in Java?
In Java, constructor refers to a block of code which is used to initialize an object. It must have the same name as that of the class. Also, it has no return type and it is automatically called when an object is created.

There are two types of constructors:

Default constructor
Parameterized constructor
Q7. What is singleton class and how can we make a class singleton?
Singleton class is a class whose only one instance can be created at any given time, in one JVM. A class can be made singleton by making its constructor private.

Q8. What is the difference between Array list and vector?
Array List Vector
Array List is not synchronized. Vector is synchronized.
Array List is fast as it’s non-synchronized. Vector is slow as it is thread safe.
If an element is inserted into the Array List, it increases its Array size by 50%. Vector defaults to doubling size of its array.
Array List does not define the increment size. Vector defines the increment size.
Array List can only use Iterator for traversing an Array List. Except Hashtable, Vector is the only other class which uses both Enumeration and Iterator.
Q9. What is the difference between equals() and == ?
Equals() method is defined in Object class in Java and used for checking equality of two objects defined by business logic.
“==” or equality operator in Java is a binary operator provided by Java programming language and used to compare primitives and objects. public boolean equals(Object o) is the method provided by the Object class. The default implementation uses == operator to compare two objects. For example: method can be overridden like String class. equals() method is used to compare the values of two objects.

public class Equaltest {
public static void main(String[] args) {
String str1= new String(“ABCD”);
String str2= new String(“ABCD”);
if(Str1 == str2)
{
System.out.println(“String 1 == String 2 is true”);
}
else
{
System.out.println(“String 1 == String 2 is false”);
String Str3 = Str2;
if( Str2 == Str3)
{
System.out.println(“String 2 == String 3 is true”);
}
else
{
System.out.println(“String 2 == String 3 is false”);
}
if(Str1.equals(str2))
{
System.out.println(“String 1 equals string 2 is true”);
}
else
{
System.out.prinltn(“String 1 equals string 2 is false”);
}
}}
Q10. What are the differences between Heap and Stack Memory?
The major difference between Heap and Stack memory are:

Features Stack Heap
Memory Stack memory is used only by one thread of execution. Heap memory is used by all the parts of the application.
Access Stack memory can’t be accessed by other threads. Objects stored in the heap are globally accessible.
Memory Management Follows LIFO manner to free memory. Memory management is based on generation associated to each object.
Lifetime Exists until the end of execution of the thread. Heap memory lives from the start till the end of application execution.
Usage Stack memory only contains local primitive and reference variables to objects in heap space. Whenever an object is created, it’s always stored in the Heap space.

In case you are facing any challenges with these java interview questions, please comment your problems in the section below. Apart from this Java Interview Questions Blog, if you want to get trained from professionals on this technology, you can opt for a structured training from edureka! Click below to know more.

**********************************************************************************************************************

Commonly Asked Data Structure Interview Questions | Set 1
What is a Data Structure?
A data structure is a way of organizing the data so that the data can be used efficiently. Different kinds of data structures are suited to different kinds of applications, and some are highly specialized to specific tasks. For example, B-trees are particularly well-suited for implementation of databases, while compiler implementations usually use hash tables to look up identifiers. (Source: Wiki Page)

What are linear and non linear data Structures?

Linear: A data structure is said to be linear if its elements form a sequence or a linear list. Examples: Array. Linked List, Stacks and Queues
Non-Linear: A data structure is said to be non-linear if traversal of nodes is nonlinear in nature. Example: Graph and Trees.

What are the various operations that can be performed on different Data Structures?

Insertion − Add a new data item in the given collection of data items.
Deletion − Delete an existing data item from the given collection of data items.
Traversal − Access each data item exactly once so that it can be processed.
Searching − Find out the location of the data item if it exists in the given collection of data items.
Sorting − Arranging the data items in some order i.e. in ascending or descending order in case of numerical data and in dictionary order in case of alphanumeric data.

How is an Array different from Linked List?

The size of the arrays is fixed, Linked Lists are Dynamic in size.
Inserting and deleting a new element in an array of elements is expensive, Whereas both insertion and deletion can easily be done in Linked Lists.
Random access is not allowed in Linked Listed.
Extra memory space for a pointer is required with each element of the Linked list.
Arrays have better cache locality that can make a pretty big difference in performance.

What is Stack and where it can be used?

Stack is a linear data structure which the order LIFO(Last In First Out) or FILO(First In Last Out) for accessing elements. Basic operations of stack are : Push, Pop , Peek

Applications of Stack:

Infix to Postfix Conversion using Stack
Evaluation of Postfix Expression
Reverse a String using Stack
Implement two stacks in an array
Check for balanced parentheses in an expression

What is a Queue, how it is different from stack and how is it implemented?

Queue is a linear structure which follows the order is First In First Out (FIFO) to access elements. Mainly the following are basic operations on queue: Enqueue, Dequeue, Front, Rear
The difference between stacks and queues is in removing. In a stack we remove the item the most recently added; in a queue, we remove the item the least recently added. Both Queues and Stacks can be implemented using Arrays and Linked Lists.

What are Infix, prefix, Postfix notations?

Infix notation: X + Y – Operators are written in-between their operands. This is the usual way we write expressions. An expression such as
A * ( B + C ) / D
Postfix notation (also known as “Reverse Polish notation”): X Y + Operators are written after their operands. The infix expression given above is equivalent to
A B C + * D/
Prefix notation (also known as “Polish notation”): + X Y Operators are written before their operands. The expressions given above are equivalent to
/ * A + B C D
Converting between these notations: Click here

What is a Linked List and What are its types?

A linked list is a linear data structure (like arrays) where each element is a separate object. Each element (that is node) of a list is comprising of two items – the data and a reference to the next node.Types of Linked List :

Singly Linked List : In this type of linked list, every node stores address or reference of next node in list and the last node has next address or reference as NULL. For example 1->2->3->4->NULL
Doubly Linked List : Here, here are two references associated with each node, One of the reference points to the next node and one to the previous node. Eg. NULL<-1<->2<->3->NULL
Circular Linked List : Circular linked list is a linked list where all nodes are connected to form a circle. There is no NULL at the end. A circular linked list can be a singly circular linked list or doubly circular linked list. Eg. 1->2->3->1 [The next pointer of last node is pointing to the first]

Which data structures are used for BFS and DFS of a graph?

Queue is used for BFS
Stack is used for DFS. DFS can also be implemented using recursion (Note that recursion also uses function call stack).

Can doubly linked be implemented using a single pointer variable in every node?
Doubly linked list can be implemented using a single pointer. See XOR Linked List – A Memory Efficient Doubly Linked List

How to implement a stack using queue?

A stack can be implemented using two queues. Let stack to be implemented be ‘s’ and queues used to implement be ‘q1’ and ‘q2’. Stack ‘s’ can be implemented in two ways:

Method 1 (By making push operation costly)
Method 2 (By making pop operation costly) See Implement Stack using Queues

How to implement a queue using stack?

A queue can be implemented using two stacks. Let queue to be implemented be q and stacks used to implement q be stack1 and stack2. q can be implemented in two ways:

Method 1 (By making enQueue operation costly)
Method 2 (By making deQueue operation costly) See Implement Queue using Stacks

Which Data Structure Should be used for implementiong LRU cache?

We use two data structures to implement an LRU Cache.

Queue which is implemented using a doubly linked list. The maximum size of the queue will be equal to the total number of frames available (cache size).The most recently used pages will be near front end and least recently pages will be near rear end.
A Hash with page number as key and address of the corresponding queue node as value. See How to implement LRU caching scheme? What data structures should be used?

How to check if a given Binary Tree is BST or not?
If inorder traversal of a binary tree is sorted, then the binary tree is BST. The idea is to simply do inorder traversal and while traversing keep track of previous key value. If current key value is greater, then continue, else return false. See A program to check if a binary tree is BST or not for more details.

Linked List Questions

Linked List Insertion
Linked List Deletion
middle of a given linked list
Nth node from the end of a Linked List

Tree Traversal Questions

Inorder
Preorder and Postoder Traversals
Level order traversal
Height of Binary Tree

Convert a DLL to Binary Tree in-place
See In-place conversion of Sorted DLL to Balanced BST

Convert Binary Tree to DLL in-place
See Convert a given Binary Tree to Doubly Linked List | Set 1, Convert a given Binary Tree to Doubly Linked List | Set 2

Delete a given node in a singly linked list
Given only a pointer to a node to be deleted in a singly linked list, how do you delete it?

Reverse a Linked List
Write a function to reverse a linked list

Detect Loop in a Linked List
Write a C function to detect loop in a linked list.

Which data structure is used for dictionary and spell checker?
Data Structure for Dictionary and Spell Checker?

Can we Overload or Override static methods in java ?

Overriding : Overriding is related to run-time polymorphism. A subclass (or derived class) provides a specific implementation of a method in superclass (or base class) at runtime.
Overloading: Overloading is related to compile time (or static) polymorphism. This feature allows different methods to have same name, but different signatures, especially number of input parameters and type of input paramaters.
Can we overload static methods? The answer is ‘Yes’. We can have two ore more static methods with same name, but differences in input parameters
Can we Override static methods in java? We can declare static methods with same signature in subclass, but it is not considered overriding as there won’t be any run-time polymorphism. Hence the answer is ‘No’. Static methods cannot be overridden because method overriding only occurs in the context of dynamic (i.e. runtime) lookup of methods. Static methods (by their name) are looked up statically (i.e. at compile-time).
Read more

Why the main method is static in java?
The method is static because otherwise there would be ambiguity: which constructor should be called? Especially if your class looks like this:

public class JavaClass
{
protected JavaClass(int x)
{ }
public void main(String[] args)
{

}
}
Should the JVM call new JavaClass(int)? What should it pass for x? If not, should the JVM instantiate JavaClass without running any constructor method? because that will special-case your entire class – sometimes you have an instance that hasn’t been initialized, and you have to check for it in every method that could be called. There are just too many edge cases and ambiguities for it to make sense for the JVM to have to instantiate a class before the entry point is called. That’s why main is static.

What happens if you remove static modifier from the main method?
Program compiles successfully . But at runtime throws an error “NoSuchMethodError”.

What is the scope of variables in Java in following cases?

Member Variables (Class Level Scope) : The member variables must be declared inside class (outside any function). They can be directly accessed anywhere in class
Local Variables (Method Level Scope) : Variables declared inside a method have method level scope and can’t be accessed outside the method.
Loop Variables (Block Scope) : A variable declared inside pair of brackets “{” and “}” in a method has scope withing the brackets only.
Read more

What is “this” keyword in java?
Within an instance method or a constructor, this is a reference to the current object — the object whose method or constructor is being called. You can refer to any member of the current object from within an instance method or a constructor by using this.
Usage of this keyword

Used to refer current class instance variable.
To invoke current class constructor.
It can be passed as an argument in the method call.
It can be passed as argument in the constructor call.
Used to return the current class instance.
Used to invoke current class method (implicitly)

What is an abstract class? How abstract classes are similar or different in Java from C++?
Abstract classes are classes that contain one or more abstract methods. An abstract method is a method that is declared, but contains no implementation. Abstract classes may not be instantiated, and require subclasses to provide implementations for the abstract methods.

Like C++, in Java, an instance of an abstract class cannot be created, we can have references of abstract class type though.
Like C++, an abstract class can contain constructors in Java. And a constructor of abstract class is called when an instance of a inherited class is created
In Java, we can have an abstract class without any abstract method. This allows us to create classes that cannot be instantiated, but can only be inherited.
Abstract classes can also have final methods (methods that cannot be overridden). For example, the following program compiles and runs fine.
Read more

Which class is the superclass for every class ?
Object class

Can we overload main() method?
The main method in Java is no extra-terrestrial method. Apart from the fact that main() is just like any other method & can be overloaded in a similar manner, JVM always looks for the method signature to launch the program.

The normal main method acts as an entry point for the JVM to start the execution of program.
We can overload the main method in Java. But the program doesn’t execute the overloaded main method when we run your program, we need to call the overloaded main method from the actual main method only.
Read more

What is object cloning?
Object cloning means to create an exact copy of the original object. If a class needs to support cloning, it must implement java.lang.Cloneable interface and override clone() method from Object class. Syntax of the clone() method is :

protected Object clone() throws CloneNotSupportedException
If the object’s class doesn’t implement Cloneable interface then it throws an exception ‘CloneNotSupportedException’ .

Read more

How is inheritance in C++ different from Java?

In Java, all classes inherit from the Object class directly or indirectly. Therefore, there is always a single inheritance tree of classes in Java, and Object class is root of the tree.
In Java, members of the grandparent class are not directly accessible. See this G-Fact for more details.
The meaning of protected member access specifier is somewhat different in Java. In Java, protected members of a class “A” are accessible in other class “B” of same package, even if B doesn’t inherit from A (they both have to be in the same package).
Java uses extends keyword for inheritance. Unlike C++, Java doesn’t provide an inheritance specifier like public, protected or private. Therefore, we cannot change the protection level of members of base class in Java, if some data member is public or protected in base class then it remains public or protected in derived class. Like C++, private members of base class are not accessible in derived class.
Unlike C++, in Java, we don’t have to remember those rules of inheritance which are combination of base class access specifier and inheritance specifier.
In Java, methods are virtual by default. In C++, we explicitly use virtual keyword. See this G-Fact for more details.
Java uses a separate keyword interface for interfaces, and abstract keyword for abstract classes and abstract functions.
Unlike C++, Java doesn’t support multiple inheritance. A class cannot inherit from more than one class. A class can implement multiple interfaces though.
In C++, default constructor of parent class is automatically called, but if we want to call parametrized constructor of a parent class, we must use Initializer list. Like C++, default constructor of the parent class is automatically called in Java, but if we want to call parameterized constructor then we must use super to call the parent constructor.
See examples here

Why method overloading is not possible by changing the return type in java?
In C++ and Java, functions can not be overloaded if they differ only in the return type . The return type of functions is not a part of the mangled name which is generated by the compiler for uniquely identifying each function. The No of arguments, Type of arguments & Sequence of arguments are the parameters which are used to generate the unique mangled name for each function. It is on the basis of these unique mangled names that compiler can understand which function to call even if the names are same(overloading).

Can we override private methods in Java?
No, a private method cannot be overridden since it is not visible from any other class. Read more

What is blank final variable?
A final variable in Java can be assigned a value only once, we can assign a value either in declaration or later.

final int i = 10;
i = 30; // Error because i is final.
A blank final variable in Java is a final variable that is not initialized during declaration. Below is a simple example of blank final.

// A simple blank final example
final int i;
i = 30;
Read more

What is “super” keyword in java?
The super keyword in java is a reference variable that is used to refer parent class objects. The keyword “super” came into the picture with the concept of Inheritance. Whenever you create the instance of subclass, an instance of parent class is created implicitly i.e. referred by super reference variable.
Various scenarios of using java super Keyword:

super is used to refer immediate parent instance variable
super is used to call parent class method
super() is used to call immediate parent constructor
Read more

What is static variable in Java?
The static keyword in java is used for memory management mainly. We can apply java static keyword with variables, methods, blocks and nested class. The static keyword belongs to the class than instance of the class.

The static can be:

variable (also known as class variable)
method (also known as class method)
block
nested class

Differences between HashMap and HashTable in Java.
1. HashMap is non synchronized. It is not-thread safe and can’t be shared between many threads without proper synchronization code whereas Hashtable is synchronized. It is thread-safe and can be shared with many threads.
2. HashMap allows one null key and multiple null values whereas Hashtable doesn’t allow any null key or value.
3. HashMap is generally preferred over HashTable if thread synchronization is not needed
Read more

How are Java objects stored in memory?
In Java, all objects are dynamically allocated on Heap. This is different from C++ where objects can be allocated memory either on Stack or on Heap. In C++, when we allocate abject using new(), the object is allocated on Heap, otherwise on Stack if not global or static.
In Java, when we only declare a variable of a class type, only a reference is created (memory is not allocated for the object). To allocate memory to an object, we must use new(). So the object is always allocated memory on heap. Read more

What are C++ features missing in Java?
Try to answer this on your own before seeing the answer – here.

Cognizant Technology Solutions Pvt Ltd

PROGRAM ANAYLST

DRIVE DATE   31th MARCH 2018
Address: Manayata Tech Park, Nagavara, Bengaluru, Karnataka 560045
**********************************************************************

DOWNLOAD LASTEST INTERVIEW QUESTION WITH SOLVED PAPER

****************************************************************************************

Cognizant Technology Solutions Pvt Ltd QUESTION BY JOBHUNTER TEAM

*****************************************************************************************

CENTURY LINK COMPNAY ( CALL BASED DRIVE 2016, 2017 ONLY THOSE GOT INTERVIEW CALL FROM CENTURY LINK)

******************************************************************************************
ONLY THOSE GOT INTERVIEW CALL FROM CENTURY LINK COMPANY
************************************************************************************

DEVELOPER

DRIVE DATE 27-3-2018

Address: ORR Service Road, Bengaluru, Karnataka 560103

******************************************************************
https://www.glassdoor.co.in/Interview/CenturyLink-Interview-Questions-E248324.htm
*******************************************************************

***************************************************
JAVA , TESTING , DBMS INTERVIEW QUETION
******************************************

How to reverse Singly Linked List?
Find out duplicate number between 1 to N numbers.
Find out middle index where sum of both ends are equal.
Write a singleton class.
Write a program to create deadlock between two threads.
Write a program to reverse a string using recursive algorithm.
Write a program to reverse a number.
Write a program to convert decimal number to binary format.
Write a program to find perfect number or not.
Write a program to implement ArrayList.
Write a program to find maximum repeated words from a file.
Wrie a program to find out duplicate characters in a string.
Write a program to find top two maximum numbers in a array.
Write a program to sort a map by value.
Write a program to find common elements between two arrays.
How to swap two numbers without using temporary variable?
Write a program to print fibonacci series.
Write a program to find sum of each digit in the given number using recursion.
Write a program to check the given number is a prime number or not?
Write a program to find the given number is Armstrong number or not?
Write a program to convert binary to decimal number.
Write a program to check the given number is binary number or not?
Write a program for Bubble Sort in java.
Write a program for Insertion Sort in java.
Write a program to implement hashcode and equals.
How to get distinct elements from an array by avoiding duplicate elements?
Write a program to get distinct word list from the given file.
Write a program to get a line with max word count from the given file.
Write a program to convert string to number without using Integer.parseInt() method.
Write a program to find two lines with max characters in descending order.
Write a program to find the sum of the first 1000 prime numbers.
Find longest substring without repeating characters.
Write a program to remove duplicates from sorted array.
How to sort a Stack using a temporary Stack?
Write a program to print all permutations of a given string.
Implement Binary Search Tree (BST)
Find min and max value from Binary Search Tree (BST)
Find height of a Binary Search Tree (BST)
Implement Binary Search Tree (BST) Level order traversal (breadth first).
Implement Binary Search Tree (BST) pre-order traversal (depth first).
Implement Binary Search Tree (BST) in-order traversal (depth first).
Implement Binary Search Tree (BST) post-order traversal (depth first).
******************************************************************************

Basic Java Interview Questions
Q1. Explain JVM, JRE and JDK?
JVM (Java Virtual Machine): It is an abstract machine. It is a specification that provides run-time environment in which java bytecode can be executed. It follows three notations:

Specification: It is a document that describes the implementation of the Java virtual machine. It is provided by Sun and other companies.
Implementation: It is a program that meets the requirements of JVM specification.
Runtime Instance: An instance of JVM is created whenever you write a java command on the command prompt and run the class.
JRE (Java Runtime Environment) : JRE refers to a runtime environment in which java bytecode can be executed. It implements the JVM (Java Virtual Machine) and provides all the class libraries and other support files that JVM uses at runtime. So JRE is a software package that contains what is required to run a Java program. Basically, it’s an implementation of the JVM which physically exists.

JDK(Java Development Kit) : It is the tool necessary to compile, document and package Java programs. The JDK completely includes JRE which contains tools for Java programmers. The Java Development Kit is provided free of charge. Along with JRE, it includes an interpreter/loader, a compiler (javac), an archiver (jar), a documentation generator (javadoc) and other tools needed in Java development. In short, it contains JRE + development tools.

Refer to this below image and understand how exactly these components reside:

Components – Java Interview Questions – Edureka

Q2. Explain public static void main(String args[]).
public : Public is an access modifier, which is used to specify who can access this method. Public means that this Method will be accessible by any Class.
static : It is a keyword in java which identifies it is class based i.e it can be accessed without creating the instance of a Class.

void : It is the return type of the method. Void defines the method which will not return any value.

main: It is the name of the method which is searched by JVM as a starting point for an application with a particular signature only. It is the method where the main execution occurs.

String args[] : It is the parameter passed to the main method.

Q3. Why Java is platform independent?
Platform independent practically means “write once run anywhere”. Java is called so because of its byte codes which can run on any system irrespective of its underlying operating system.

Q4. Why java is not 100% Object-oriented?
Java is not 100% Object-oriented because it makes use of eight primitive datatypes such as boolean, byte, char, int, float, double, long, short which are not objects.

Q5. What are wrapper classes?
Wrapper classes converts the java primitives into the reference types (objects). Every primitive data type has a class dedicated to it. These are known as wrapper classes because they “wrap” the primitive data type into an object of that class. Refer to the below image which displays different primitive type, wrapper class and constructor argument.

WrapperClass – Java Interview Questions – Edureka

Q6. What are constructors in Java?
In Java, constructor refers to a block of code which is used to initialize an object. It must have the same name as that of the class. Also, it has no return type and it is automatically called when an object is created.

There are two types of constructors:

Default constructor
Parameterized constructor
Q7. What is singleton class and how can we make a class singleton?
Singleton class is a class whose only one instance can be created at any given time, in one JVM. A class can be made singleton by making its constructor private.

Q8. What is the difference between Array list and vector?
Array List Vector
Array List is not synchronized. Vector is synchronized.
Array List is fast as it’s non-synchronized. Vector is slow as it is thread safe.
If an element is inserted into the Array List, it increases its Array size by 50%. Vector defaults to doubling size of its array.
Array List does not define the increment size. Vector defines the increment size.
Array List can only use Iterator for traversing an Array List. Except Hashtable, Vector is the only other class which uses both Enumeration and Iterator.
Q9. What is the difference between equals() and == ?
Equals() method is defined in Object class in Java and used for checking equality of two objects defined by business logic.
“==” or equality operator in Java is a binary operator provided by Java programming language and used to compare primitives and objects. public boolean equals(Object o) is the method provided by the Object class. The default implementation uses == operator to compare two objects. For example: method can be overridden like String class. equals() method is used to compare the values of two objects.

public class Equaltest {
public static void main(String[] args) {
String str1= new String(“ABCD”);
String str2= new String(“ABCD”);
if(Str1 == str2)
{
System.out.println(“String 1 == String 2 is true”);
}
else
{
System.out.println(“String 1 == String 2 is false”);
String Str3 = Str2;
if( Str2 == Str3)
{
System.out.println(“String 2 == String 3 is true”);
}
else
{
System.out.println(“String 2 == String 3 is false”);
}
if(Str1.equals(str2))
{
System.out.println(“String 1 equals string 2 is true”);
}
else
{
System.out.prinltn(“String 1 equals string 2 is false”);
}
}}
Q10. What are the differences between Heap and Stack Memory?
The major difference between Heap and Stack memory are:

Features Stack Heap
Memory Stack memory is used only by one thread of execution. Heap memory is used by all the parts of the application.
Access Stack memory can’t be accessed by other threads. Objects stored in the heap are globally accessible.
Memory Management Follows LIFO manner to free memory. Memory management is based on generation associated to each object.
Lifetime Exists until the end of execution of the thread. Heap memory lives from the start till the end of application execution.
Usage Stack memory only contains local primitive and reference variables to objects in heap space. Whenever an object is created, it’s always stored in the Heap space.

In case you are facing any challenges with these java interview questions, please comment your problems in the section below. Apart from this Java Interview Questions Blog, if you want to get trained from professionals on this technology, you can opt for a structured training from edureka! Click below to know more.

**********************************************************************************************************************

Commonly Asked Data Structure Interview Questions | Set 1
What is a Data Structure?
A data structure is a way of organizing the data so that the data can be used efficiently. Different kinds of data structures are suited to different kinds of applications, and some are highly specialized to specific tasks. For example, B-trees are particularly well-suited for implementation of databases, while compiler implementations usually use hash tables to look up identifiers. (Source: Wiki Page)

What are linear and non linear data Structures?

Linear: A data structure is said to be linear if its elements form a sequence or a linear list. Examples: Array. Linked List, Stacks and Queues
Non-Linear: A data structure is said to be non-linear if traversal of nodes is nonlinear in nature. Example: Graph and Trees.

What are the various operations that can be performed on different Data Structures?

Insertion − Add a new data item in the given collection of data items.
Deletion − Delete an existing data item from the given collection of data items.
Traversal − Access each data item exactly once so that it can be processed.
Searching − Find out the location of the data item if it exists in the given collection of data items.
Sorting − Arranging the data items in some order i.e. in ascending or descending order in case of numerical data and in dictionary order in case of alphanumeric data.

How is an Array different from Linked List?

The size of the arrays is fixed, Linked Lists are Dynamic in size.
Inserting and deleting a new element in an array of elements is expensive, Whereas both insertion and deletion can easily be done in Linked Lists.
Random access is not allowed in Linked Listed.
Extra memory space for a pointer is required with each element of the Linked list.
Arrays have better cache locality that can make a pretty big difference in performance.

What is Stack and where it can be used?

Stack is a linear data structure which the order LIFO(Last In First Out) or FILO(First In Last Out) for accessing elements. Basic operations of stack are : Push, Pop , Peek

Applications of Stack:

Infix to Postfix Conversion using Stack
Evaluation of Postfix Expression
Reverse a String using Stack
Implement two stacks in an array
Check for balanced parentheses in an expression

What is a Queue, how it is different from stack and how is it implemented?

Queue is a linear structure which follows the order is First In First Out (FIFO) to access elements. Mainly the following are basic operations on queue: Enqueue, Dequeue, Front, Rear
The difference between stacks and queues is in removing. In a stack we remove the item the most recently added; in a queue, we remove the item the least recently added. Both Queues and Stacks can be implemented using Arrays and Linked Lists.

What are Infix, prefix, Postfix notations?

Infix notation: X + Y – Operators are written in-between their operands. This is the usual way we write expressions. An expression such as
A * ( B + C ) / D
Postfix notation (also known as “Reverse Polish notation”): X Y + Operators are written after their operands. The infix expression given above is equivalent to
A B C + * D/
Prefix notation (also known as “Polish notation”): + X Y Operators are written before their operands. The expressions given above are equivalent to
/ * A + B C D
Converting between these notations: Click here

What is a Linked List and What are its types?

A linked list is a linear data structure (like arrays) where each element is a separate object. Each element (that is node) of a list is comprising of two items – the data and a reference to the next node.Types of Linked List :

Singly Linked List : In this type of linked list, every node stores address or reference of next node in list and the last node has next address or reference as NULL. For example 1->2->3->4->NULL
Doubly Linked List : Here, here are two references associated with each node, One of the reference points to the next node and one to the previous node. Eg. NULL<-1<->2<->3->NULL
Circular Linked List : Circular linked list is a linked list where all nodes are connected to form a circle. There is no NULL at the end. A circular linked list can be a singly circular linked list or doubly circular linked list. Eg. 1->2->3->1 [The next pointer of last node is pointing to the first]

Which data structures are used for BFS and DFS of a graph?

Queue is used for BFS
Stack is used for DFS. DFS can also be implemented using recursion (Note that recursion also uses function call stack).

Can doubly linked be implemented using a single pointer variable in every node?
Doubly linked list can be implemented using a single pointer. See XOR Linked List – A Memory Efficient Doubly Linked List

How to implement a stack using queue?

A stack can be implemented using two queues. Let stack to be implemented be ‘s’ and queues used to implement be ‘q1’ and ‘q2’. Stack ‘s’ can be implemented in two ways:

Method 1 (By making push operation costly)
Method 2 (By making pop operation costly) See Implement Stack using Queues

How to implement a queue using stack?

A queue can be implemented using two stacks. Let queue to be implemented be q and stacks used to implement q be stack1 and stack2. q can be implemented in two ways:

Method 1 (By making enQueue operation costly)
Method 2 (By making deQueue operation costly) See Implement Queue using Stacks

Which Data Structure Should be used for implementiong LRU cache?

We use two data structures to implement an LRU Cache.

Queue which is implemented using a doubly linked list. The maximum size of the queue will be equal to the total number of frames available (cache size).The most recently used pages will be near front end and least recently pages will be near rear end.
A Hash with page number as key and address of the corresponding queue node as value. See How to implement LRU caching scheme? What data structures should be used?

How to check if a given Binary Tree is BST or not?
If inorder traversal of a binary tree is sorted, then the binary tree is BST. The idea is to simply do inorder traversal and while traversing keep track of previous key value. If current key value is greater, then continue, else return false. See A program to check if a binary tree is BST or not for more details.

Linked List Questions

Linked List Insertion
Linked List Deletion
middle of a given linked list
Nth node from the end of a Linked List

Tree Traversal Questions

Inorder
Preorder and Postoder Traversals
Level order traversal
Height of Binary Tree

Convert a DLL to Binary Tree in-place
See In-place conversion of Sorted DLL to Balanced BST

Convert Binary Tree to DLL in-place
See Convert a given Binary Tree to Doubly Linked List | Set 1, Convert a given Binary Tree to Doubly Linked List | Set 2

Delete a given node in a singly linked list
Given only a pointer to a node to be deleted in a singly linked list, how do you delete it?

Reverse a Linked List
Write a function to reverse a linked list

Detect Loop in a Linked List
Write a C function to detect loop in a linked list.

Which data structure is used for dictionary and spell checker?
Data Structure for Dictionary and Spell Checker?

*************************************************
DBMS INTERVIEW

***************************************************

Commonly asked DBMS interview questions | Set 1
What are advantages of DBMS over traditional file based systems?
Ans: Database management systems were developed to handle the following difficulties of typical file-processing systems supported by conventional operating systems.
1. Data redundancy and inconsistency
2. Difficulty in accessing data
3. Data isolation – multiple files and formats
4. Integrity problems
5. Atomicity of updates
6. Concurrent access by multiple users
7. Security problems
Source: http://cs.nyu.edu/courses/spring01/G22.2433-001/mod1.2.pdf

What are super, primary, candidate and foreign keys?
Ans: A superkey is a set of attributes of a relation schema upon which all attributes of the schema are functionally dependent. No two rows can have the same value of super key attributes.
A Candidate key is minimal superkey, i.e., no proper subset of Candidate key attributes can be a superkey.
A Primary Key is one of the candidate keys. One of the candidate keys is selected as most important and becomes the primary key. There cannot be more that one primary keys in a table.
Foreign key is a field (or collection of fields) in one table that uniquely identifies a row of another table. See this for an example.

What is the difference between primary key and unique constraints?
Ans: Primary key cannot have NULL value, the unique constraints can have NULL values. There is only one primary key in a table, but there can be multiple unique constrains.

What is database normalization?
Ans: It is a process of analyzing the given relation schemas based on their functional dependencies and primary keys to achieve the following desirable properties:
1) Minimizing Redundancy
2) Minimizing the Insertion, Deletion, And Update Anomalies
Relation schemas that do not meet the properties are decomposed into smaller relation schemas that could meet desirable properties.
Source: http://cs.tsu.edu/ghemri/CS346/ClassNotes/Normalization.pdf

What is SQL?
SQL is Structured Query Language designed for inserting and modifying in a relational database system.

What are the differences between DDL, DML and DCL in SQL?
Ans: Following are some details of three.
DDL stands for Data Definition Language. SQL queries like CREATE, ALTER, DROP and RENAME come under this.
DML stands for Data Manipulation Language. SQL queries like SELECT, INSERT and UPDATE come under this.
DCL stands for Data Control Language. SQL queries like GRANT and REVOKE come under this.

What is the difference between having and where clause?
Ans: HAVING is used to specify a condition for a group or an aggregate function used in select statement. The WHERE clause selects before grouping. The HAVING clause selects rows after grouping. Unlike HAVING clause, the WHERE clause cannot contain aggregate functions. (See this for examples).
See Having vs Where Clause? for more details

How to print duplicate rows in a table?
Ans: See http://quiz.geeksforgeeks.org/how-to-print-duplicate-rows-in-a-table/

What is Join?
Ans: An SQL Join is used to combine data from two or more tables, based on a common field between them. For example, consider the following two tables.

Student Table

ENROLLNO STUDENTNAME ADDRESS
1000 geek1 geeksquiz1
1001 geek2 geeksquiz2
1002 geek3 geeksquiz3
StudentCourse Table

COURSEID ENROLLNO
1 1000
2 1000
3 1000
1 1002
2 1003
Following is join query that shows names of students enrolled in different courseIDs.

SELECT StudentCourse.CourseID, Student.StudentName
FROM StudentCourse
INNER JOIN Customers
ON StudentCourse.EnrollNo = Student.EnrollNo
ORDER BY StudentCourse.CourseID;
The above query would produce following result.

COURSEID STUDENTNAME
1 geek1
1 geek2
2 geek1
2 geek3
3 geek1

What is Identity?
Ans: Identity (or AutoNumber) is a column that automatically generates numeric values. A start and increment value can be set, but most DBA leave these at 1. A GUID column also generates numbers; the value of this cannot be controlled. Identity/GUID columns do not need to be indexed.

What is a view in SQL? How to create one
Ans: A view is a virtual table based on the result-set of an SQL statement. We can create using create view syntax.

CREATE VIEW view_name AS
SELECT column_name(s)
FROM table_name
WHERE condition

What are the uses of view?
1. Views can represent a subset of the data contained in a table; consequently, a view can limit the degree of exposure of the underlying tables to the outer world: a given user may have permission to query the view, while denied access to the rest of the base table.
2. Views can join and simplify multiple tables into a single virtual table
3. Views can act as aggregated tables, where the database engine aggregates data (sum, average etc.) and presents the calculated results as part of the data
4. Views can hide the complexity of data; for example a view could appear as Sales2000 or Sales2001, transparently partitioning the actual underlying table
5. Views take very little space to store; the database contains only the definition of a view, not a copy of all the data which it presentsv.
6. Depending on the SQL engine used, views can provide extra security
Source: Wiki Page

What is a Trigger?
Ans: A Trigger is a code that associated with insert, update or delete operations. The code is executed automatically whenever the associated query is executed on a table. Triggers can be useful to maintain integrity in database.

What is a stored procedure?
Ans: A stored procedure is like a function that contains a set of operations compiled together. It contains a set of operations that are commonly used in an application to do some common database tasks.

What is the difference between Trigger and Stored Procedure?
Ans: Unlike Stored Procedures, Triggers cannot be called directly. They can only be associated with queries.

What is a transaction? What are ACID properties?
Ans: A Database Transaction is a set of database operations that must be treated as whole, means either all operations are executed or none of them.
An example can be bank transaction from one account to another account. Either both debit and credit operations must be executed or none of them.
ACID (Atomicity, Consistency, Isolation, Durability) is a set of properties that guarantee that database transactions are processed reliably.

What are indexes?
Ans: A database index is a data structure that improves the speed of data retrieval operations on a database table at the cost of additional writes and the use of more storage space to maintain the extra copy of data.
Data can be stored only in one order on disk. To support faster access according to different values, faster search like binary search for different values is desired, For this purpose, indexes are created on tables. These indexes need extra space on disk, but they allow faster search according to different frequently searched values.

What are clustered and non-clustered Indexes?
Ans: Clustered indexes is the index according to which data is physically stored on disk. Therefore, only one clustered index can be created on a given database table.
Non-clustered indexes don’t define physical ordering of data, but logical ordering. Typically, a tree is created whose leaf point to disk records. B-Tree or B+ tree are used for this purpos

MINDTREE COMPANY ( CALL BASED 2016, 2017 BATCH  THROUGH FRESHERWORLD )

DRIVE DATE 27-3-2018

MLR Institute of Technology
Address: Hyderabad, Telangana 500043

1. Tell me about yourself.
2. Bankers algorithms, avl trees, operator overloading and some fundamental Oops concepts.
I donno why, but the interviewer went out during the interview process, might be to test your patience and too see how you react.
Prepare well on basic algorithms, data structures and the object oriented language you have mentioned in your resume.

mindtree hyderbad

Commonly Asked OOP Interview Questions | Set 1
What is Object Oriented Programming?
Object Oriented Programming (OOP) is a programming paradigm where the complete software operates as a bunch of objects talking to each other. An object is a collection of data and methods that operate on its data.

Why OOP?
The main advantage of OOP is better manageable code that covers following.

1) The overall understanding of the software is increased as the distance between the language spoken by developers and that spoken by users.

2) Object orientation eases maintenance by the use of encapsulation. One can easily change the underlying representation by keeping the methods same.

OOP paradigm is mainly useful for relatively big software. See this for a complete example that shows advantages of OOP over procedural programing.

What are main features of OOP?
Encapsulation
Polymorphism
Inheritance

What is encapsulation?
Encapsulation is referred to one of the following two notions.
1) Data hiding: A language feature to restrict access to members of an object. For example, private and protected members in C++.
2) Bundling of data and methods together: Data and methods that operate on that data are bundled together.

What is Polymorphism? How is it supported by C++?
Polymorphism means that some code or operations or objects behave differently in different contexts. In C++, following features support polymorphism.

Compile Time Polymorphism: Compile time polymorphism means compiler knows which function should be called when a polymorphic call is made. C++ supports compiler time polymorphism by supporting features like templates, function overloading and default arguments.

Run Time Polymorphism: Run time polymorphism is supported by virtual functions. The idea is, virtual functions are called according to the type of object pointed or referred, not according to the type of pointer or reference. In other words, virtual functions are resolved late, at runtime.

What is Inheritance? What is the purpose?
The idea of inheritance is simple, a class is based on another class and uses data and implementation of the other class.
The purpose of inheritance is Code Reuse.

What is Abstraction?
The first thing with which one is confronted when writing programs is the problem. Typically we are confronted with “real-life” problems and we want to make life easier by providing a program for the problem. However, real-life problems are nebulous and the first thing we have to do is to try to understand the problem to separate necessary from unnecessary details: We try to obtain our own abstract view, or model, of the problem. This process of modeling is called abstraction (Source http://gd.tuwien.ac.at/languages/c/c++oop-pmueller/node4.html#SECTION00410000000000000000)

img7

See the source for a complete example and more details of abstraction.

Commonly Asked C++ Interview Questions | Set 1
What are the differences between C and C++?
1) C++ is a kind of superset of C, most of C programs except few exceptions (See this and this) work in C++ as well.
2) C is a procedural programming language, but C++ supports both procedural and Object Oriented programming.
3) Since C++ supports object oriented programming, it supports features like function overloading, templates, inheritance, virtual functions, friend functions. These features are absent in C.
4) C++ supports exception handling at language level, in C exception handling is done in traditional if-else style.
5) C++ supports references, C doesn’t.
6) In C, scanf() and printf() are mainly used input/output. C++ mainly uses streams to perform input and output operations. cin is standard input stream and cout is standard output stream.

There are many more differences, above is a list of main differences.

What are the differences between references and pointers?
Both references and pointers can be used to change local variables of one function inside another function. Both of them can also be used to save copying of big objects when passed as arguments to functions or returned from functions, to get efficiency gain.
Despite above similarities, there are following differences between references and pointers.

References are less powerful than pointers
1) Once a reference is created, it cannot be later made to reference another object; it cannot be reseated. This is often done with pointers.
2) References cannot be NULL. Pointers are often made NULL to indicate that they are not pointing to any valid thing.
3) A reference must be initialized when declared. There is no such restriction with pointers

Due to the above limitations, references in C++ cannot be used for implementing data structures like Linked List, Tree, etc. In Java, references don’t have above restrictions, and can be used to implement all data structures. References being more powerful in Java, is the main reason Java doesn’t need pointers.

References are safer and easier to use:
1) Safer: Since references must be initialized, wild references like wild pointers are unlikely to exist. It is still possible to have references that don’t refer to a valid location (See questions 5 and 6 in the below exercise )
2) Easier to use: References don’t need dereferencing operator to access the value. They can be used like normal variables. ‘&’ operator is needed only at the time of declaration. Also, members of an object reference can be accessed with dot operator (‘.’), unlike pointers where arrow operator (->) is needed to access members.

What are virtual functions – Write an example?
Virtual functions are used with inheritance, they are called according to the type of object pointed or referred, not according to the type of pointer or reference. In other words, virtual functions are resolved late, at runtime. Virtual keyword is used to make a function virtual.

Following things are necessary to write a C++ program with runtime polymorphism (use of virtual functions)
1) A base class and a derived class.
2) A function with same name in base class and derived class.
3) A pointer or reference of base class type pointing or referring to an object of derived class.

For example, in the following program bp is a pointer of type Base, but a call to bp->show() calls show() function of Derived class, because bp points to an object of Derived class.

#include<iostream>
using namespace std;

class Base {
public:
virtual void show() { cout<<” In Base \n”; }
};

class Derived: public Base {
public:
void show() { cout<<“In Derived \n”; }
};

int main(void) {
Base *bp = new Derived;
bp->show(); // RUN-TIME POLYMORPHISM
return 0;
}
Run on IDE
Output:

In Derived
What is this pointer?
The ‘this’ pointer is passed as a hidden argument to all nonstatic member function calls and is available as a local variable within the body of all nonstatic functions. ‘this’ pointer is a constant pointer that holds the memory address of the current object. ‘this’ pointer is not available in static member functions as static member functions can be called without any object (with class name).

Can we do “delete this”?
See https://www.geeksforgeeks.org/delete-this-in-c/

What are VTABLE and VPTR?
vtable is a table of function pointers. It is maintained per class.
vptr is a pointer to vtable. It is maintained per object (See this for an example).
Compiler adds additional code at two places to maintain and use vtable and vptr.
1) Code in every constructor. This code sets vptr of the object being created. This code sets vptr to point to vtable of the class.
2) Code with polymorphic function call (e.g. bp->show() in above code). Wherever a polymorphic call is made, compiler inserts code to first look for vptr using base class pointer or reference (In the above example, since pointed or referred object is of derived type, vptr of derived class is accessed). Once vptr is fetched, vtable of derived class can be accessed. Using vtable, address of derived derived class function show() is accessed and called.

You may also like:

Practice Quizzes on C++

Syntel Company ( call based 2017 batch )

drive date 28 march

Address: Plot No. A-33 & A-34, MIDC IT Tower, MIDC, Talawade, Software Technology Park, Pune, Maharashtra 412114

*************************************************************************
http://placement.freshersworld.com/syntel-question-papers-and-answers/331400002026
******************************************************************************
Syntel – Selection Procedure
Since I like to take only one step at a time and concentrate on the task at hand, I have broken down the entire selection process in these convenient parts:

1. Written Test: 45 Questions 45 Minutes

2. Post Written Test Procedure

My Comments: Not very difficult. A little practice will take you a long way. Try to save time.

Post Written Test Procedure

I was called for the Post written test procedure by Syntel on 27 Nov 2011 at Sharda University, Gr. Noida. Again I have broken down the events into sub categories (my nature, you know!!)

Orientation/Presentation

The Syntel Selection Commitee will brief you about their company’s profile and everything worth knowing about them at the point. So even if you haven’t went through the company’s profile before actually going for Post written Test procedure, you need not worry about it. They will also introduce themselves and inform you about the selection process to be followed.

I found candidates paying no attention to what they were telling us, but don’t make this mistake because this information might come in handy (Even the names of people in the commitee!!).

My Comments: Listen to them!!!

Group Discussion (GD Round)
The first of the Post Written Test Procedure is usually a Group Discussion or GD round. They put candidates in groups of atmost 12 candidates and give a topic to discuss for 10 min. Unlike other GD’s I have participated in where usually a time of 5 min or so is given for preparation, they don’t give any time to prepare for the topic. This is very critical round for your selection process so be prepared for it.

GD Topics
Grass on the other side is Green (this was my topic).
Mobile Phones to be allowed in colleges or not.
The topics were pretty generic and not the usual GD topics like Corporal Punishments in schools, TV and kids etc. They actually want to know your attitude towards these generic things. Positive attitude will get you selected for sure.

My Comments:
Be really confident.
Speak your points clearly.
You’ll have to grab your opportunity to speak, so don’t waste time.
Speaking “more” points will not get you selected.

In a nutshell, speak only relevent points which show your thinking and not that you approve or disapprove others. For instance I spoke only 3 points during my GD but I spoke my mind clearly and with confidence (Confidence is the key!!).
Technical Interview
You’ll have to fill up a form with your basic details before appearing for technical interview. This form also contain sections for technical interviewer and HR interviewer to fill. Take your time and go through the form(although its not necessary).

The Technical interview will be based on the course you are currently pursuing and skills mentioned in your resume. You can also be asked to explain a little about your major project(final year project for B.Tech Students). You can also be made to write pretty basic C programs like sorting, finding prme numbers, finding palindromes etc.

Points to follow:
If you have mentioned any skill of information that you don’t actually possess in your resume, do yourself a favour and take it out, cause it can mess up with your chances if you get caught.
If you are a non CS or a non IT field student, polish the basics concepts like an electronics student would revise- flip flops, latches, memories etc. A little practice of basic C programs like the ones mentioned above will help you a lot.
If you are a CS or an IT field student, they would most likely go for basics of Operating systems, OOP concepts etc. If you have mentioned any JAVA course that you have done, in your resume, they can make you write some JAVA programs.

My Comments:
Stay Calm and confident, a little smile on the face won’t hurt anybody!
Don’t make wild guesses if you don’t know any answer, just politely say “I don’t know”.
Don’t argue with the interviewer, even if you are right!!! He/she might be testing your composure. Trust me, they do that sometimes and how do I know that? well they tried it with me!!
Give to the point answers. No need to fill the interviewer with unnecessary details- remember, he already knows the answer!!

HR Interview

Don’t get too worked up if you made it through the technical round because the HR round can be very tricky and even the most eligible candidates are not able to make it through this round.

The HR interview is nothing like the technical one, the HR interviewer/interviewers are usually very friendly and ask all sorts of questions about you. They want to know your true personality through their questions, so you have to answer their questions smartly. Again confidence is essential in whatever you speak. Speaking fluently in English will surly impress them. Some preparations must be done on the candidate’s part before appearing for the HR interview like:

Tell me about yourself (Sounds simple but speaking non stop about yourself without missing any important detail is not very simple. Tell important points before the secondary points like hobbies etc. This shows you are “well organised “).
What do you know about Syntel? (This is where their presentation round helps)
What are the 5 key “S” features/pillars of syntel? (Presentation round)
Why do you want to join Syntel.
Tell about your family background.
What do your friends say about you?
What are your strengths and weaknesses?

These are just few examples. Confidence is the key. They asked me the name of the Vice-President present their at the time of Orientation round. I’m glad I paid attention during the orientation.

KEEP IN MIND:

Answer smartly, don’t say anything silly or something that can ruin your chances, they are searching for these little hints when you are speaking.
Trust me, to make you a friend is the last thing they want to do, so please don’t think of them as your friends even if they seem real friendly. You are there to get a job, so focus on that.
Don’t speak/switch to any other language than english, this can be a disaster.
Interviewers are looking for positive attitude towards work and other aspects. If you are able to show it through your answers. You’re in.

Result

As I mentioned above, my Post Written Test Procedure took place on 27 Nov 2011, and I got the result from my placement officer on 03 Jan 2012, so its quite some time before they declare the result. Never mind though, cause all the waiting is worth it. I’m happy to be selected among the 2 other candidates selected from my college.

Conclusion

In the End I would like to wish all of you good luck and my best wishes. Remember they are looking for good communication skills and the grand daddy of all – “Confidence”. Thank you for reading my experience and I’ll see you at SYNTEL- Consider IT Done.

************************************************************************************************

Directions : Study the information given below to answer these questions. Mark your answer as:
(i) If both A and R are correct but R does not explain A.
(ii) If both A and R are correct and R explains A.
(iii) If A is correct but R is wrong.
(iv) If A wrong but R is correct.

1) Assertion (A): A saltwater fish drinks sea water where a fresh water fish never drinks water.
Reason (R): A saltwater fish is hyper tonic to its environment while a freshwater fish is hypotonic to its environment.
Answer: iv

2) Assertion (A): The territory of India is larger than the territories of the States taken together.
Reason (R): India is a Union of States.
Answer: i

3) Assertion (A): Alcohol rather than mercury is used in a thermometer to measure a temperature of 60o C.
Reason (R): Alcohol has a lower freezing point then mercury.
Answer: iii

4) 38% of 4500 – 25% of ? = 1640
(1) 260
(2) 270
(3) 280
(4) 290
(5) None of these
Answer: 3
Explanations : 4500 * 38/100 – x * 25/100 = 1640 ? 1710 – 1640 = x/4 ? x/4 = 70 ? x = 280

5) (?)2 + 152 – 332 = 97
(1) 33
(2) 32
(3) 34
(4) 30
(5) None of these
Answer: 5
Explanations : x2 + 152 – 332 = 97 ? x2 = 97 + 1089 – 725 ? x2 = 1186 – 225 = 961 ? x = 31

6) (7921 + 178) – 5.5 = ??
(1) 1512
(2) 1521
(3) 1251
(4) 1531
(5) None of these
Answer: 3
Explanations : 7921 / 178 – 5.5 = ?x 44.5 – 5.5 = = ?x ? 39.0 = ?x ? x = 1521

7) 4 9/10 + 3/11 + 7/15 = ?
(1) 1 217/330
(2) 1 221/330
(3) 1 211/330
(4) 1 197/330
(5) None of these
Answer: 3
Explanations : 9 + 3 + 7 = 297 + 90 + 154 = 541 10 11 15 330 330 = 1 211 330

8) 1/4th of 1/2 of 3/4th of 52000 = ?
(1) 4875
(2) 4857
(3) 4785
(4) 4877
(5) None of these
Answer: 1
Explanations : 52000 * 3/4 * 1/2 * 1/4 = 4875

9) 57/67 * 32/171 * 45/128 = ?
(1) 15/262
(2) 15/268
(3) 15/266
(4) 17/268
(5) None of these
Answer: 2
Explanations : 57/67 * 32/171 * 45/128 = 15/268

10) 283 * 56 + 252 = 20 * ?
(1) 805
(2) 803
(3) 807
(4) 809
(5) None of these
Answer: 1
Explanations : 283 * 56 + 252 = 20*x ? 15848 + 252 = 20*x ? x = 16100/20 ? x = 805

11) (5863 – ?2704) * 0.5 = ?
(1) 2955.5
(2) 2905.5
(3) 2590.5
(4) 2909.5
(5) None of these
Answer: 2
Explanations : (5863 – ?2704) * 0.5 = 2905.5

12) 3?42875 – ? = 21
(1) 18
(2) 13
(3) 15
(4) 11
(5) None of these
Answer: 5
Explanations : ?42875 – x = 21 35 – x = 21 x = 14

13) 10 25639 – 5252 – 3232 = ?
(1) 17255
(2) 17551
(3) 17515
(4) 17155
(5) None of these
Answer: 4

14) Milk : Emulsion : : Butter : ?
(1) Aerosol
(2) Suspension
(3) Sol
(4)Gel
Answer : 4

15) Haemoglobin : Iron : : Chlorophyll : ?
(1) Copper
(2) Magnesium
(3) Cobalt
(4) Calcium
Answer : 2

16) Forecast : Future : : Regret : ?
(1) Present
(2) Atone
(3) Past
(4) Sins
Answer : 3

17. A person travels 12 km in the southward direction and then travels 5km to the right and then travels 15km toward the right and finally travels 5km towards the east, how far is he from his starting place?
(a) 5.5 kms
(b) 3 km
(c) 13 km
(d) 6.4 km
Ans. (b)

18. X’s father’s wife’s father’s granddaughter uncle will be related to X as
(a) Son
(b) Nephew
(c) Uncle
(d) Grandfather
Ans. (c)

19. Find the next number in the series 1, 3 ,7 ,13 ,21 ,31
(a) 43
(b) 33
(c) 41
(d) 45
Ans. (a)

20. If in a certain code “RANGE” is coded as 12345 and “RANDOM” is coded as 123678. Then the code for the word “MANGO” would be
(a) 82357
(b) 89343
(c) 84629
(d) 82347
Ans. (d)

Similar Categories HCL Mu-Sigma TCS Amazon CTS
Start your test Series Now
– Revised Question Papers

– New Pattern of Test

– Realtime ranking among test taker

BRAINSTIC TECHNOLOGY ( CALL BASED 2017, 2016 THROUGH FRESHERWORLD )

ONLY THOSE WHO GOT CALL LETTER FROM FRESHERWORLD

Address: 149/A,5th main, 6th sector,Fooddays Building, 3rd Floor, 16th B cross Rd, HSR Layout, Bengaluru, Karnataka 560102

********************************************************************************************************

https://www.glassdoor.co.in/Overview/Working-at-Brainistic-Technologies-EI_IE945170.11,34.htm?countryRedirect=true
*********************************************************************************************************
READ THESE TOPIC FOR 1ST ROUND

Time and Distance
Time and Work
Compound Interest
Partnership
Problems on Ages
Clock
Area
Permutation and Combination
Problems on Numbers
Decimal Fraction
Square Root and Cube Root
Ratio and Proportion

*************************************************************************
READ Dbms, Data structure interview question
********************************************************
https://www.geeksforgeeks.org/commonly-asked-data-structure-interview-questions-set-1/
******************************************************************

Commonly Asked Data Structure Interview Questions | Set 1
What is a Data Structure?
A data structure is a way of organizing the data so that the data can be used efficiently. Different kinds of data structures are suited to different kinds of applications, and some are highly specialized to specific tasks. For example, B-trees are particularly well-suited for implementation of databases, while compiler implementations usually use hash tables to look up identifiers. (Source: Wiki Page)

What are linear and non linear data Structures?

Linear: A data structure is said to be linear if its elements form a sequence or a linear list. Examples: Array. Linked List, Stacks and Queues
Non-Linear: A data structure is said to be non-linear if traversal of nodes is nonlinear in nature. Example: Graph and Trees.

What are the various operations that can be performed on different Data Structures?

Insertion − Add a new data item in the given collection of data items.
Deletion − Delete an existing data item from the given collection of data items.
Traversal − Access each data item exactly once so that it can be processed.
Searching − Find out the location of the data item if it exists in the given collection of data items.
Sorting − Arranging the data items in some order i.e. in ascending or descending order in case of numerical data and in dictionary order in case of alphanumeric data.

How is an Array different from Linked List?

The size of the arrays is fixed, Linked Lists are Dynamic in size.
Inserting and deleting a new element in an array of elements is expensive, Whereas both insertion and deletion can easily be done in Linked Lists.
Random access is not allowed in Linked Listed.
Extra memory space for a pointer is required with each element of the Linked list.
Arrays have better cache locality that can make a pretty big difference in performance.

What is Stack and where it can be used?

Stack is a linear data structure which the order LIFO(Last In First Out) or FILO(First In Last Out) for accessing elements. Basic operations of stack are : Push, Pop , Peek

Applications of Stack:

Infix to Postfix Conversion using Stack
Evaluation of Postfix Expression
Reverse a String using Stack
Implement two stacks in an array
Check for balanced parentheses in an expression

What is a Queue, how it is different from stack and how is it implemented?

Queue is a linear structure which follows the order is First In First Out (FIFO) to access elements. Mainly the following are basic operations on queue: Enqueue, Dequeue, Front, Rear
The difference between stacks and queues is in removing. In a stack we remove the item the most recently added; in a queue, we remove the item the least recently added. Both Queues and Stacks can be implemented using Arrays and Linked Lists.

What are Infix, prefix, Postfix notations?

Infix notation: X + Y – Operators are written in-between their operands. This is the usual way we write expressions. An expression such as
A * ( B + C ) / D
Postfix notation (also known as “Reverse Polish notation”): X Y + Operators are written after their operands. The infix expression given above is equivalent to
A B C + * D/
Prefix notation (also known as “Polish notation”): + X Y Operators are written before their operands. The expressions given above are equivalent to
/ * A + B C D
Converting between these notations: Click here

What is a Linked List and What are its types?

A linked list is a linear data structure (like arrays) where each element is a separate object. Each element (that is node) of a list is comprising of two items – the data and a reference to the next node.Types of Linked List :

Singly Linked List : In this type of linked list, every node stores address or reference of next node in list and the last node has next address or reference as NULL. For example 1->2->3->4->NULL
Doubly Linked List : Here, here are two references associated with each node, One of the reference points to the next node and one to the previous node. Eg. NULL<-1<->2<->3->NULL
Circular Linked List : Circular linked list is a linked list where all nodes are connected to form a circle. There is no NULL at the end. A circular linked list can be a singly circular linked list or doubly circular linked list. Eg. 1->2->3->1 [The next pointer of last node is pointing to the first]

Which data structures are used for BFS and DFS of a graph?

Queue is used for BFS
Stack is used for DFS. DFS can also be implemented using recursion (Note that recursion also uses function call stack).

Can doubly linked be implemented using a single pointer variable in every node?
Doubly linked list can be implemented using a single pointer. See XOR Linked List – A Memory Efficient Doubly Linked List

How to implement a stack using queue?

A stack can be implemented using two queues. Let stack to be implemented be ‘s’ and queues used to implement be ‘q1’ and ‘q2’. Stack ‘s’ can be implemented in two ways:

Method 1 (By making push operation costly)
Method 2 (By making pop operation costly) See Implement Stack using Queues

How to implement a queue using stack?

A queue can be implemented using two stacks. Let queue to be implemented be q and stacks used to implement q be stack1 and stack2. q can be implemented in two ways:

Method 1 (By making enQueue operation costly)
Method 2 (By making deQueue operation costly) See Implement Queue using Stacks

Which Data Structure Should be used for implementiong LRU cache?

We use two data structures to implement an LRU Cache.

Queue which is implemented using a doubly linked list. The maximum size of the queue will be equal to the total number of frames available (cache size).The most recently used pages will be near front end and least recently pages will be near rear end.
A Hash with page number as key and address of the corresponding queue node as value. See How to implement LRU caching scheme? What data structures should be used?

How to check if a given Binary Tree is BST or not?
If inorder traversal of a binary tree is sorted, then the binary tree is BST. The idea is to simply do inorder traversal and while traversing keep track of previous key value. If current key value is greater, then continue, else return false. See A program to check if a binary tree is BST or not for more details.

Linked List Questions

Linked List Insertion
Linked List Deletion
middle of a given linked list
Nth node from the end of a Linked List

Tree Traversal Questions

Inorder
Preorder and Postoder Traversals
Level order traversal
Height of Binary Tree

Convert a DLL to Binary Tree in-place
See In-place conversion of Sorted DLL to Balanced BST

Convert Binary Tree to DLL in-place
See Convert a given Binary Tree to Doubly Linked List | Set 1, Convert a given Binary Tree to Doubly Linked List | Set 2

Delete a given node in a singly linked list
Given only a pointer to a node to be deleted in a singly linked list, how do you delete it?

Reverse a Linked List
Write a function to reverse a linked list

Detect Loop in a Linked List
Write a C function to detect loop in a linked list.

Which data structure is used for dictionary and spell checker?
Data Structure for Dictionary and Spell Checker?

*************************************************
DBMS INTERVIEW

***************************************************

Commonly asked DBMS interview questions | Set 1
What are advantages of DBMS over traditional file based systems?
Ans: Database management systems were developed to handle the following difficulties of typical file-processing systems supported by conventional operating systems.
1. Data redundancy and inconsistency
2. Difficulty in accessing data
3. Data isolation – multiple files and formats
4. Integrity problems
5. Atomicity of updates
6. Concurrent access by multiple users
7. Security problems
Source: http://cs.nyu.edu/courses/spring01/G22.2433-001/mod1.2.pdf

What are super, primary, candidate and foreign keys?
Ans: A superkey is a set of attributes of a relation schema upon which all attributes of the schema are functionally dependent. No two rows can have the same value of super key attributes.
A Candidate key is minimal superkey, i.e., no proper subset of Candidate key attributes can be a superkey.
A Primary Key is one of the candidate keys. One of the candidate keys is selected as most important and becomes the primary key. There cannot be more that one primary keys in a table.
Foreign key is a field (or collection of fields) in one table that uniquely identifies a row of another table. See this for an example.

What is the difference between primary key and unique constraints?
Ans: Primary key cannot have NULL value, the unique constraints can have NULL values. There is only one primary key in a table, but there can be multiple unique constrains.

What is database normalization?
Ans: It is a process of analyzing the given relation schemas based on their functional dependencies and primary keys to achieve the following desirable properties:
1) Minimizing Redundancy
2) Minimizing the Insertion, Deletion, And Update Anomalies
Relation schemas that do not meet the properties are decomposed into smaller relation schemas that could meet desirable properties.
Source: http://cs.tsu.edu/ghemri/CS346/ClassNotes/Normalization.pdf

What is SQL?
SQL is Structured Query Language designed for inserting and modifying in a relational database system.

What are the differences between DDL, DML and DCL in SQL?
Ans: Following are some details of three.
DDL stands for Data Definition Language. SQL queries like CREATE, ALTER, DROP and RENAME come under this.
DML stands for Data Manipulation Language. SQL queries like SELECT, INSERT and UPDATE come under this.
DCL stands for Data Control Language. SQL queries like GRANT and REVOKE come under this.

What is the difference between having and where clause?
Ans: HAVING is used to specify a condition for a group or an aggregate function used in select statement. The WHERE clause selects before grouping. The HAVING clause selects rows after grouping. Unlike HAVING clause, the WHERE clause cannot contain aggregate functions. (See this for examples).
See Having vs Where Clause? for more details

How to print duplicate rows in a table?
Ans: See http://quiz.geeksforgeeks.org/how-to-print-duplicate-rows-in-a-table/

What is Join?
Ans: An SQL Join is used to combine data from two or more tables, based on a common field between them. For example, consider the following two tables.

Student Table

ENROLLNO STUDENTNAME ADDRESS
1000 geek1 geeksquiz1
1001 geek2 geeksquiz2
1002 geek3 geeksquiz3
StudentCourse Table

COURSEID ENROLLNO
1 1000
2 1000
3 1000
1 1002
2 1003
Following is join query that shows names of students enrolled in different courseIDs.

SELECT StudentCourse.CourseID, Student.StudentName
FROM StudentCourse
INNER JOIN Customers
ON StudentCourse.EnrollNo = Student.EnrollNo
ORDER BY StudentCourse.CourseID;
The above query would produce following result.

COURSEID STUDENTNAME
1 geek1
1 geek2
2 geek1
2 geek3
3 geek1

What is Identity?
Ans: Identity (or AutoNumber) is a column that automatically generates numeric values. A start and increment value can be set, but most DBA leave these at 1. A GUID column also generates numbers; the value of this cannot be controlled. Identity/GUID columns do not need to be indexed.

What is a view in SQL? How to create one
Ans: A view is a virtual table based on the result-set of an SQL statement. We can create using create view syntax.

CREATE VIEW view_name AS
SELECT column_name(s)
FROM table_name
WHERE condition

What are the uses of view?
1. Views can represent a subset of the data contained in a table; consequently, a view can limit the degree of exposure of the underlying tables to the outer world: a given user may have permission to query the view, while denied access to the rest of the base table.
2. Views can join and simplify multiple tables into a single virtual table
3. Views can act as aggregated tables, where the database engine aggregates data (sum, average etc.) and presents the calculated results as part of the data
4. Views can hide the complexity of data; for example a view could appear as Sales2000 or Sales2001, transparently partitioning the actual underlying table
5. Views take very little space to store; the database contains only the definition of a view, not a copy of all the data which it presentsv.
6. Depending on the SQL engine used, views can provide extra security
Source: Wiki Page

What is a Trigger?
Ans: A Trigger is a code that associated with insert, update or delete operations. The code is executed automatically whenever the associated query is executed on a table. Triggers can be useful to maintain integrity in database.

What is a stored procedure?
Ans: A stored procedure is like a function that contains a set of operations compiled together. It contains a set of operations that are commonly used in an application to do some common database tasks.

What is the difference between Trigger and Stored Procedure?
Ans: Unlike Stored Procedures, Triggers cannot be called directly. They can only be associated with queries.

What is a transaction? What are ACID properties?
Ans: A Database Transaction is a set of database operations that must be treated as whole, means either all operations are executed or none of them.
An example can be bank transaction from one account to another account. Either both debit and credit operations must be executed or none of them.
ACID (Atomicity, Consistency, Isolation, Durability) is a set of properties that guarantee that database transactions are processed reliably.

What are indexes?
Ans: A database index is a data structure that improves the speed of data retrieval operations on a database table at the cost of additional writes and the use of more storage space to maintain the extra copy of data.
Data can be stored only in one order on disk. To support faster access according to different values, faster search like binary search for different values is desired, For this purpose, indexes are created on tables. These indexes need extra space on disk, but they allow faster search according to different frequently searched values.

What are clustered and non-clustered Indexes?
Ans: Clustered indexes is the index according to which data is physically stored on disk. Therefore, only one clustered index can be created on a given database table.
Non-clustered indexes don’t define physical ordering of data, but logical ordering. Typically, a tree is created whose leaf point to disk records. B-Tree or B+ tree are used for this purpos

KibbCom India Pvt. Ltd ( CALL BASED 2017 BATCH )

DRIVE DATE 31 MARCH 2018

Address: Kibbcom India Private Limited, Silver Software Tech park, Basement Floor, Rd No. 7, KIADB Export Promotion Industrial Area, Whitefield, Bengaluru, Karnataka 560066

*****************************
WRITTEN TEST
*************************
Time and Distance
Time and Work
Compound Interest
Partnership
Problems on Ages
Clock
Area
Permutation and Combination
Problems on Numbers
Decimal Fraction
Square Root and Cube Root
Ratio and Proportion
Pipes and Cistern
Alligation or Mixture

****************************************************
READ JAVA , DBMS INTERVIEW QUESTION
*******************************************************
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).

4. 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.

5. What is the base class of all classes?

java.lang.Object

6. What are the access modifiers in Java?

There are 3 access modifiers. Public, protected and private, and the default one if no identifier is specified is called friendly, but programmer cannot specify the friendly identifier explicitly.

7. What is are packages?

A package is a collection of related classes and interfaces providing access protection and namespace management.

8. What is meant by Inheritance and what are its advantages?

Inheritance is the process of inheriting all the features from a class. The advantages of inheritance are reusability of code and accessibility of variables and methods of the super class by subclasses.

9. What is the difference between superclass and subclass?

A super class is a class that is inherited whereas sub class is a class that does the inheriting.

10. What is an abstract class?

An abstract class is a class designed with implementation gaps for subclasses to fill in and is deliberately incomplete.

11. What are the states associated in the thread?

Thread contains ready, running, waiting and dead states.

12. What is synchronization?

Synchronization is the mechanism that ensures that only one thread is accessed the resources at a time.

13. What is deadlock?

When two threads are waiting each other and can’t precede the program is said to be deadlock.

14. What is an applet?

Applet is a dynamic and interactive program that runs inside a web page displayed by a java capable browser

15. What is the lifecycle of an applet?

init() method – Can be called when an applet is first loaded
start() method – Can be called each time an applet is started.
paint() method – Can be called when the applet is minimized or maximized.
stop() method – Can be used when the browser moves off the applet’s page.
destroy() method – Can be called when the browser is finished with the applet.

16. How do you set security in applets?

using setSecurityManager() method

17. What is a layout manager and what are different types of layout managers available in java AWT?

A layout manager is an object that is used to organize components in a container. The different layouts are available are FlowLayout, BorderLayout, CardLayout, GridLayout and GridBagLayout

18. What is JDBC?

JDBC is a set of Java API for executing SQL statements. This API consists of a set of classes and interfaces to enable programs to write pure Java Database applications.

19. What are drivers available?

-a) JDBC-ODBC Bridge driver b) Native API Partly-Java driver
c) JDBC-Net Pure Java driver d) Native-Protocol Pure Java driver

20. What is stored procedure?

Stored procedure is a group of SQL statements that forms a logical unit and performs a particular task. Stored Procedures are used to encapsulate a set of operations or queries to execute on database. Stored procedures can be compiled and executed with different parameters and results and may have any combination of input/output parameters.

21. What is the Java API?

The Java API is a large collection of ready-made software components that provide many useful capabilities, such as graphical user interface (GUI) widgets.

22. Why there are no global variables in Java?

Global variables are globally accessible. Java does not support globally accessible variables due to following reasons:
1)The global variables breaks the referential transparency
2)Global variables creates collisions in namespace.

23. What are Encapsulation, Inheritance and Polymorphism?

Encapsulation is the mechanism that binds together code and data it manipulates and keeps both safe from outside interference and misuse. Inheritance is the process by which one object acquires the properties of another object. Polymorphism is the feature that allows one interface to be used for general class actions.

24. What is the use of bin and lib in JDK?

Bin contains all tools such as javac, appletviewer, awt tool, etc., whereas lib contains API and all packages.

25. What is method overloading and method overriding?

Method overloading: When a method in a class having the same method name with different arguments is said to be method overloading. Method overriding : When a method in a class having the same method name with same arguments is said to be method overriding.

26. What is the difference between this() and super()?

this() can be used to invoke a constructor of the same class whereas super() can be used to invoke a super class constructor.

27. What is Domain Naming Service(DNS)?

It is very difficult to remember a set of numbers(IP address) to connect to the Internet. The Domain Naming Service(DNS) is used to overcome this problem. It maps one particular IP address to a string of characters. For example, www. mascom. com implies com is the domain name reserved for US commercial sites, moscom is the name of the company and www is the name of the specific computer, which is mascom’s server.

28. What is URL?

URL stands for Uniform Resource Locator and it points to resource files on the Internet. URL has four components: http://www. address. com:80/index.html, where http – protocol name, address – IP address or host name, 80 – port number and index.html – file path.

29. What is RMI and steps involved in developing an RMI object?

Remote Method Invocation (RMI) allows java object that executes on one machine and to invoke the method of a Java object to execute on another machine. The steps involved in developing an RMI object are: a) Define the interfaces b) Implementing these interfaces c) Compile the interfaces and their implementations with the java compiler d) Compile the server implementation with RMI compiler e) Run the RMI registry f) Run the application.

30. What is RMI architecture?

RMI architecture consists of four layers and each layer performs specific functions: a) Application layer – contains the actual object definition. b) Proxy layer – consists of stub and skeleton. c) Remote Reference layer – gets the stream of bytes from the transport layer and sends it to the proxy layer. d) Transportation layer – responsible for handling the actual machine-to-machine communication.

31. What is a Java Bean?

A Java Bean is a software component that has been designed to be reusable in a variety of different environments.

32. What are checked exceptions?

Checked exception are those which the Java compiler forces you to catch. e.g. IOException are checked Exceptions.

33. What are runtime exceptions?

Runtime exceptions are those exceptions that are thrown at runtime because of either wrong input data or because of wrong business logic etc. These are not checked by the compiler at compile time.

34. What is the difference between error and an exception?

An error is an irrecoverable condition occurring at runtime. Such as OutOfMemory error. These JVM errors and you can not repair them at runtime. While exceptions are conditions that occur because of bad input etc. e.g. FileNotFoundException will be thrown if the specified file does not exist. Or a NullPointerException will take place if you try using a null reference. In most of the cases it is possible to recover from an exception (probably by giving user a feedback for entering proper values etc.).

35. 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. For example, closing a opened file, closing a opened database Connection.

36. What is the difference between yielding and sleeping?

When a task invokes its yield() method, it returns to the ready state. When a task invokes its sleep() method, it returns to the waiting state.

37. What is the difference between preemptive scheduling and time slicing?

Under preemptive scheduling, the highest priority task executes until it enters the waiting or dead states or a higher priority task comes into existence. Under time slicing, a task executes for a predefined slice of time and then reenters the pool of ready tasks. The scheduler then determines which task should execute next, based on priority and other factors.

38. What is mutable object and immutable object?

If a object value is changeable then we can call it as Mutable object. (Ex., StringBuffer, …) If you are not allowed to change the value of an object, it is immutable object. (Ex., String, Integer, Float, …)

39. What is the purpose of Void class?

The Void class is an uninstantiable placeholder class to hold a reference to the Class object representing the primitive Java type void.

40. What is JIT and its use?

Really, just a very fast compiler… In this incarnation, pretty much a one-pass compiler — no offline computations. So you can’t look at the whole method, rank the expressions according to which ones are re-used the most, and then generate code. In theory terms, it’s an on-line problem.

41. What is nested class?

If all the methods of a inner class is static then it is a nested class.

42. What is HashMap and Map?

Map is Interface and Hashmap is class that implements that.

43. What are different types of access modifiers?

public: Any thing declared as public can be accessed from anywhere. private: Any thing declared as private can’t be seen outside of its class. protected: Any thing declared as protected can be accessed by classes in the same package and subclasses in the other packages. default modifier : Can be accessed only to classes in the same package.

44. What is the difference between Reader/Writer and InputStream/Output Stream?

The Reader/Writer class is character-oriented and the InputStream/OutputStream class is byte-oriented.

45. What is servlet?

Servlets are modules that extend request/response-oriented servers, such as java-enabled web servers. For example, a servlet might be responsible for taking data in an HTML order-entry form and applying the business logic used to update a company’s order database.

46. What is Constructor?

A constructor is a special method whose task is to initialize the object of its class.
It is special because its name is the same as the class name.
They do not have return types, not even void and therefore they cannot return values.
They cannot be inherited, though a derived class can call the base class constructor.
Constructor is invoked whenever an object of its associated class is created.

47. What is an Iterator ?
The Iterator interface is used to step through the elements of a Collection.
Iterators let you process each element of a Collection.
Iterators are a generic way to go through all the elements of a Collection no matter how it is organized.
Iterator is an Interface implemented a different way for every Collection.

48. What is the List interface?

The List interface provides support for ordered collections of objects.
Lists may contain duplicate elements.

49. What is memory leak?

A memory leak is where an unreferenced object that will never be used again still hangs around in memory and doesnt get garbage collected.

50. What is the difference between the prefix and postfix forms of the ++ operator?

The prefix form performs the increment operation and returns the value of the increment operation. The postfix form returns the current value all of the expression and then performs the increment operation on that value.

51. 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.

52. What will happen to the Exception object after exception handling?

Exception object will be garbage collected.

53. Difference between static and dynamic class loading.

Static class loading: The process of loading a class using new operator is called static class loading. Dynamic class loading: The process of loading a class at runtime is called dynamic class loading.
Dynamic class loading can be done by using Class.forName(….).newInstance().

54. Explain the Common use of EJB

The EJBs can be used to incorporate business logic in a web-centric application.
The EJBs can be used to integrate business processes in Business-to-business (B2B) e-commerce applications.In Enterprise Application Integration applications, EJBs can be used to house processing and mapping between different applications.

55. What is JSP?

JSP is a technology that returns dynamic content to the Web client using HTML, XML and JAVA elements. JSP page looks like a HTML page but is a servlet. It contains Presentation logic and business logic of a web application.

56. What is the purpose of apache tomcat?

Apache server is a standalone server that is used to test servlets and create JSP pages. It is free and open source that is integrated in the Apache web server. It is fast, reliable server to configure the applications but it is hard to install. It is a servlet container that includes tools to configure and manage the server to run the applications. It can also be configured by editing XML configuration files.

57. Where pragma is used?

Pragma is used inside the servlets in the header with a certain value. The value is of no-cache that tells that a servlets is acting as a proxy and it has to forward request. Pragma directives allow the compiler to use machine and operating system features while keeping the overall functionality with the Java language. These are different for different compilers.

58. Briefly explain daemon thread.

Daemon thread is a low priority thread which runs in the background performs garbage collection operation for the java runtime system.

59. What is a native method?

A native method is a method that is implemented in a language other than Java.

60. Explain different way of using thread?

A Java thread could be implemented by using Runnable interface or by extending the Thread class. The Runnable is more advantageous, when you are going for multiple inheritance.

61. What are the two major components of JDBC?

One implementation interface for database manufacturers, the other implementation interface for application and applet writers.

62. What kind of thread is the Garbage collector thread?

It is a daemon thread.

63. What are the different ways to handle exceptions?

There are two ways to handle exceptions,
1. By wrapping the desired code in a try block followed by a catch block to catch the exceptions. and
2. List the desired exceptions in the throws clause of the method and let the caller of the method handle those exceptions.

64. How many objects are created in the following piece of code?

MyClass c1, c2, c3;
c1 = new MyClass ();
c3 = new MyClass ();
Answer: Only 2 objects are created, c1 and c3. The reference c2 is only declared and not initialized.

65.What is UNICODE?

Unicode is used for internal representation of characters and strings and it uses 16 bits to represent each other.

***************************************
DBMS QUESTION INTERVIEW
*************************************

What is DBMS?

DBMS stands for Database Management System. It is a collection of programs that enables user to create and maintain a database.

3. What is a Database system?

The database and DBMS software together is called as Database system.

4. What are the advantages of DBMS?

I. Redundancy is controlled.

II. Providing multiple user interfaces.

III. Providing backup and recovery

IV. Unauthorized access is restricted.

V. Enforcing integrity constraints.

5. What is normalization?

It is a process of analysing the given relation schemas based on their Functional Dependencies (FDs) and primary key to achieve the properties
(1).Minimizing redundancy, (2). Minimizing insertion, deletion and update anomalies.

6. What is Data Model?
A collection of conceptual tools for describing data, data relationships data semantics and constraints.

7. What is E-R model?

This data model is based on real world that consists of basic objects called entities and of relationship among these objects. Entities are described in a database by a set of attributes.

8. What is Object Oriented model?

This model is based on collection of objects. An object contains values stored in instance variables with in the object. An object also contains bodies of code that operate on the object. These bodies of code are called methods. Objects that contain same types of values and the same methods are grouped together into classes.

9. What is an Entity?
An entity is a thing or object of importance about which data must be captured.

10. What is DDL (Data Definition Language)?

A data base schema is specifies by a set of definitions expressed by a special language called DDL.

11. What is DML (Data Manipulation Language)?

This language that enable user to access or manipulate data as organised by appropriate data model. Procedural DML or Low level: DML requires a user to specify what data are needed and how to get those data. Non-Procedural DML or High level: DML requires a user to specify what data are needed without specifying how to get those data

12. What is DML Compiler?

It translates DML statements in a query language into low-level instruction that the query evaluation engine can understand.

13. What is Query evaluation engine?

It executes low-level instruction generated by compiler.

14. What is Functional Dependency?

Functional Dependency is the starting point of normalization. Functional Dependency exists when a relation between two attributes allows you to uniquely determine the corresponding attribute�s value.

15. What is 1 NF (Normal Form)?

The first normal form or 1NF is the first and the simplest type of normalization that can be implemented in a database. The main aims of 1NF are to:

1. Eliminate duplicative columns from the same table.

2. Create separate tables for each group of related data and identify each row with a unique column (the primary key).

16. What is Fully Functional dependency?

A functional dependency X Y is full functional dependency if removal of any attribute A from X means that the dependency does not hold any more.

17. What is 2NF?

A relation schema R is in 2NF if it is in 1NF and every non-prime attribute A in R is fully functionally dependent on primary key.

18. What is 3NF?

A relation is in third normal form if it is in Second Normal Form and there are no functional (transitive) dependencies between two (or more) non-primary key attributes.

19. What is BCNF (Boyce-Codd Normal Form)?

A table is in Boyce-Codd normal form (BCNF) if and only if it is in 3NF and every determinant is a candidate key.

20. What is 4NF?

Fourth normal form requires that a table be BCNF and contain no multi-valued dependencies.

21. What is 5NF?

A table is in fifth normal form (5NF) or Project-Join Normal Form (PJNF) if it is in 4NF and it cannot have a lossless decomposition into any number of smaller tables.

22. What is a query?

A query with respect to DBMS relates to user commands that are used to interact with a data base.

23. What is meant by query optimization?

The phase that identifies an efficient execution plan for evaluating a query that has the least estimated cost is referred to as query optimization.

24. What is an attribute?
It is a particular property, which describes the entity.

25. What is RDBMS?

Relational Data Base Management Systems (RDBMS) are database management systems that maintain data records and indices in tables.

26. What�s difference between DBMS and RDBMS?

DBMS provides a systematic and organized way of storing, managing and retrieving from collection of logically related information. RDBMS also provides what DBMS provides but above that it provides relationship integrity.

27. What is SQL?

SQL stands for Structured Query Language. SQL is an ANSI (American National Standards Institute) standard computer language for accessing and manipulating database systems. SQL statements are used to retrieve and update data in a database.

28. What is Stored Procedure?

A stored procedure is a named group of SQL statements that have been previously created and stored in the server database.

29. What is a view?

A view may be a subset of the database or it may contain virtual data that is derived from the database files but is not explicitly stored.

30. What is Trigger?

A trigger is a SQL procedure that initiates an action when an event (INSERT, DELETE or UPDATE) occurs.

31. What is Index?

An index is a physical structure containing pointers to the data.

32. What is extension and intension?

Extension -It is the number of tuples present in a table at any instance. This is time dependent.

Intension -It is a constant value that gives the name, structure of table and the constraints laid on it.

33. What do you mean by atomicity and aggregation?

Atomicity-Atomicity states that database modifications must follow an �all or nothing� rule. Each transaction is said to be �atomic.� If one part of the transaction fails, the entire transaction fails.

Aggregation – A feature of the entity relationship model that allows a relationship set to participate in another relationship set. This is indicated on an ER diagram by drawing a dashed box around the aggregation.

34. What is RDBMS KERNEL?

Two important pieces of RDBMS architecture are the kernel, which is the software, and the data dictionary, which consists of the system- level data structures used by the kernel to manage the database.

35. Name the sub-systems of a RDBMS?

I/O, Security, Language Processing, Process Control, Storage Management, Logging and Recovery, Distribution Control, Transaction Control, Memory Management, Lock Management.

36. How do you communicate with an RDBMS?

You communicate with an RDBMS using Structured Query Language (SQL)

37. Disadvantage in File Processing System?

· Data redundancy & inconsistency.

· Difficult in accessing data.

· Data isolation.

· Data integrity.

· Concurrent access is not possible.

· Security Problems.

38. What is VDL (View Definition Language)?

It specifies user views and their mappings to the conceptual schema.

39. What is SDL (Storage Definition Language)?

This language is to specify the internal schema. This language may Specify the mapping between two schemas.

40. Describe concurrency control?

Concurrency control is the process managing simultaneous operations against a database so that database integrity is no compromised. There are two approaches to concurrency control.

The pessimistic approach involves locking and the optimistic approach involves versioning.

41. Describe the difference between homogeneous and heterogeneous distributed database?

A homogenous database is one that uses the same DBMS at each node. A heterogeneous database is one that may have a different DBMS at each node.

42. What is a distributed database?

A distributed database is a single logical database that is spread across more than one node or locations that are all connected via some communication link.

43. Explain the difference between two and three-tier architectures?

Three-tier architecture includes a client and two server layers.

The application code is stored on the application server and the database is stored on the database server. A two-tier architecture includes a client and one server layer. The database is stored on the database server.

44. Briefly describe the three types of SQL commands?

Data definition language commands are used to create, alter, and drop tables. Data manipulation commands are used to insert, modify, update, and query data in the database. Data control language commands help the DBA to control the database.

45. List some of the properties of a relation?

Relations in a database have a unique name and no multivalued attributes exist. Each row is unique and each attribute within a relation has a unique name. The sequence of both columns and rows is irrelevant.

46. Explain the differences between an intranet and an extranet?

An Internet database is accessible by everyone who has access to a Web site. An intranet database limits access to only people within a given organization.

47. What is SQL Deadlock?

Deadlock is a unique situation in a multi user system that causes two or more users to wait indefinitely for a locked resource.

48. What is a Catalog?

A catalog is a table that contains the information such as structure of each file, the type and storage format of each data item and various constraints on the data .The information stored in the catalog is called Metadata.

49. What is data ware housing & OLAP?

Data warehousing and OLAP (online analytical processing) systems are the techniques used in many companies to extract and analyze useful information from very large databases for decision making .

50. Describe the three levels of data abstraction?

Physical level: The lowest level of abstraction describes how data are stored.

Logical level: The next higher level of abstraction, describes what data are stored in database and what relationship among those data.

View level: The highest level of abstraction describes only part of entire database.

***************************************************************************************************************************************************************************************************************************************************************************************************************

 

Bitwise Solutions Pvt. Ltd. – Bitwise World ( call based 2016, 2017 batch )

drive date 26 march

Address: Bitwise World, Off, Senapati Bapat Rd, Bahiratwadi, Pune, Maharashtra 411016

**********************************************************************

https://www.glassdoor.co.in/Interview/Bitwise-Pune-Interview-Questions-EI_IE587355.0,7_IL.8,12_IM1072.htm?countryRedirect=true

Interview Questions

In technical round firstly they ask to write 3 programs
1. pattern match
2.prime number.
3.factorial
4.armstrong
5.fibonacci series out of this they wont ask you anything.
Then they will ask you each and everything what you write in your code afterwards they ask you about your project in deep as soon as you complete about project they ask you basic java and sql questions .

SQL was pretty easy and so was the aptitude which consisted mostly of logical reasoning.
There were a lot of dice pattern questions.…
Show More

Interview Questions

Programs on Pascal’s triangle, Armstrong number, Fibonacci series, swapping without temp variable, etc.

Basic Java Interview Questions
Q1. Explain JVM, JRE and JDK?
JVM (Java Virtual Machine): It is an abstract machine. It is a specification that provides run-time environment in which java bytecode can be executed. It follows three notations:

Specification: It is a document that describes the implementation of the Java virtual machine. It is provided by Sun and other companies.
Implementation: It is a program that meets the requirements of JVM specification.
Runtime Instance: An instance of JVM is created whenever you write a java command on the command prompt and run the class.
JRE (Java Runtime Environment) : JRE refers to a runtime environment in which java bytecode can be executed. It implements the JVM (Java Virtual Machine) and provides all the class libraries and other support files that JVM uses at runtime. So JRE is a software package that contains what is required to run a Java program. Basically, it’s an implementation of the JVM which physically exists.

JDK(Java Development Kit) : It is the tool necessary to compile, document and package Java programs. The JDK completely includes JRE which contains tools for Java programmers. The Java Development Kit is provided free of charge. Along with JRE, it includes an interpreter/loader, a compiler (javac), an archiver (jar), a documentation generator (javadoc) and other tools needed in Java development. In short, it contains JRE + development tools.

Refer to this below image and understand how exactly these components reside:

Components – Java Interview Questions – Edureka

Q2. Explain public static void main(String args[]).
public : Public is an access modifier, which is used to specify who can access this method. Public means that this Method will be accessible by any Class.
static : It is a keyword in java which identifies it is class based i.e it can be accessed without creating the instance of a Class.

void : It is the return type of the method. Void defines the method which will not return any value.

main: It is the name of the method which is searched by JVM as a starting point for an application with a particular signature only. It is the method where the main execution occurs.

String args[] : It is the parameter passed to the main method.

Q3. Why Java is platform independent?
Platform independent practically means “write once run anywhere”. Java is called so because of its byte codes which can run on any system irrespective of its underlying operating system.

Q4. Why java is not 100% Object-oriented?
Java is not 100% Object-oriented because it makes use of eight primitive datatypes such as boolean, byte, char, int, float, double, long, short which are not objects.

Q5. What are wrapper classes?
Wrapper classes converts the java primitives into the reference types (objects). Every primitive data type has a class dedicated to it. These are known as wrapper classes because they “wrap” the primitive data type into an object of that class. Refer to the below image which displays different primitive type, wrapper class and constructor argument.

WrapperClass – Java Interview Questions – Edureka

Q6. What are constructors in Java?
In Java, constructor refers to a block of code which is used to initialize an object. It must have the same name as that of the class. Also, it has no return type and it is automatically called when an object is created.

There are two types of constructors:

Default constructor
Parameterized constructor
Q7. What is singleton class and how can we make a class singleton?
Singleton class is a class whose only one instance can be created at any given time, in one JVM. A class can be made singleton by making its constructor private.

Q8. What is the difference between Array list and vector?
Array List Vector
Array List is not synchronized. Vector is synchronized.
Array List is fast as it’s non-synchronized. Vector is slow as it is thread safe.
If an element is inserted into the Array List, it increases its Array size by 50%. Vector defaults to doubling size of its array.
Array List does not define the increment size. Vector defines the increment size.
Array List can only use Iterator for traversing an Array List. Except Hashtable, Vector is the only other class which uses both Enumeration and Iterator.
Q9. What is the difference between equals() and == ?
Equals() method is defined in Object class in Java and used for checking equality of two objects defined by business logic.
“==” or equality operator in Java is a binary operator provided by Java programming language and used to compare primitives and objects. public boolean equals(Object o) is the method provided by the Object class. The default implementation uses == operator to compare two objects. For example: method can be overridden like String class. equals() method is used to compare the values of two objects.

public class Equaltest {
public static void main(String[] args) {
String str1= new String(“ABCD”);
String str2= new String(“ABCD”);
if(Str1 == str2)
{
System.out.println(“String 1 == String 2 is true”);
}
else
{
System.out.println(“String 1 == String 2 is false”);
String Str3 = Str2;
if( Str2 == Str3)
{
System.out.println(“String 2 == String 3 is true”);
}
else
{
System.out.println(“String 2 == String 3 is false”);
}
if(Str1.equals(str2))
{
System.out.println(“String 1 equals string 2 is true”);
}
else
{
System.out.prinltn(“String 1 equals string 2 is false”);
}
}}
Q10. What are the differences between Heap and Stack Memory?
The major difference between Heap and Stack memory are:

Features Stack Heap
Memory Stack memory is used only by one thread of execution. Heap memory is used by all the parts of the application.
Access Stack memory can’t be accessed by other threads. Objects stored in the heap are globally accessible.
Memory Management Follows LIFO manner to free memory. Memory management is based on generation associated to each object.
Lifetime Exists until the end of execution of the thread. Heap memory lives from the start till the end of application execution.
Usage Stack memory only contains local primitive and reference variables to objects in heap space. Whenever an object is created, it’s always stored in the Heap space.

In case you are facing any challenges with these java interview questions, please comment your problems in the section below. Apart from this Java Interview Questions Blog, if you want to get trained from professionals on this technology, you can opt for a structured training from edureka! Click below to know more.

Get Started with Java

OOPS Java Interview Questions:
Q1. What is Polymorphism?

Polymorphism is briefly described as “one interface, many implementations”. Polymorphism is a characteristic of being able to assign a different meaning or usage to something in different contexts – specifically, to allow an entity such as a variable, a function, or an object to have more than one form. There are two types of polymorphism:

Compile time polymorphism
Run time polymorphism

Compile time polymorphism is method overloading whereas Runtime time polymorphism is done using inheritance and interface.

Q2. What is runtime polymorphism or dynamic method dispatch?
In Java, runtime polymorphism or dynamic method dispatch is a process in which a call to an overridden method is resolved at runtime rather than at compile-time. In this process, an overridden method is called through the reference variable of a superclass. Let’s take a look at the example below to understand it better.

class Car {
void run()
{
System.out.println(“car is running”);
}
}
class Audi extends Car {
void run()
{
System.out.prinltn(“Audi is running safely with 100km”);
}
public static void main(String args[])
{
Car b= new Audi(); //upcasting
b.run();
}
}
Q3. What is the difference between abstract classes and interfaces?
Abstract Class Interfaces
An abstract class can provide complete, default code and/or just the details that have to be overridden. An interface cannot provide any code at all,just the signature.
In case of abstract class, a class may extend only one abstract class. A Class may implement several interfaces.
An abstract class can have non-abstract methods. All methods of an Interface are abstract.
An abstract class can have instance variables. An Interface cannot have instance variables
An abstract class can have any visibility: public, private, protected. An Interface visibility must be public (or) none.
If we add a new method to an abstract class then we have the option of providing default implementation and therefore all the existing code might work properly If we add a new method to an Interface then we have to track down all the implementations of the interface and define implementation for the new method
An abstract class can contain constructors An Interface cannot contain constructors
Abstract classes are fast Interfaces are slow as it requires extra indirection to find corresponding method in the actual class
Q4. What is method overloading and method overriding?
Method Overloading :
In Method Overloading, Methods of the same class shares the same name but each method must have different number of parameters or parameters having different types and order.
Method Overloading is to “add” or “extend” more to method’s behavior.
It is a compile time polymorphism.
The methods must have different signature.
It may or may not need inheritance in Method Overloading.
Let’s take a look at the example below to understand it better.

class Adder {
Static int add(int a, int b)
{
return a+b;
}
Static double add( double a, double b)
{
return a+b;
}
public static void main(String args[])
{
System.out.println(Adder.add(11,11));
System.out.println(Adder.add(12.3,12.6));
}}
Method Overriding:
In Method Overriding, sub class have the same method with same name and exactly the same number and type of parameters and same return type as a super class.
Method Overriding is to “Change” existing behavior of method.
It is a run time polymorphism.
The methods must have same signature.
It always requires inheritance in Method Overriding.
Let’s take a look at the example below to understand it better.

class Car {
void run(){
System.out.println(“car is running”);
}
Class Audi extends Car{
void run()
{
System.out.prinltn(“Audi is running safely with 100km”);
}
public static void main( String args[])
{
Car b=new Audi();
b.run();
}
}
Q5. Can you override a private or static method in Java?
You cannot override a private or static method in Java. If you create a similar method with same return type and same method arguments in child class then it will hide the super class method; this is known as method hiding. Similarly, you cannot override a private method in sub class because it’s not accessible there. What you can do is create another private method with the same name in the child class. Let’s take a look at the example below to understand it better.

class Base {
private static void display() {
System.out.println(“Static or class method from Base”);
}
public void print() {
System.out.println(“Non-static or instance method from Base”);
}
class Derived extends Base {
private static void display() {
System.out.println(“Static or class method from Derived”);
}
public void print() {
System.out.println(“Non-static or instance method from Derived”);
}
public class test {
public static void main(String args[])
{
Base obj= new Derived();
obj1.display();
obj1.print();
}
}
Q6. What is multiple inheritance? Is it supported by Java?
MultipleInheritance – Java Interview Questions – EdurekaIf a child class inherits the property from multiple classes is known as multiple inheritance. Java does not allow to extend multiple classes.

The problem with multiple inheritance is that if multiple parent classes have a same method name, then at runtime it becomes difficult for the compiler to decide which method to execute from the child class.

Therefore, Java doesn’t support multiple inheritance. The problem is commonly referred as Diamond Problem.

Q7. What is association?
Association is a relationship where all object have their own lifecycle and there is no owner. Let’s take an example of Teacher and Student. Multiple students can associate with a single teacher and a single student can associate with multiple teachers but there is no ownership between the objects and both have their own lifecycle. These relationship can be one to one, One to many, many to one and many to many.

Q8. What do you mean by aggregation?
Aggregation is a specialized form of Association where all object have their own lifecycle but there is ownership and child object can not belongs to another parent object. Let’s take an example of Department and teacher. A single teacher can not belongs to multiple departments, but if we delete the department teacher object will not destroy.

Q9. What is composition in Java?
Composition is again specialized form of Aggregation and we can call this as a “death” relationship. It is a strong type of Aggregation. Child object dose not have their lifecycle and if parent object deletes all child object will also be deleted. Let’s take again an example of relationship between House and rooms. House can contain multiple rooms there is no independent life of room and any room can not belongs to two different house if we delete the house room will automatically delete.

In case you are facing any challenges with these java interview questions, please comment your problems in the section below. Apart from this Java Interview Questions Blog, if you want to get trained from professionals on this technology, you can opt for a structured training from edureka! Click below to know more.

Learn Java From Experts

Servlets Interview Questions
Q1. What is a servlet?
Java Servlet is server side technologies to extend the capability of web servers by providing support for dynamic response and data persistence.
The javax.servlet and javax.servlet.http packages provide interfaces and classes for writing our own servlets.
All servlets must implement the javax.servlet.Servlet interface, which defines servlet lifecycle methods. When implementing a generic service, we can extend the GenericServlet class provided with the Java Servlet API. The HttpServlet class provides methods, such as doGet() and doPost(), for handling HTTP-specific services.
Most of the times, web applications are accessed using HTTP protocol and thats why we mostly extend HttpServlet class. Servlet API hierarchy is shown in below image.
Servlet – Java Interview Questions – Edureka

Q2. What are the differences between Get and Post methods?
Get Post
Limited amount of data can be sent because data is sent in header. Large amount of data can be sent because data is sent in body.
Not Secured because data is exposed in URL bar. Secured because data is not exposed in URL bar.
Can be bookmarked Cannot be bookmarked
Idempotent Non-Idempotent
It is more efficient and used than Post It is less efficient and used
Q3. What is Request Dispatcher?
RequestDispatcher interface is used to forward the request to another resource that can be HTML, JSP or another servlet in same application. We can also use this to include the content of another resource to the response.

There are two methods defined in this interface:

1.void forward()

2.void include()

ForwardMethod – Java Interview Questions – Edureka
IncludeMethod – Java Interview Questions – Edureka

Q4. What are the differences between forward() method and sendRedirect() methods?
Forward() method SendRedirect() method
forward() sends the same request to another resource. sendRedirect() method sends new request always because it uses the URL bar of the browser.
forward() method works at server side. sendRedirect() method works at client side.
forward() method works within the server only. sendRedirect() method works within and outside the server.
Q5. What is the life-cycle of a servlet?
There are 5 stages in the lifecycle of a servlet:LifeCycleServlet – Java Interview Questions – Edureka

Servlet is loaded
Servlet is instantiated
Servlet is initialized
Service the request
Servlet is destroyed
Q6. How does cookies work in Servlets?
Cookies are text data sent by server to the client and it gets saved at the client local machine.
Servlet API provides cookies support through javax.servlet.http.Cookie class that implements Serializable and Cloneable interfaces.
HttpServletRequest getCookies() method is provided to get the array of Cookies from request, since there is no point of adding Cookie to request, there are no methods to set or add cookie to request.
Similarly HttpServletResponse addCookie(Cookie c) method is provided to attach cookie in response header, there are no getter methods for cookie.
Q7. What are the differences between ServletContext vs ServletConfig?
The difference between ServletContext and ServletConfig in Servlets JSP is in below tabular format.

ServletConfig ServletContext
Servlet config object represent single servlet It represent whole web application running on particular JVM and common for all the servlet
Its like local parameter associated with particular servlet Its like global parameter associated with whole application
It’s a name value pair defined inside the servlet section of web.xml file so it has servlet wide scope ServletContext has application wide scope so define outside of servlet tag in web.xml file.
getServletConfig() method is used to get the config object getServletContext() method is used to get the context object.
for example shopping cart of a user is a specific to particular user so here we can use servlet config To get the MIME type of a file or application session related information is stored using servlet context object.
Q8. What are the different methods of session management in servlets?
Session is a conversational state between client and server and it can consists of multiple request and response between client and server. Since HTTP and Web Server both are stateless, the only way to maintain a session is when some unique information about the session (session id) is passed between server and client in every request and response.

Some of the common ways of session management in servlets are:

User Authentication
HTML Hidden Field
Cookies
URL Rewriting
Session Management API

SessionManagement – Java Interview Questions – Edureka
In case you are facing any challenges with these java interview questions, please comment your problems in the section below. Apart from this Java Interview Questions Blog, if you want to get trained from professionals on this technology, you can opt for a structured training from edureka! Click below to know more.

Get Java Certified

JDBC Interview Questions
Q1. What is JDBC Driver?
JDBC Driver is a software component that enables java application to interact with the database. There are 4 types of JDBC drivers:

JDBC-ODBC bridge driver
Native-API driver (partially java driver)
Network Protocol driver (fully java driver)
Thin driver (fully java driver)
Q2. What are the steps to connect to a database in java?
Registering the driver class
Creating connection
Creating statement
Executing queries
Closing connection
Q3. What are the JDBC API components?
The java.sql package contains interfaces and classes for JDBC API.

Interfaces:
Connection
Statement
PreparedStatement
ResultSet
ResultSetMetaData
DatabaseMetaData
CallableStatement etc.
Classes:
DriverManager
Blob
Clob
Types
SQLException etc.
Q4. What is the role of JDBC DriverManager class?
The DriverManager class manages the registered drivers. It can be used to register and unregister drivers. It provides factory method that returns the instance of Connection.

Q5. What is JDBC Connection interface?
The Connection interface maintains a session with the database. It can be used for transaction management. It provides factory methods that returns the instance of Statement, PreparedStatement, CallableStatement and DatabaseMetaData.

ConnectionInterface – Java Interview Questions – Edureka
Q6. What is the purpose of JDBC ResultSet interface?
The ResultSet object represents a row of a table. It can be used to change the cursor pointer and get the information from the database.

Q7. What is JDBC ResultSetMetaData interface?
The ResultSetMetaData interface returns the information of table such as total number of columns, column name, column type etc.

Q8. What is JDBC DatabaseMetaData interface?
The DatabaseMetaData interface returns the information of the database such as username, driver name, driver version, number of tables, number of views etc.

Q9. What do you mean by batch processing in JDBC?
Batch processing helps you to group related SQL statements into a batch and execute them instead of executing a single query. By using batch processing technique in JDBC, you can execute multiple queries which makes the performance faster.

Q10. What is the difference between execute, executeQuery, executeUpdate?
Statement execute(String query) is used to execute any SQL query and it returns TRUE if the result is an ResultSet such as running Select queries. The output is FALSE when there is no ResultSet object such as running Insert or Update queries. We can use getResultSet() to get the ResultSet and getUpdateCount() method to retrieve the update count.

Statement executeQuery(String query) is used to execute Select queries and returns the ResultSet. ResultSet returned is never null even if there are no records matching the query. When executing select queries we should use executeQuery method so that if someone tries to execute insert/update statement it will throw java.sql.SQLException with message “executeQuery method can not be used for update”.

Statement executeUpdate(String query) is used to execute Insert/Update/Delete (DML) statements or DDL statements that returns nothing. The output is int and equals to the row count for SQL Data Manipulation Language (DML) statements. For DDL statements, the output is 0.

You should use execute() method only when you are not sure about the type of statement else use executeQuery or executeUpdate method.

********************************************************************************************************************************************************

Abstraction
Abstraction is the concept of hiding the internal details and describing things in simple terms. For example, a method that adds two integers. The method internal processing is hidden from outer world. There are many ways to achieve abstraction in object oriented programming, such as encapsulation and inheritance.

A java program is also a great example of abstraction. Here java takes care of converting simple statements to machine language and hides the inner implementation details from outer world.

Encapsulation
Encapsulation is the technique used to implement abstraction in object oriented programming. Encapsulation is used for access restriction to a class members and methods.

Access modifier keywords are used for encapsulation in object oriented programming. For example, encapsulation in java is achieved using private, protected and public keywords.

Polymorphism
Polymorphism is the concept where an object behaves differently in different situations. There are two types of polymorphism – compile time polymorphism and runtime polymorphism.

Compile time polymorphism is achieved by method overloading. For example, we can have a class as below.

public class Circle {

public void draw(){
System.out.println(“Drwaing circle with default color Black and diameter 1 cm.”);
}

public void draw(int diameter){
System.out.println(“Drwaing circle with default color Black and diameter”+diameter+” cm.”);
}

public void draw(int diameter, String color){
System.out.println(“Drwaing circle with color”+color+” and diameter”+diameter+” cm.”);
}
}
Here we have multiple draw methods but they have different behavior. This is a case of method overloading because all the methods name is same and arguments are different. Here compiler will be able to identify the method to invoke at compile time, hence it’s called compile time polymorphism.

Runtime polymorphism is implemented when we have “IS-A” relationship between objects. This is also called as method overriding because subclass has to override the superclass method for runtime polymorphism. If we are working in terms of superclass, the actual implementation class is decided at runtime. Compiler is not able to decide which class method will be invoked. This decision is done at runtime, hence the name as runtime polymorphism or dynamic method dispatch.

package com.journaldev.test;

public interface Shape {

public void draw();
}
package com.journaldev.test;

public class Circle implements Shape{

@Override
public void draw(){
System.out.println(“Drwaing circle”);
}

}
package com.journaldev.test;

public class Square implements Shape {

@Override
public void draw() {
System.out.println(“Drawing Square”);
}

}
Shape is the superclass and there are two subclasses Circle and Square. Below is an example of runtime polymorphism.

Shape sh = new Circle();
sh.draw();

Shape sh1 = getShape(); //some third party logic to determine shape
sh1.draw();
In above examples, java compiler don’t know the actual implementation class of Shape that will be used at runtime, hence runtime polymorphism.

Inheritance
Inheritance is the object oriented programming concept where an object is based on another object. Inheritance is the mechanism of code reuse. The object that is getting inherited is called superclass and the object that inherits the superclass is called subclass.

We use extends keyword in java to implement inheritance. Below is a simple example of inheritance in java.

package com.journaldev.java.examples1;

class SuperClassA {

public void foo(){
System.out.println(“SuperClassA”);
}

}

class SubClassB extends SuperClassA{

public void bar(){
System.out.println(“SubClassB”);
}

}

public class Test {
public static void main(String args[]){
SubClassB a = new SubClassB();

a.foo();
a.bar();
}
}
Association
Association is the OOPS concept to define the relationship between objects. Association defines the multiplicity between objects. For example Teacher and Student objects. There is one to many relationship between a teacher and students. Similarly a student can have one to many relationship with teacher objects. However both student and teacher objects are independent of each other.

Aggregation
Aggregation is a special type of association. In aggregation, objects have their own life cycle but there is an ownership. Whenever we have “HAS-A” relationship between objects and ownership then it’s a case of aggregation.

Composition
Composition is a special case of aggregation. Composition is a more restrictive form of aggregation. When the contained object in “HAS-A” relationship can’t exist on it’s own, then it’s a case of composition. For example, House has-a Room. Here room can’t exist without house.

Technical Round
================
I was called for Technical round soon after completion of my HR.
->I entered panel room ,only one lady member was there.
->Asked me to introduce myself.
->during my intro she took a glance on my resume and my application form.
->Though she was looking strict, actually she was not that much strict.
->It was about 25 min.
->She was noting my grades while i was answering questions.
Few Questions were:-
——————–
1.Tell me about your Project.(Explained her clearly and Confidently)
2.Did you do any other projects other than this.(No)
3.What is your role in the project.(said)
4.What is Trigger.(answered )
5.Explain situation where triggers are used.(answered but not perfectly, said I dont know much about triggers)
6.What is Semaphore(answered)
7.What is deadlock(answered)
8.What is OOPs(answered)
9.What is Method Overloading and Method Over Riding(answered)
10.What are Threads(answered)
11.Write a program on threads(I said i just know the methods and cant write program on threads)
12.Write Program of your choice then?(Wrote a program on Inheritance and expalined her)
————————–
Thats all TR over,I was Not much satisfied about this round as I made some mistake in the code written by me.
I answered remaining questions very well which ignited me a hope about the job.(Few of them Rejected from TR Itself without Attending HR,as I said TR&HR were going on simultaneously)
————————————
Finally came home, waiting for a mail from college for results(183/630 selected).
Thats it done!!!!!
got selected…!
**Applied **
*****If you cleared aptitude 1st round you are 70% into the company,as most of the filtration would be done in this round****
**If TR is cleared 90% is done, filtration will be less compared to 1st round***
**Finally HR where most of the people who attended it would get selected irrespective of very few people**
Hope it would be Useful to you.
Thank You.

*********************************************************************
Technical MCQ Round

The technical MCQ was very tough for us, though for my friends in other slots it was quite easy. Many people from our slot got rejected.The questions were conceptual, output based. You had to have enough coding experience to skim through a code to get the idea of what it did since you won’t have time to dry run the program. You also need to have a general idea of standard questions like Armstrong number, perfect number etc. Since they trick us with those pseudo codes.

Technical Interview Round

The Technical Interview round was moderate.First, they ask you to tell about yourself. They check your CV thoroughly and ask you from there. Don’t lie on your CV, you must be prepared to answer anything and everything related to what you have put in your CV. They asked questions from DBMS, Algorithms, Software Engineering and the subjects that you have put on your CV. Some of my friends were asked about Collection Framework of Java and other tough questions.

They also ask HR questions in this round too. Questions like “Why should I hire you?”, What will you do for the company? etc.

HR Interview Round

The HR round was more of a formality. Though if the Technical Interview was not too great, you will get grilled. But if your Technical was great then they will just chat with you.

All of us who cleared Technical got selected.

My Advice: Show confidence, even if you don’t feel like it. Keep eye contact always. From my experience also be very careful about your selection process. If you feel that some problem has occurred like for my case ask your TPO immediately and don’t give up.

I got the job but if I had gone home after not hearing my name after Aptitude test, then I would have regretted it.

***************************************************************************************

capgemini drive ( call based THROUGH COCUBE ONLY 2017 BATCH )

COCUBE TEST ONLY

DRIVE DATE 31ST MARCH

***********************************************************************************************

Abstraction
Abstraction is the concept of hiding the internal details and describing things in simple terms. For example, a method that adds two integers. The method internal processing is hidden from outer world. There are many ways to achieve abstraction in object oriented programming, such as encapsulation and inheritance.

A java program is also a great example of abstraction. Here java takes care of converting simple statements to machine language and hides the inner implementation details from outer world.

Encapsulation
Encapsulation is the technique used to implement abstraction in object oriented programming. Encapsulation is used for access restriction to a class members and methods.

Access modifier keywords are used for encapsulation in object oriented programming. For example, encapsulation in java is achieved using private, protected and public keywords.

Polymorphism
Polymorphism is the concept where an object behaves differently in different situations. There are two types of polymorphism – compile time polymorphism and runtime polymorphism.

Compile time polymorphism is achieved by method overloading. For example, we can have a class as below.

public class Circle {

public void draw(){
System.out.println(“Drwaing circle with default color Black and diameter 1 cm.”);
}

public void draw(int diameter){
System.out.println(“Drwaing circle with default color Black and diameter”+diameter+” cm.”);
}

public void draw(int diameter, String color){
System.out.println(“Drwaing circle with color”+color+” and diameter”+diameter+” cm.”);
}
}
Here we have multiple draw methods but they have different behavior. This is a case of method overloading because all the methods name is same and arguments are different. Here compiler will be able to identify the method to invoke at compile time, hence it’s called compile time polymorphism.

Runtime polymorphism is implemented when we have “IS-A” relationship between objects. This is also called as method overriding because subclass has to override the superclass method for runtime polymorphism. If we are working in terms of superclass, the actual implementation class is decided at runtime. Compiler is not able to decide which class method will be invoked. This decision is done at runtime, hence the name as runtime polymorphism or dynamic method dispatch.

package com.journaldev.test;

public interface Shape {

public void draw();
}
package com.journaldev.test;

public class Circle implements Shape{

@Override
public void draw(){
System.out.println(“Drwaing circle”);
}

}
package com.journaldev.test;

public class Square implements Shape {

@Override
public void draw() {
System.out.println(“Drawing Square”);
}

}
Shape is the superclass and there are two subclasses Circle and Square. Below is an example of runtime polymorphism.

Shape sh = new Circle();
sh.draw();

Shape sh1 = getShape(); //some third party logic to determine shape
sh1.draw();
In above examples, java compiler don’t know the actual implementation class of Shape that will be used at runtime, hence runtime polymorphism.

Inheritance
Inheritance is the object oriented programming concept where an object is based on another object. Inheritance is the mechanism of code reuse. The object that is getting inherited is called superclass and the object that inherits the superclass is called subclass.

We use extends keyword in java to implement inheritance. Below is a simple example of inheritance in java.

package com.journaldev.java.examples1;

class SuperClassA {

public void foo(){
System.out.println(“SuperClassA”);
}

}

class SubClassB extends SuperClassA{

public void bar(){
System.out.println(“SubClassB”);
}

}

public class Test {
public static void main(String args[]){
SubClassB a = new SubClassB();

a.foo();
a.bar();
}
}
Association
Association is the OOPS concept to define the relationship between objects. Association defines the multiplicity between objects. For example Teacher and Student objects. There is one to many relationship between a teacher and students. Similarly a student can have one to many relationship with teacher objects. However both student and teacher objects are independent of each other.

Aggregation
Aggregation is a special type of association. In aggregation, objects have their own life cycle but there is an ownership. Whenever we have “HAS-A” relationship between objects and ownership then it’s a case of aggregation.

Composition
Composition is a special case of aggregation. Composition is a more restrictive form of aggregation. When the contained object in “HAS-A” relationship can’t exist on it’s own, then it’s a case of composition. For example, House has-a Room. Here room can’t exist without house.

Technical Round
================
I was called for Technical round soon after completion of my HR.
->I entered panel room ,only one lady member was there.
->Asked me to introduce myself.
->during my intro she took a glance on my resume and my application form.
->Though she was looking strict, actually she was not that much strict.
->It was about 25 min.
->She was noting my grades while i was answering questions.
Few Questions were:-
——————–
1.Tell me about your Project.(Explained her clearly and Confidently)
2.Did you do any other projects other than this.(No)
3.What is your role in the project.(said)
4.What is Trigger.(answered )
5.Explain situation where triggers are used.(answered but not perfectly, said I dont know much about triggers)
6.What is Semaphore(answered)
7.What is deadlock(answered)
8.What is OOPs(answered)
9.What is Method Overloading and Method Over Riding(answered)
10.What are Threads(answered)
11.Write a program on threads(I said i just know the methods and cant write program on threads)
12.Write Program of your choice then?(Wrote a program on Inheritance and expalined her)
————————–
Thats all TR over,I was Not much satisfied about this round as I made some mistake in the code written by me.
I answered remaining questions very well which ignited me a hope about the job.(Few of them Rejected from TR Itself without Attending HR,as I said TR&HR were going on simultaneously)
————————————
Finally came home, waiting for a mail from college for results(183/630 selected).
Thats it done!!!!!
got selected…!
**Applied **
*****If you cleared aptitude 1st round you are 70% into the company,as most of the filtration would be done in this round****
**If TR is cleared 90% is done, filtration will be less compared to 1st round***
**Finally HR where most of the people who attended it would get selected irrespective of very few people**
Hope it would be Useful to you.
Thank You.

*********************************************************************
Technical MCQ Round

The technical MCQ was very tough for us, though for my friends in other slots it was quite easy. Many people from our slot got rejected.The questions were conceptual, output based. You had to have enough coding experience to skim through a code to get the idea of what it did since you won’t have time to dry run the program. You also need to have a general idea of standard questions like Armstrong number, perfect number etc. Since they trick us with those pseudo codes.

Technical Interview Round

The Technical Interview round was moderate.First, they ask you to tell about yourself. They check your CV thoroughly and ask you from there. Don’t lie on your CV, you must be prepared to answer anything and everything related to what you have put in your CV. They asked questions from DBMS, Algorithms, Software Engineering and the subjects that you have put on your CV. Some of my friends were asked about Collection Framework of Java and other tough questions.

They also ask HR questions in this round too. Questions like “Why should I hire you?”, What will you do for the company? etc.

HR Interview Round

The HR round was more of a formality. Though if the Technical Interview was not too great, you will get grilled. But if your Technical was great then they will just chat with you.

All of us who cleared Technical got selected.

My Advice: Show confidence, even if you don’t feel like it. Keep eye contact always. From my experience also be very careful about your selection process. If you feel that some problem has occurred like for my case ask your TPO immediately and don’t give up.

I got the job but if I had gone home after not hearing my name after Aptitude test, then I would have regretted it.

*************************************************************************************

KPIT COMPANY  ( CALL BASED 2017 BATCH )

PROFILE DEVELOPER

DRIVE DATE 28th march

 

Devarabisanahalli, Sarjapur Outer Ring, Bellandur, Bengaluru, Karnataka

************************************************************************************** 

***********************
******************************************************************************
1. Online Technical aptitude test
2. Group discussion
3. Technical test
4. Hr interview
****************************************************************
Interview Questions
*********************************************************************************
diff b/w c and c++
Answer Question
what is object and class in c++
Answer Question
what are functions and what is recursion
Answer Question
what is function declaration and what is function definition
What is the difference between declaration and definition of a variable/function
Ans: Declaration of a variable/function simply declares that the variable/function exists somewhere in the program but the memory is not allocated for them. But the declaration of a variable/function serves an important role. And that is the type of the variable/function. Therefore, when a variable is declared, the program knows the data type of that variable. In case of function declaration, the program knows what are the arguments to that functions, their data types, the order of arguments and the return type of the function. So that’s all about declaration. Coming to the definition, when we define a variable/function, apart from the role of declaration, it also allocates memory for that variable/function. Therefore, we can think of definition as a super set of declaration. (or declaration as a subset of definition). From this explanation, it should be obvious that a variable/function can be declared any number of times but it can be defined only once. (Remember the basic principle that you can’t have two locations of the same variable/function).
   // This is only declaration. y is not allocated memory by this statement
  extern int y;
  // This is both declaration and definition, memory to x is allocated by this statement.
  int x;
What are different storage class specifiers in C?
Ans: auto, register, static, extern
What is scope of a variable? How are variables scoped in C?
Ans: Scope of a variable is the part of the program where the variable may directly be accessible. In C, all identifiers are lexically (or statically) scoped. See this for more details.
How will you print “Hello World” without semicolon?
Ans:
int main(void)
{
    if (printf(“Hello World”)) ;
}
Run on IDE
See print “Geeks for Geeks” without using a semicolon for answer.
When should we use pointers in a C program?
1. To get address of a variable
2. For achieving pass by reference in C: Pointers allow different functions to share and modify their local variables.
3. To pass large structures so that complete copy of the structure can be avoided.
C
4. To implement “linked” data structures like linked lists and binary trees.
What is NULL pointer?
Ans: NULL is used to indicate that the pointer doesn’t point to a valid location. Ideally, we should initialize pointers as NULL if we don’t know their value at the time of declaration. Also, we should make a pointer NULL when memory pointed by it is deallocated in the middle of a program.
What is Dangling pointer?
Ans: Dangling Pointer is a pointer that doesn’t point to a valid memory location. Dangling pointers arise when an object is deleted or deallocated, without modifying the value of the pointer, so that the pointer still points to the memory location of the deallocated memory. Following are examples.
// EXAMPLE 1
int *ptr = (int *)malloc(sizeof(int));
………….
………….
free(ptr);
// ptr is a dangling pointer now and operations like following are invalid
*ptr = 10;  // or printf(“%d”, *ptr);
Run on IDE
// EXAMPLE 2
int *ptr = NULL
{
   int x  = 10;
   ptr = &x;
}
// x goes out of scope and memory allocated to x is free now.
// So ptr is a dangling pointer now.
Run on IDE
What is memory leak? Why it should be avoided
Ans: Memory leak occurs when programmers create a memory in heap and forget to delete it. Memory leaks are particularly serious issues for programs like daemons and servers which by definition never terminate.
/* Function with memory leak */
#include <stdlib.h>
void f()
{
   int *ptr = (int *) malloc(sizeof(int));
   /* Do some work */
   return; /* Return without freeing ptr*/
}
Run on IDE
What are local static variables? What is their use?
Ans:A local static variable is a variable whose lifetime doesn’t end with a function call where it is declared. It extends for the lifetime of complete program. All calls to the function share the same copy of local static variables. Static variables can be used to count the number of times a function is called. Also, static variables get the default value as 0. For example, the following program prints “0 1”
#include <stdio.h>
void fun()
{
    // static variables get the default value as 0.
    static int x;
    printf(“%d “, x);
    x = x + 1;
}
int main()
{
    fun();
    fun();
    return 0;
}
// Output: 0 1
***********************************************************************************************************************

 

INFOSYS COMPANY (CALL BASED ONLINE TEST FOR 2016, 2017 )

FOR ONLINE TEST

DRIVE DATE 7th april

Address: Acharya Dr. Sarvepalli Radhakrishnan Road, Soldevanahalli, Hesaraghatta Main Road, Bengaluru, Karnataka 560090

UPLOAD ALL QUESTION PAPER

JUST ONE CLICK AND DOWNLOAD PAPER

***********************************************************

Infosys Placement paper

INFOSYS COMPANY ( ONLY THOSE CLEAR ONLINE TEST IN BANGALORE)

DRIVE DATE 26 MARCH

UPLOAD ALL QUESTION PAPER

JUST ONE CLICK AND DOWNLOAD PAPER

INFOSYS COMPANY INTERVIEW

 

 

cognizant Technology Solutions Pvt Ltd

ANAYLST  TARINEE

****************************************************

ITIS PROFILE ONLY
********************************************

DRIVE DATE  24th MARCH  AND 27TH MARCH  2018
Address: Manayata Tech Park, Nagavara, Bengaluru, Karnataka 560045
**********************************************************************

DOWNLOAD LASTEST INTERVIEW QUESTION WITH SOLVED PAPER

***********************************************************

cognizant Technology Solutions Pvt Ltd ITIS

************************************************

Attra_Infotech_Preliminary_Test_paper_for_Operational_Specialist :-
*Test Details:

Test comprises of 25 questions
Test duration would be 30 minutes

 

 

garsko  company for  qa profile

 

 

poel company  placement paper

 

 

Cognizant Technology Solutions Pvt Ltd

PROGRAM ANAYLST

DRIVE DATE  17th MARCH 2018
Address: Manayata Tech Park, Nagavara, Bengaluru, Karnataka 560045
**********************************************************************

DOWNLOAD LASTEST INTERVIEW QUESTION WITH SOLVED PAPER

 

Cognizant Technology Solutions Pvt Ltd QUESTION BY JOBHUNTER TEAM

 

 

***************************************************************************

INFOSYS COMPANY  (CALL BASED ONLINE  TEST FOR 2016, 2017 )

FOR ONLINE TEST

DRIVE DATE   24TH MARCH

AMC Engineering College

Address18th K.M. Bannerghatta Main Road, Bengaluru, Karnataka 560083

Kammavari Sangha Institute of Technology

AddressNo. 14, Kanakapura Main Road, Raghuvanahalli, Municipal Corporation Layout, Bengaluru, Karnataka 560062

UPLOAD ALL QUESTION PAPER

JUST ONE CLICK AND DOWNLOAD PAPER

***********************************************************

Infosys Placement paper

********************************************************************

CTS  ONLINE TEST BY AMCAT   FOR 2017  BATCH

 

Cognizant Programming Questions with Solutions

CTS CURRENT  CODING PROBLEMS PATTERN AND SYLLABUS

JUST  DOWNLOAD PAPER

***********************************************

cts coding question

**********************************************

 

 

INFOSYS COMPANY ( ONLY THOSE CLEAR ONLINE TEST IN BANGALORE)

DRIVE DATE 12 MARCH

Address: Rukmini Knowledge Park, Kattigenahalli, Yelahanka, Near Border Security Bustop, Bengaluru, Karnataka 560064

UPLOAD ALL QUESTION PAPER

JUST ONE CLICK AND DOWNLOAD PAPER

INFOSYS COMPANY INTERVIEW

*********************************************************

********************************************************

 

 

UTF/QTP NOTES BY JOBHUNTER TEAM

*********************************************************

**UFT NOTES BY JOBHUNTER

***************************************************************

I HOPE THESE USEFUL FOR YOU

BEST OF LUCK
JOBHUNTER TEAM

 

 

 

PHP NOTES BY JOBHUNTER TEAM

*********************************************************

PHP NOTES BY JOBHUNTER TEAM

***************************************************************

I HOPE THESE USEFUL FOR YOU

BEST OF LUCK
JOBHUNTER TEAM

 

HADOOP  NOTES BY JOBHUNTER TEAM

*********************************************************

**HADOOP NOTES BY JOBHUNTER TEAM

***************************************************************

I HOPE THESE USEFUL FOR YOU

BEST OF LUCK
JOBHUNTER TEAM

 

HTML NOTES BY JOBHUNTER TEAM

*********************************************************

**HTML NOTES BY JOBHUNTER TEAM

***************************************************************

I HOPE THESE USEFUL FOR YOU

BEST OF LUCK
JOBHUNTER TEAM

 

 

 

DOWNLOAD LASTEST INTERVIEW QUESTION WITH SOLVED PAPER

Cognizant Technology Solutions Pvt Ltd QUESTION BY JOBHUNTER TEAM

I HOPE THESE WILL BE VERY MUCH USEFUL TO YOU

 

 

 

PYTHON NOTES BY JOBHUNTER TEAM

*********************************************************

**

PYTHON NOTES BY JOBHUNTER TEAM

**********************************************************

I HOPE THESE USEFUL FOR YOU

BEST OF LUCK
JOBHUNTER TEAM

 

 

Tracxn Technologies Pvt. Ltd.
drive date 3-3-2018
second round question

********************************************

 

***************************************************

 

 

ANGULAR JS NOTES WITH SCRIPT JS AND INTERVIEW QUESTION BY ANGULAR JS CODE BY JOBHUNTER TEAMS

JUST ONE CLICK AND DOWNLOAD PAPER

*************************************************************

ANGULAR NOTES WITH SCRIPT JS CODE BY JOBHUNTER TEAMS
*********************************************************
I HOPE THESE HELPFUL TO ALL YOU

THANKS
JOBHUNTER TEAM

 

 

TODAY TRVAELYARRI QUESTION PAPER
*******************************************************

*******************************************************

Cognizant Technology Solutions Pvt Ltd

PROGRAM ANAYLST

DRIVE DATE 3RD MARCH 2018
Address: Manayata Tech Park, Nagavara, Bengaluru, Karnataka 560045
**********************************************************************

DOWNLOAD LASTEST INTERVIEW QUESTION WITH SOLVED PAPER

Cognizant Technology Solutions Pvt Ltd QUESTION BY JOBHUNTER TEAM

I HOPE THESE WILL BE VERY MUCH USEFUL TO YOU

 

 

PEOL Technologies ! We have BE/MCA 2016/2017 Requirement @ PEOL Technologies Pvt Ltd.

Job Position : SAP Development

Job Category : IT | Software

Job Location(s) : Bangalore / Mumbai (Should be open for both)

Qualification – Eligibility Criteria : (Mandatory)
# BE (CS/IS) / MCA / M.Sc (CS)
# 55% and Above in Degree and NO Year Gaps from 10th to Degree
# Year Of Passing: 2016/2017

Desired Experience : 0 Years

Desired Skills : C, C++, JAVA, JavaScript, HTML, CSS

Other Requirement :
# Should be Flexible to travel across the globe.

Please Carry below documents (mandatory) :
# Updated Resume Copy
# A printout of this ChetanaS job posting
# Photo ID Proof (Passport/PAN-Card/Aadhar-Card/Voter-ID/Driving-License/College-ID)

Walk-In Date : On 10th March 2018 (Saturday)

Walk-In Venue : Will be sent to the shortlisted candidates

How to Apply for this Job ?

*******************************************
DRIVE DATE 10 MARCH
********************************************

LINK TO APPLY
********************************
http://my-jobhunter.com/bangalore/bangalore-new-links/
*********************************

PLACEMENT PAPER

**********************************
POEL COMPANY PLACEMENT PAPER
***********************************************

 

******************************************
TERRA LOGIC COMPANY
***************************************
Freshers drive on 3rd & 4th March 2018@ Bangalore.
Candidates meeting the following criteria can apply:

Educational Qualification: BE/B.Tech/MCA/ME/M.Tech
Branch: Computer Science/ IT/ ECE
Year of pass: 2017 and 2018 only
Minimum percentage: 65%
Mandatory skills: Excellent programming skills in any one of the language (Networking, C/C++/Java/Python/Perl or any programming language)
Should have good communication skills in English
Passion to build career in programming and Software development
Job Details
Company Name: Terralogic Software Solutions Pvt Ltd
Work location: Bangalore

DRIVE DATE 3RD MARCH
LINK TO APPLY
********************************
http://my-jobhunter.com/bangalore/bangalore-new-links/
*********************************

PLACEMENT -PAPER

***********************************************

TERRA LOGIC QUESTION

*****************************************************

 

 

 

 

Cognizant Programming Questions with Solutions

CTS CURRENT  CODING PROBLEMS PATTERN AND SYLLABUS

JUST  DOWNLOAD PAPER

********************************************

cts coding question

*******************************************

DATA STURTCUTRE NOTES & INTERVIEW QUESTION BY JOBHUNTER

JUST ONE CLICK DOWNLOAD READ

************************************************************

DATA STRUCTURE TOPIC BY JOBHUNTER TEAM
***********************************************************
HIBERNATES NOTES & INTERVIEW QUESTION BY JOBHUNTER

JUST ONE CLICK DOWNLOAD READ

**********************************************************

HIBERNATE NOTES BY JOBHUNTER TEAM

********************************************************

 

TRACXN COMPANY FOR FRESHER ( CALL BASED 2016, 2017 THROUGH NAKURI.COM )

DRIVE DATE 3RD MARCH

Address: Sector 6, HSR Layout, Bengaluru, Karnataka 560102

****************************************************************

tarxcn company

****************************************

SPRING  NOTES  BY  JOBHUNTER TEAM

*************************************************************

SPRING NOTES BY JOBHUNTER TEAM

*****************************************************

*****************************************************************

MANUAL TESTING NOTES  BY JOBHUNTER

***************************************************************************

MANUAL TESTING NOTES BY JOBHUNTER TEAM

*********************************************************************************

 

***********************************************************************************************
ADVANCE JAVA NOTES & ADVANCE JAVA INTERVIEW QUESTION BY JOBHUNTER TEAM
*********************************************************************************************

JUST  CLICKS  DOWNLOAD

*******************************************************

Advanced JAVA

*************************************************************

JAVA    NOTES  WITH  INTERVIEW   QUESTION

BY   JOBHUNTER TEAMS

************************************************

Basic Java Interview Questions

************************************************

 

INFOSYS COMPANY PLACEMENT PAPER FOR 2016, 2017 BATCH QUESTION PAPER

UPLOAD ALL QUESTION PAPER

JUST  ONE  CLICK  AND  DOWNLOAD PAPER

*********************************************************

 Infosys Placement paper

***************************************************************

 

INOIDEA QUESTION PAPER

 

 

 

 

KENSCIO QUESTION PAPER

UNIVISION TECHNOLOGY CONSULTING PRIVATE LIMITED …

QUESTION  PAPER

 

 

 

 

 

 

 

 

Next Novity   question  paper

 

BLUECHIP INDIA PVT TLD

TODAY QUESTION PAPER

SOFTWARE AG  LASTEST  QUESTION PAPER

lumen data  question paper

 

 

AMCAT  QUESTION PAPER

 

 

ENTOSS  COMPANY  QUESTION  PAPER

 

HUWAEI BANGALORE   QUESTION  PAPER

 

 

 

 

 

 elitmus question paper for  2017 batch

 

 

manhattan  company question  paper

softwarwe

ag  question  paper

 

 

QuintilesIMS  health  question paper

Bangalore new links

42 Comments

    • Apsys-Technologies- company

      ***************************************
      written test
      **************************************************
      Problems on Trains
      Height and Distance
      Simple Interest
      Profit and Loss
      Percentage
      Calendar
      Average
      Volume and Surface Area
      Numbers
      Problems on H.C.F and L.C.M
      Simplification
      Surds and Indices
      Chain Rule
      Boats and Streams
      Logarithm
      Stocks and Shares
      True Discount
      Odd Man Out and Series
      Time and Distance
      Time and Work
      Compound Interest
      Partnership
      Problems on Ages
      Clock
      Area
      Permutation and Combination
      Problems on Numbers
      Decimal Fraction
      Square Root
      ******************************************************************
      Why is Java called the ‘Platform Independent Programming Language’?

      Platform independence means that execution of your program does not dependent on type of operating system(it could be any : Linux, windows, Mac ..etc). So compile code only once and run it on any System (In C/C++, we need to compile the code for every machine on which we run it). Java is both compiler(javac) and interpreter(jvm) based lauguage. Your java source code is first compiled into byte code using javac compiler. This byte code can be easily converted to equivalent machine code using JVM. JVM(Java Virtual Machine) is available in all operating systems we install. Hence, byte code generated by javac is universal and can be converted to machine code on any operating system, this is the reason why java is platform independent.

      Explain Final keyword in java?

      Final keyword in java is used to restrict usage of variable, class and method.

      Variable: Value of Final variable is constant, you can not change it.
      Method: you can’t override a Final method.
      Class: you can’t inherit from Final class.

      Refer this for details

      When is the super keyword used?

      super keyword is used to refer:

      immediate parent class constructor,
      immediate parent class variable,
      immediate parent class method.
      Refer this for details.

      What is the difference between StringBuffer and String?

      String is an Immutable class, i.e. you can not modify its content once created. While StringBuffer is a mutable class, means you can change its content later. Whenever we alter content of String object, it creates a new string and refer to that,it does not modify the existing one. This is the reason that the performance with StringBuffer is better than with String.
      Refer this for details.

      Why multiple inheritance is not supported in java?

      Java supports multiple inheritance but not through classes, it supports only through its interfaces. The reason for not supporting multiple inheritance is to avoid the conflict and complexity arises due to it and keep Java a Simple Object Oriented Language. If we recall this in C++, there is a special case of multiple inheritance (diamond problem) where you have a multiple inheritance with two classes which have methods in conflicts. So, Java developers decided to avoid such conflicts and didn’t allow multiple inheritance through classes at all.

      Can a top level class be private or protected?

      Top level classes in java can’t be private or protected, but inner classes in java can. The reason for not making a top level class as private is very obvious, because nobody can see a private class and thus they can not use it. Declaring a class as protected also doesn’t make any sense. The only difference between default visibility and protected visibility is that we can use it in any package by inheriting it. Since in java there is no such concept of package inheritance, defining a class as protected is no different from default.

      What is the difference between ‘throw’ and ‘throws’ in Java Exception Handling?

      Following are the differences between two:

      throw keyword is used to throw Exception from any method or static block whereas throws is used to indicate that which Exception can possibly be thrown by this method
      If any method throws checked Exception, then caller can either handle this exception(using try catch block )or can re throw it by declaring another ‘throws’ clause in method declaration.
      throw clause can be used in any part of code where you feel a specific exception needs to be thrown to the calling method
      E.g.
      throw
      throw new Exception(“You have some exception”)
      throw new IOException(“Connection failed!!”)
      throws
      throws IOException, NullPointerException, ArithmeticException

      What is finalize() method?

      Unlike c++ , we don’t need to destroy objects explicitly in Java. ‘Garbage Collector‘ does that automatically for us. Garbage Collector checks if no references to an object exist, that object is assumed to be no longer required, and the memory occupied by the object can be freed. Sometimes an object can hold non-java resources such as file handle or database connection, then you want to make sure these resources are also released before object is destroyed. To perform such operation Java provide protected void finalize() in object class. You can override this method in your class and do the required tasks. Right before an object is freed, the java run time calls the finalize() method on that object. Refer this for more details.

      Difference in Set and List interface?

      Set and List both are child interface of Collection interface. There are following two main differences between them

      List can hold duplicate values but Set doesn’t allow this.
      In List interface data is present in the order you inserted but in the case of Set insertion order is not preserved.

      What will happen if you put System.exit(0) on try or catch block? Will finally block execute?

      By Calling System.exit(0) in try or catch block, we can skip the finally block. System.exit(int) method can throw a SecurityException. If Sysytem.exit(0) exits the JVM without throwing that exception then finally block will not execute. But, if System.exit(0) does throw security exception then finally block will be executed.

      ************************************************************************************************
      https://www.glassdoor.co.in/Overview/Working-at-Apsys-Technologies-EI_IE738400.11,29.htm
      ***************************************************************************************

    • virtusa company ( call based 2017, 2016 batch )
      profile developer
      ABC
      drive date 12/12/2017

      Address: No.67, BGS Health & Education City, Uttarahalli Main Road, Kengeri, Bengaluru, Karnataka 560060
      ***********************************************************************************************************
      https://www.glassdoor.co.in/…/Virtusa-Interview-Questions-E…

      *********************************************************************************************************
      the first round is an Aptitude test, followed by a Programming test in which you are given one programming challenge to solve in the computer.

      **************************************************************************************************
      First there was technical Written test which consist of basic technical question on Java/C++ ans basic PL/SQL questions
      **********************************************************************************************************
      https://www.glassdoor.co.in/…/Virtusa-Interview-Questions-E…
      *****************************************************************************************************************

      What will be the output of the program?
      class PassA
      {
      public static void main(String [] args)
      {
      PassA p = new PassA()
      p.start();
      }

      void start()
      {
      long [] a1 = {3,4,5};
      long [] a2 = fix(a1);
      System.out.print(a1[0] + a1[1] + a1[2] + ” “);
      System.out.println(a2[0] + a2[1] + a2[2]);
      }

      long [] fix(long [] a3)
      {
      a3[1] = 7;
      return a3;
      }
      }
      A. 12 15
      B. 15 15
      C. 3 4 5 3 7 5
      D. 3 7 5 3 7 5
      View Answer Discuss in Forum Workspace Report
      2.
      What will be the output of the program?
      class Test
      {
      public static void main(String [] args)
      {
      Test p = new Test();
      p.start();
      }

      void start()
      {
      boolean b1 = false;
      boolean b2 = fix(b1);
      System.out.println(b1 + ” ” + b2);
      }

      boolean fix(boolean b1)
      {
      b1 = true;
      return b1;
      }
      }
      A. true true
      B. false true
      C. true false
      D. false false
      View Answer Discuss in Forum Workspace Report
      3.
      What will be the output of the program?
      class PassS
      {
      public static void main(String [] args)
      {
      PassS p = new PassS();
      p.start();
      }

      void start()
      {
      String s1 = “slip”;
      String s2 = fix(s1);
      System.out.println(s1 + ” ” + s2);
      }

      String fix(String s1)
      {
      s1 = s1 + “stream”;
      System.out.print(s1 + ” “);
      return “stream”;
      }
      }
      A. slip stream
      B. slipstream stream
      C. stream slip stream
      D. slipstream slip stream
      View Answer Discuss in Forum Workspace Report
      4.
      What will be the output of the program?
      class BitShift
      {
      public static void main(String [] args)
      {
      int x = 0x80000000;
      System.out.print(x + ” and “);
      x = x >>> 31;
      System.out.println(x);
      }
      }
      A. -2147483648 and 1
      B. 0x80000000 and 0x00000001
      C. -2147483648 and -1
      D. 1 and -2147483648
      View Answer Discuss in Forum Workspace Report
      5.
      What will be the output of the program?
      class Equals
      {
      public static void main(String [] args)
      {
      int x = 100;
      double y = 100.1;
      boolean b = (x = y); /* Line 7 */
      System.out.println(b);
      }
      }
      A. true
      B. false
      C. Compilation fails
      D. An exception is thrown at runtime

      What is the name of the method used to start a thread execution?
      A. init();
      B. start();
      C. run();
      D. resume();
      View Answer Discuss in Forum Workspace Report
      2.
      Which two are valid constructors for Thread?
      Thread(Runnable r, String name)
      Thread()
      Thread(int priority)
      Thread(Runnable r, ThreadGroup g)
      Thread(Runnable r, int priority)
      A. 1 and 3
      B. 2 and 4
      C. 1 and 2
      D. 2 and 5
      View Answer Discuss in Forum Workspace Report
      3.
      Which three are methods of the Object class?
      notify();
      notifyAll();
      isInterrupted();
      synchronized();
      interrupt();
      wait(long msecs);
      sleep(long msecs);
      yield();
      A. 1, 2, 4
      B. 2, 4, 5
      C. 1, 2, 6
      D. 2, 3, 4
      View Answer Discuss in Forum Workspace Report
      4.
      class X implements Runnable
      {
      public static void main(String args[])
      {
      /* Missing code? */
      }
      public void run() {}
      }
      Which of the following line of code is suitable to start a thread ?
      A. Thread t = new Thread(X);
      B. Thread t = new Thread(X); t.start();
      C. X run = new X(); Thread t = new Thread(run); t.start();
      D. Thread t = new Thread(); x.run();
      View Answer Discuss in Forum Workspace Report
      5.
      Which cannot directly cause a thread to stop executing?
      A. Calling the SetPriority() method on a Thread object.
      B. Calling the wait() method on an object.
      C. Calling notify() method on an object.
      D. Calling read() method on an InputStream object

      ******************************************************************************************************************************8
      interview question
      ******************************************************************
      Technical round where they asked basic questions on java oops concepts
      ***************************************************************************

      Which two method you need to implement for key Object in HashMap ?
      In order to use any object as Key in HashMap, it must implements equals and hashcode method in Java. Read How HashMap works in Java for detailed explanation on how equals and hashcode method is used to put and get object from HashMap.

      2. What is immutable object? Can you write immutable object?Immutable classes are Java classes whose objects can not be modified once created. Any modification in Immutable object result in new object. For example is String is immutable in Java. Mostly Immutable are also final in Java, in order to prevent sub class from overriding methods in Java which can compromise Immutability. You can achieve same functionality by making member as non final but private and not modifying them except in constructor.

      3. What is the difference between creating String as new() and literal?
      When we create string with new() Operator, it’s created in heap and not added into string pool while String created using literal are created in String pool itself which exists in PermGen area of heap.

      String s = new String(“Test”);

      does not put the object in String pool , we need to call String.intern() method which is used to put them into String pool explicitly. its only when you create String object as String literal e.g. String s = “Test” Java automatically put that into String pool.

      4. What is difference between StringBuffer and StringBuilder in Java ?

      Classic Java questions which some people thing tricky and some consider very easy. StringBuilder in Java is introduced in Java 5 and only difference between both of them is that Stringbuffer methods are synchronized while StringBuilder is non synchronized. See StringBuilder vs StringBuffer for more differences.

      5. Write code to find the First non repeated character in the String ?
      Another good Java interview question, This question is mainly asked by Amazon and equivalent companies. See first non repeated character in the string : Amazon interview question

      6. What is the difference between ArrayList and Vector ?
      This question is mostly used as a start up question in Technical interviews on the topic of Collection framework . Answer is explained in detail here Difference between ArrayList and Vector .

      7. How do you handle error condition while writing stored procedure or accessing stored procedure from java?
      This is one of the tough Java interview question and its open for all, my friend didn’t know the answer so he didn’t mind telling me. my take is that stored procedure should return error code if some operation fails but if stored procedure itself fail than catching SQLException is only choice.

      8. What is difference between Executor.submit() and Executer.execute() method ?
      There is a difference when looking at exception handling. If your tasks throws an exception and if it was submitted with execute this exception will go to the uncaught exception handler (when you don’t have provided one explicitly, the default one will just print the stack trace to System.err). If you submitted the task with submit any thrown exception, checked exception or not, is then part of the task’s return status. For a task that was submitted with submit and that terminates with an exception, the Future.get will re-throw this exception, wrapped in an ExecutionException.

      9. What is the difference between factory and abstract factory pattern?
      Abstract Factory provides one more level of abstraction. Consider different factories each extended from an Abstract Factory and responsible for creation of different hierarchies of objects based on the type of factory. E.g. AbstractFactory extended by AutomobileFactory, UserFactory, RoleFactory etc. Each individual factory would be responsible for creation of objects in that genre.
      You can also refer What is Factory method design pattern in Java to know more details.

    • Javascript, CSS, SQL.

      https://www.glassdoor.co.in/…/HireCraft-Interview-Questions…
      *****************************************************************************************
      Time and Distance
      Time and Work
      Compound Interest
      Partnership
      Problems on Ages
      Clock
      Area
      Permutation and Combination
      Problems on Numbers
      Decimal Fraction
      Square Root and Cube Root
      Ratio and Proportion
      **************************************************************************
      1. Associate Software Engineer : ASP.Net, C#.Net, Web API HTML, Javascript, CSS, SQL.
      questions were like like what is abstract, interface, escapsulation, java package

      1. What is ASP.Net?

      It is a framework developed by Microsoft on which we can develop new generation web sites using web forms(aspx), MVC, HTML, Javascript, CSS etc. Its successor of Microsoft Active Server Pages(ASP). Currently there is ASP.NET 4.0, which is used to develop web sites. There are various page extensions provided by Microsoft that are being used for web site development. Eg: aspx, asmx, ascx, ashx, cs, vb, html, XML etc.

      2. What’s the use of Response.Output.Write()?
      We can write formatted output using Response.Output.Write().

      3. In which event of page cycle is the ViewState available?
      After the Init() and before the Page_Load().

      4. What is the difference between Server.Transfer and Response.Redirect?

      In Server.Transfer page processing transfers from one page to the other page without making a round-trip back to the client’s browser. This provides a faster response with a little less overhead on the server. The clients url history list or current url Server does not update in case of Server.Transfer.

      Response.Redirect is used to redirect the user’s browser to another page or site. It performs trip back to the client where the client’s browser is redirected to the new page. The user’s browser history list is updated to reflect the new address.

      5. From which base class all Web Forms are inherited?

      Page class.

      6. What are the different validators in ASP.NET?

      Required field Validator
      Range Validator
      Compare Validator
      Custom Validator
      Regular expression Validator
      Summary Validator
      7. Which validator control you use if you need to make sure the values in two different controls matched?

      Compare Validator control.

      8. What is ViewState?

      ViewState is used to retain the state of server-side objects between page post backs.

      9. Where the viewstate is stored after the page postback?

      ViewState is stored in a hidden field on the page at client side. ViewState is transported to the client and back to the server, and is not stored on the server or any other external source.

      10. How long the items in ViewState exists?

      They exist for the life of the current page.

      11. What are the different Session state management options available in ASP.NET?

      ASP .net Interview Questions

      In-Process
      Out-of-Process.
      In-Process stores the session in memory on the web server.

      Out-of-Process Session state management stores data in an external server. The external server may be either a SQL Server or a State Server. All objects stored in session are required to be serializable for Out-of-Process state management.

      12. How you can add an event handler?

      Using the Attributes property of server side control.

      e.g.

      btnSubmit.Attributes.Add(“onMouseOver”,”JavascriptCode();”)
      1
      btnSubmit.Attributes.Add(“onMouseOver”,”JavascriptCode();”)
      13. What is caching?

      Caching is a technique used to increase performance by keeping frequently accessed data or files in memory. The request for a cached file/data will be accessed from cache instead of actual location of that file.

      14. What are the different types of caching?
      ASP.NET has 3 kinds of caching :

      Output Caching,
      Fragment Caching,
      Data Caching.
      15. Which type if caching will be used if we want to cache the portion of a page instead of whole page?

      Fragment Caching: It caches the portion of the page generated by the request. For that, we can create user controls with the below code:

      < %@ OutputCache Duration="120" VaryByParam="CategoryID;SelectedID"%>
      1
      < %@ OutputCache Duration="120" VaryByParam="CategoryID;SelectedID"%>

      16. List the events in page life cycle.

      1) Page_PreInit
      2) Page_Init
      3) Page_InitComplete
      4) Page_PreLoad
      5) Page_Load
      6) Page_LoadComplete
      7) Page_PreRender
      8)Render

      17. Can we have a web application running without web.Config file?

      Yes

      18. Is it possible to create web application with both webforms and mvc?

      Yes. We have to include below mvc assembly references in the web forms application to create hybrid application.

      System.Web.Mvc
      System.Web.Razor
      System.ComponentModel.DataAnnotations
      1
      2
      3
      4
      5
      System.Web.Mvc

      System.Web.Razor

      System.ComponentModel.DataAnnotations

      19. Can we add code files of different languages in App_Code folder?

      No. The code files must be in same language to be kept in App_code folder.

      20. What is Protected Configuration?

      It is a feature used to secure connection string information.

      21. Write code to send e-mail from an ASP.NET application?

      MailMessage mailMess = new MailMessage ();
      mailMess.From = “abc@gmail.com”;
      mailMess.To = “xyz@gmail.com”;
      mailMess.Subject = “Test email”;
      mailMess.Body = “Hi This is a test mail.”;
      SmtpMail.SmtpServer = “localhost”;
      SmtpMail.Send (mailMess);
      1
      2
      3
      4
      5
      6
      7
      MailMessage mailMess = new MailMessage ();
      mailMess.From = “abc@gmail.com”;
      mailMess.To = “xyz@gmail.com”;
      mailMess.Subject = “Test email”;
      mailMess.Body = “Hi This is a test mail.”;
      SmtpMail.SmtpServer = “localhost”;
      SmtpMail.Send (mailMess);

      MailMessage and SmtpMail are classes defined System.Web.Mail namespace.

      22. How can we prevent browser from caching an ASPX page?

      We can SetNoStore on HttpCachePolicy object exposed by the Response object’s Cache property:

      Response.Cache.SetNoStore ();
      Response.Write (DateTime.Now.ToLongTimeString ());
      1
      2
      Response.Cache.SetNoStore ();
      Response.Write (DateTime.Now.ToLongTimeString ());

      23. What is the good practice to implement validations in aspx page?
      Client-side validation is the best way to validate data of a web page. It reduces the network traffic and saves server resources.

      24. What are the event handlers that we can have in Global.asax file?
      Application Events: Application_Start , Application_End, Application_AcquireRequestState, Application_AuthenticateRequest, Application_AuthorizeRequest, Application_BeginRequest, Application_Disposed, Application_EndRequest, Application_Error, Application_PostRequestHandlerExecute, Application_PreRequestHandlerExecute,
      Application_PreSendRequestContent, Application_PreSendRequestHeaders, Application_ReleaseRequestState, Application_ResolveRequestCache, Application_UpdateRequestCache

      Session Events: Session_Start,Session_End

      25. Which protocol is used to call a Web service?
      HTTP Protocol

      26. Can we have multiple web config files for an asp.net application?
      Yes.

      *********************************************************************************

    • gobal edge company 2017 (call based through doc file which mentoined in grp)

      drive date 16 feb

      Address: No.67, BGS Health & Education City, Uttarahalli Main Road, Kengeri, Bengaluru, Karnataka 560060

      **********************************************

      INTERVIEW QUESTION

      http://placement.freshersworld.com/globaledge-…/331400004441

      *******************************************

      The selection process contains 5 rounds.

      Round1: Aptitude Test (100 bits and 90 Min Time) : It Contains 50 Aptitude qns, 25 computer science basics and 25 electronics based qns.

      Round2: C and OS (34 qns and 90 Min Time): It contains 3 sections.

      Section 1: 25 objective qns on C and OS.

      Section 2: 4 decrptive qns on C and OS.

      Section3: Five C programs.

      Round3: Technical Interview-1

      Mainly Focused on C programs like Bitewise Operators, Stack, Linked List etc.

      Round4: HR Interview

      HR will tell company package, agreement details.

      Round5: Technical Interview -2 (With Technical Manager).

      Very Very Hard.. Huge Elimination..Be Careful…..He will ask nearly 8-10 programs..and OS qns

      Sample Test Paper Globaledge

      1)what is big-endian.
      a) MSB at lower address LSB at higher address
      b) LSB at lower address MSB at higher address
      c) memory mgmt technique
      d) none of the above
      ans:a

      2)what is Little-endian.
      a) MSB at lower address LSB at higher address
      b) LSB at lower address MSB at higher address
      c) memory mgmt technique
      d) none of the above
      ans:b

      3)8086 has
      a)16 bit data bus ,16 bit address bus
      b)16 bit data bus,32 bit address bus
      c)8 bit data bus,16 bit address bus
      d)8 bit data bus,8 bit address bus
      ans:a

      4) what is the scheduling algorithm used in general operating systems.
      a) FCFS algorithm
      b) Highest Priority First algorithm
      c) Round-Robin algorithm
      d) None of the above
      ans:c

      5)Router is present at
      a)Physical layer
      b)Data Link Layer
      c)Network Layer
      d)None of above
      ans:c

      6)Condition for deadlock occurance
      a) Mutual Exclusion
      b) no premption
      c) hold and wait
      d) circular wait
      e) all of the above
      ans:d

      7)PCI stands for
      a)Programmable computer Interface
      b)Peripheral Computer Interface
      c)programmable Control Interface
      d)Peripheral Component Interface
      ans:d

      8)Toggle state in J-K flip-flop is
      a)0 1
      b)1 0
      c)1 1
      d)0 0
      ans :c

      9)Interrupt is serviced
      a)Immediatly when it occurs
      b)After the completion of current instruction.
      c)Ignored
      d)None of the above.
      ans:b

      C:

      1.what is the o/p ?

      void main()
      {
      char *mess[]={“Have”,”a”,”nice”,”day”,”Bye”);
      printf(“%d \t %d”,sizeof(mess),sizeof(mess[1]));
      }
      a. 16 4
      b. 5 4
      c. 20 4
      d. Error
      answer: c

      2.what is the o/p of the following programe?
      void main()
      {
      int i,count=0;
      char *p1=”abcdefghij”;
      char *p2=”alcmenfoip”;

      for(i=0;i< =strlen(p1);i++) { if(*p1++ == *p2++) count+=5; else count-=3; } printf("count=%d\n",count); } a. 15 b. 6 c. 12 d. compiler error answer: b ( note : strlen(p1) == i when i=6) 3.what does main return on successful execution? a. 1 b. 0 c. -1 d.Nonzero answer:b 4. main(int argc,char *argv[]) { printf((argc > 1 ? “%c” : “%c”,*++argv);
      }
      If the i/p string is “GESL Bangalore”.
      a. G
      b. E
      c. B
      d. GESL
      answer: c

      5. How do u declare a pointer to an array of pointers to int?
      a. int *a[5];
      b. int **a[5];
      c. int *(*a)[5];
      d. u con not declare
      answer: c

      Questions on OS:

      1.UDP is a
      a. Reliable protocol
      b. Unreliable protocol
      c. Connectionless protocol
      d. Both b & c
      Answer: d

      2.Real Time OS uses
      a. RISC processor
      b. CISC processor
      c. SISC processor
      d. Any of the above
      Answer: a

      3.Race condition could be overcome using
      a. A global variable
      b. A local variable
      c. Mutex
      d. All of the above

      4.Repeaters are in
      a. Data link layer
      b. Physical layer
      c. Network layer
      d. Transport layer
      Answer: b

      5.Telecom Networking uses
      a. Packet switching
      b. Circuit switching
      c. Message switching
      d. Non of the above

      Ans : b ( normally )
      ( packet switching in ISDN )

      GlobalEdge Aptitude Questions and Answers
      1.If the number 481 * 673 is completely divisible by 9, then the smallest whole number in place of * will be:
      A.2
      B.5
      C.6
      D.7
      E.None of these
      Answer:D
      Ex:Sum of digits = (4 + 8 + 1 + x + 6 + 7 + 3) = (29 + x), which must be divisible by 9.
      Therefore, x = 7.

      2.3897 x 999 = ?
      A.3883203
      B.3893103
      C.3639403
      D.3791203
      E.None of these
      Answer:B
      Option : B
      EX:3897 x 999 = 3897 x (1000 – 1)

      = 3897 x 1000 – 3897 x 1

      = 3897000 – 3897

      = 3893103.

      3.Sakshi can do a piece of work in 20 days. Tanya is 25% more efficient than Sakshi. The number of days taken by Tanya to do the same
      piece of work is:
      A.15
      B.16
      C.18
      D.25
      Answer:B
      Ex:Ratio of times taken by Sakshi and Tanya = 125:100 = 5:4.
      Suppose Tanya takes x days to do the work.
      5 : 4 :: 20 : x ⇒ x =(4 x 20)/5
      ⇒ x = 16 days
      Hence, Tanya takes 16 days to complete the work.

      4.A and B together can do a piece of work in 30 days. A having worked for 16 days, B finishes the remaining work alone in 44 days. In
      how many days shall B finish the whole work alone?
      A.30 days
      B.40 days
      C.60 days
      D.70 days
      Answer:C
      Ex:Let A’s 1 day’s work = x and B’s 1 day’s work = y.
      Then, x + y =1/30 and 16x + 44y = 1.
      Solving these two equations, we get: x =1/60 and y =1/60
      Hence, B alone shall finish the whole work in 60 days.

      5.A train left station at A hour B minutes. It reached station Y at B hour C minutes on the same day, after travelling C hours A
      minutes (clock shows time from 0 hours to 24 hours). Number of possible value of A is?
      A.0
      B.1
      C.2
      D.3
      Answer:A
      Ex:A hours + C ours = B hours …..(i)
      A, C and B cannot have values greater than or equal to 24
      B minutes + A minutes = C minutes …..(ii)
      Looking at two equation, we get no value of A satisfies both equation.

      6.An aeroplane covers a certain distance at a speed of 240 kmph in 5 hours. To cover the same distance in 5/3 hours, it must travel
      at a speed of:
      A.300 kmph
      B.360 kmph
      C.600 kmph
      D.720 kmph
      Answer:D
      Ex:Distance = (240 x 5) = 1200 km.
      Speed = Distance/Time
      Speed =1200/(5/3)km/hr
      ∴ Required speed = 1200 x (3/5)km/hr = 720 km/hr

      7.A merchant marks his goods up by 75% above his cost price. What is the maximum % discount that he can offer so that he ends up
      selling at no profit or loss?
      A.75%
      B.46.67%
      C.300%
      D.42.85%
      Answer:D
      Ex:Let us assume that the cost price of the article = Rs.100
      Therefore, the merchant would have marked it to Rs.100 + 75% of Rs.100 = 100 + 75 = 175.
      Now, if he sells it at no profit or loss, he sells it at the cost price.i.e. he offers a discount of Rs.75 on his selling price of
      Rs.175
      Therefore, his % discount = (75/175) x 100= 42.85%

      8.The average weight of a class of 24 students is 36 years. When the weight of the teacher is also included, the average weight
      increases by 1kg. What is the weight of the teacher?
      A.60 kgs
      B.61 kgs
      C.37 kgs
      D.None of these
      Answer:B
      Ex:The average weight of a class of 24 students = 36 kgs.
      Therefore, the total weight of the class = 24 x 36 = 864 kgs
      When the weight of the teacher is included, there are 25 individuals.
      The average weight increases by 1kg. That is the new average weight = 37 kgs.
      Therefore, the total weight of the 24 students plus the teacher = 25 x 37 = 925
      Weight of the teacher = Weight of 24 students + teacher – weight of 24 students = 925 – 864 = 61 kgs

      9.Ayesha’s father was 38 years of age when she was born while her mother was 36 years old when her brother four year younger to her
      was born. What is the difference between the ages of her parents?
      A.2 years
      B.4 years
      C.6 years
      D.8 years
      Answer:C
      Ex:Mother’s age when ayesha’s brother was born = 36 years.
      Father’s age when Ayesha’s brother was born = (38 + 4) = 42 years.
      So, required difference = ( 42 – 36 ) years = 6 years.

      10.Two number are in the ratio 3 : 5. If 9 is subtracted from each, the new numbers are in the ratio 12 : 23. The smaller number is:
      A.27
      B.33
      C.49
      D.55
      Answer:B
      Ex:Let the numbers be 3x and 5x.
      Then, (3x – 9)/5x – 9=12/23
      ⇒ 23(3x – 9) = 12(5x – 9)
      ⇒ 9x = 99
      ⇒ x = 11.
      ∴ The smaller number = (3 x 11) = 33.

      11.January 1, 2007 was Monday. What day of the week lies on Jan. 1, 2008?
      A.Monday
      B.Tuesday
      C.Wednesday
      D.Sunday
      Answer:C
      Ex:The year 2007 is an ordinary year. So, it has 1 odd day.
      1st day of the year 2007 was Monday.
      1st day of the year 2008 will be 1 day beyond Monday.
      Hence, it will be Tuesday.

      12.If REASON is coded as 5 and BELIEVED is coded as 7, what will be coded for GOVERMENT?
      A.6
      B.8
      C.9
      D.10
      Answer:C
      EX:Code for the given word = (number of letter in the word) – 1.
      So, the code for GOVERNMENT= 10 – 1 = 9.

      13.If Z = 52 and ACT = 48, then BAT = ?
      A.39
      B.41
      C.44
      D.46
      Answer:D
      EX:In the given code, A = 2, B = 4, …. ,Z = 52.
      So, ACT = 2 + 6 + 40 = 48 AND BAT = 4 + 2 + 40 = 46

      14.My father’s only brother’s wife’s only daughter’s paternal uncle is my mother’s
      A.father-in-law
      B.husband
      C.son
      D.uncle
      Answer:B
      EX:My father’s only brother’s wife is my father’s sister-in-law.
      My father’s sister-in-law’s only daughter is my father’s niece.
      My father’s niece’s paternal uncle is my father. My father is my mother’s husband.

      15.How is my father’s brother’s only sibling’s mother related to me?
      A.Mother
      B.Daughter
      C.Aunt
      D.Grandmother
      Answer:D
      EX:My father’s brother’s only sibling is my father.
      My father’s mother is my grandmother.

      16.21, 9, 21, 11, 21, 13, 21, …?
      A.14
      B.15
      C.21
      D.23
      Answer:B
      In the sequence alternate number is added by 2

      17.53, 53, 40, 40, 27, 27, …?
      A. 12
      B. 14
      C. 27
      D. 53
      Answer:B
      In the sequence -13 is done after repeating a number

      18.If even numbered dice have even number of dots on their top faces, then what would be the total number of dots on the top faces of
      their dice?
      A.12
      B.14
      C.18
      D.24
      Answer:C
      Ex:Even numbered dice are: (II), (IV) and (VI)
      No. of dots on the top face of (II) dice = 6
      No. of dots on the top face of (IV) dice = 6
      and No. of dots on the top face of (VI) dice = 6
      Therefore Required total = 6 + 6 + 6 = 18

      .Direction to solve(19-20):

      In each question below is given a statement followed by two conclusions numbered I and II.

      You have to assume everything in the statement to be true, then consider the two conclusions together and decide which of them
      logically follows beyond a reasonable doubt from the information given in the statement.

      Give answer:

      (A) If only conclusion I follows.

      (B) If only conclusion II follows

      (C) If either I or II follows

      (D) If neither I nor II follows and

      (E) If both I and II follow.

      19.Statements: Reading makes a full man, conference a ready man and writing an exact man.

      Conclusions:I. Pointed and precise expression comes only through extensive writing.

      II. Extensive reading makes a complete man.

      A.Only conclusion I follows
      B.Only conclusion II follows
      C.Either I or II follows
      D.Neither I nor II follows
      E.Both I and II follow
      Answer:E
      Ex:Clearly, I follows from the fact that writing makes an exact man.
      Conclusion II also directly follows from the statement.

      20.Statements: Death keeps no calendar.

      Conclusions:I. Man must die one day.

      II. Death can come at any time.

      A.Only conclusion I follows
      B.Only conclusion II follows
      C.Either I or II follows
      D.Neither I nor II follows
      E.Both I and II follow
      Answer:E
      EX:Both I and II directly follow from the statement.

  1. Cognizent automata question which i wrote exam on sunday
    Que 1) consider special function used to generate permutations of given list of num. on each call it returns one of random permutation of input and never repeats any permutation that already generated

    write an alog to get max numb of calls required to this spcl function to obtain an sorted array (ascending order)

    the input to method(given) maxOperations of class Randomsort shall consists of nonempty integer arraylist
    Testcases
    1)input [5, 1, 3, 11] output 23
    2)input [5, 1, 2, 3, 8, 0, 12] output 5039

Comments are closed.