02-Interview Questions Full
02-Interview Questions Full
Version: 1.1
Prepared by:
Dr. Ajay Shanker Singh
&
Prof. Thirunavukkarasu K
School of Computing Science & Engineering
Galgotias University, India
“Best of luck”
Infosys /Wipro /Cognizant/IBM
Technical Interview Questions and Answers
1. 50% questions are from your resume. Be sure on each mention facts.
2. Interviewers are curious to hear something about latest trend.
3. please be very specific about your career.
=============================================================
1. Intro
2. C & data structure
3. Java
4. Dbms
5. Os
6. SE
7. Business Analytics
8. About summer internship
9. HR
10. About company Infosys/Wipro/cognizant /IBM
11. suggestions
My Strength is takes Initiative to work independently, Good leadership skill, Adaptable to any kind of
situation in estranged group & Helping tendency.
My Weakness is I am not comfortable, until I finish my work in the given time & over friendly in
nature.
My Short term goal is to get the job in reputed company that values quality , ethics, and teamwork..
My Long term goal is to become more responsible and knowledgeable personality and on respectable
position on my company.
That's all about me!
My Weakness is I am not comfortable, until I finish my work in the given time & over friendly in nature.
(They do not prefer candidates with BUSINESS background. If your father is a businessman, make sure you are able to
convince them that you are interested in working for them and you are not going to join your father‟s business. Trust me,
this is really a very important point you should keep in mind. Moreover, if you are the only child of your parents, please
prepare yourself how you can convince them that being the only son/daughter wont be an issue anytime.)
1. What is data structure . List out the areas in which data structures are applied
extensively?
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.
Applications: Compiler Design, Operating System, Database Management System, Statistical analysis package,
Numerical Analysis, Graphics, Artificial Intelligence, Simulation.
Lists: A group of similar items with connectivity to the previous or/and next data items.
Arrays: A set of homogeneous values
Records: A set of fields, where each field consists of data belongs to one data type.
Trees: A data structure where the data is organized in a hierarchical structure. This type of data
structure follows the sorted order of insertion, deletion and modification of data items.
Tables: Data is persisted in the form of rows and columns. These are similar to records, where the
result or manipulation of data is reflected for the whole table.
3. Write a program on GCF(greateST common FACTOR). Program for recursion.
#include <stdio.h>
int main()
{
int n1, n2;
while(n1!=n2)
{
if(n1 > n2)
n1 -= n2;
else
n2 -= n1;
}
printf("GCD = %d",n1);
return 0;
}
A function that calls itself is known as a recursive function. And, this technique is known as recursion.
#include <stdio.h>
int sum(int n);
int main()
{
int number, result;
result = sum(number);
printf("sum=%d", result);
}
Output:
Enter a positive integer: 3
Sum=6
4. Deference between C and C#.
Key Differences:
C programming language is more suitable for system programming apps, hardware apps, embedded
device and chip designing. While C# is suitable for apps development and web apps development.
Both C and C# deals in four basic data type like int, float, double and char. C# has one addition data
type feature Booleans, which is used to shows the output of logical operations.
Total 32 keywords are used in C programming language while in C# total 87 keywords are used.
C# has more integral type as compare to C. There is only one type of integral in C, which are two in
C#, char type and whole number which can be signed or unsigned.
C is a structure oriented programming language while C# is an object oriented language.
Top down approach program structure is followed by C while bottom up approach program structure
is adopted by C#
C program for bubble sort: c programming code for bubble sort to sort numbers or arrange them in ascending order. You
can easily modify it to print numbers in descending order.
#include <stdio.h>
int main()
{
int array[100], n, c, d, swap;
return 0;
}
Output of program:
6. Write a program for leap year.
A leap year is exactly divisible by 4 except for century years (years ending with 00). The century year is a leap
year only if it is perfectly divisible by 400.
#include <stdio.h>
int main()
{
int year;
if(year%4 == 0)
{
if( year%100 == 0)
{
// year is divisible by 400, hence the year is a leap year
if ( year%400 == 0)
printf("%d is a leap year.", year);
else
printf("%d is not a leap year.", year);
}
else
printf("%d is a leap year.", year );
}
else
printf("%d is not a leap year.", year);
return 0;
}
Output 1
Output 2
This C Program uses recursive function & reverses the string entered by user in the same memory location. Eg:
“program” will be reversed to “margorp”
Here is the source code of the C program to reverse a string. The C Program is successfully compiled and run
on a Linux system. The program output is also shown below.
1. /*
2. * C Program to Reverse the String using Recursion
3. */
4. #include <stdio.h>
5. #include <string.h>
6.
7. void reverse(char [], int, int);
8. int main()
9. {
10. char str1[20];
11. int size;
12.
13. printf("Enter a string to reverse: ");
14. scanf("%s", str1);
15. size = strlen(str1);
16. reverse(str1, 0, size - 1);
17. printf("The string after reversing is: %s\n", str1);
18. return 0;
19. }
20.
21. void reverse(char str1[], int index, int size)
22. {
23. char temp;
24. temp = str1[index];
25. str1[index] = str1[size - index];
26. str1[size - index] = temp;
27. if (index == size / 2)
28. {
29. return;
30. }
31. reverse(str1, index + 1, size);
32. }
$ cc pgm12.c
$ a.out
Enter a string to reverse: malayalam
The string after reversing is: malayalam
$ a.out
Enter a string to reverse: cprogramming
The string after reversing is: gnimmargorpc
There are many differences between method overloading and method overriding in java. A list of differences between
method overloading and method overriding are given below:
1) Method overloading is used to increase the Method overriding is used to provide the specific
readability of the program. implementation of the method that is already provided by its
super class.
2) Method overloading is performed within class. Method overriding occurs in two classes that have IS-A
(inheritance) relationship.
3) In case of method overloading, parameter must In case of method overriding, parameter must be same.
be different.
4) Method overloading is the example of compile Method overriding is the example of run time polymorphism.
time polymorphism.
5) In java, method overloading can't be performed Return type must be same or covariant in method overriding.
by changing return type of the method
only. Return type can be same or different in
method overloading. But you must have to
change the parameter.
OOPs, concepts in Java are the main ideas behind Java’s Object Oriented Programming. They are
an abstraction, encapsulation, inheritance, and polymorphism. Grasping them is key to understanding how
Java works. Basically, Java OOPs concepts let us create working methods and variables, then re-use all or part
of them without compromising security.
Abstraction. Abstraction means using simple things to represent complexity. We all know how to turn the TV on, but
we don‟t need to know how it works in order to enjoy it. In Java, abstraction means simple things
like objects, classes, and variables represent more complex underlying code and data. This is important because it
lets avoid repeating the same work multiple times.
Encapsulation. This is the practice of keeping fields within a class private, then providing access to them via public
methods. It‟s a protective barrier that keeps the data and code safe within the class itself. This way, we can re-use
objects like code components or variables without allowing open access to the data system-wide.
Inheritance. This is a special feature of Object Oriented Programming in Java. It lets programmers create new classes
that share some of the attributes of existing classes. This lets us build on previous work without reinventing the wheel.
Polymorphism. This Java OOPs concept lets programmers use the same word to mean different things in different
contexts. One form of polymorphism in Java is method overloading. That‟s when different meanings are implied by
the code itself. The other form is method overriding. That‟s when the different meanings are implied by the values of
the supplied variables.
2. Abstraction : Abstraction is the concept of exposing only the required essential characteristics and behavior
with respect to a context.
Examples - Abstraction shows only important things to the user and hides the internal details, for example, when we
ride a bike, we only know about how to ride bikes but can not know about how it work? And also we do not know the
internal functionality of a bike. Abstraction is ATM Machine; All are performing operations on the ATM machine like
cash withdrawal, money transfer, retrieve mini-statement…etc. but we can't know internal details about ATM.
4. Inheritance –
Example - Father gives his property to child , father got that properties from child‟s grandfather , so child is the
taker and father is giver , hence father works as a base class and child as derived class , • you can explain is that
the child couldn‟t give its property to father so Inheritance is one sided • why it is needed? so you can explain like
same properties needed in multiple class you need not to write multiple times
Object Oriented Programming is a paradigm that provides many concepts such as inheritance, data binding, polymorphism
etc.
Simula is considered as the first object-oriented programming language. The programming paradigm where everything is
represented as an object, is known as truly object-oriented programming language.
Smalltalk is considered as the first truly object-oriented programming language.
Object Oriented Programming (OOP) is a programming paradigm that is based on the concept of objects. An object is a
data structure that contains data (fields) and functions (methods).
Objects are instances of classes. In OOP a class can be compared with a blueprint or a template for objects. Class is a
description of what data and methods should have an object of this class.
C++ provides possibility to combine both procedural and object oriented programming paradigm.
1. Classes of objects.
2. Instances of classes (objects).
3. Encapsulation - a class encapsulates all the fields and functions that are performed on the fields of a class. The
results of encapsulation are:
o Restriction to access some of the object's data from outside of class.
o Bundling data to functions inside a class.
4. Polymorphism - a way to use the same interface for the different data types. In simple words it can be
described as using the same name for member functions that have different arguments. Polymorphism is not
only related to member functions. It's discussed in more details in "C++ Polymorphism"
5. Inheritance - a class can inherit some properties from another class. This means that a child class can use
some of the functionality of parent class. You can find more information about inheritance in C++ Inheritance.
6. Abstraction - consists in hiding the details of some processes and data and representing only necessary
information and result outside the class. The detailed description of the abstraction concept can be found in
"C++ Abstraction".
7. Overloading - represents a kind of polymorphism. There is a possibility to overload already existing functions
and operators to make them work with new data types. The overloading is described in "C++ Overloading"
8. Error handling - some of the errors can appear in run time. Because of this, there is a need to handle errors to
make programs safe. The mechanism of C++ error handling is described in "C++ Exception Handling".
ABOVE---------------
BASIS FOR
INHERITANCE POLYMORPHISM
COMPARISON
Basic Inheritance is creating a new class using the Polymorphism is basically a common interface
properties of the already existing class. for multiple form.
Use To support the concept of reusability in OOP Allows object to decide which form of the
and reduces the length of code. function to be invoked when, at compile
time(overloading) as well as run
time(overriding).
Forms Inheritance may be a single inheritance, multiple Polymorphism may be a compile time
BASIS FOR
INHERITANCE POLYMORPHISM
COMPARISON
Example The class 'table' can inherit the feature of the The class 'study_table' can also have function
class 'furniture', as a 'table' is a 'furniture'. 'set_color()' and a class 'Dining_table' can also
have function 'set_color()' so, which form of the
set_color() function to invoke can be decided at
both, compile time and run time.
Most differences between the features of the two languages arise due to the use of different programming paradigms. C
breaks down to functions while JAVA breaks down to Objects. C is more procedure-oriented while JAVA is data-oriented.
We all know what a compiler does. It takes your code & translates it into something the machine can understand-that is to
say-0‟s & 1‟s-the machine-level code. That‟s exactly what happens with our C code-it gets „compiled‟. While with JAVA,
the code is first transformed to what is called the bytecode. This bytecode is then executed by the JVM(Java Virtual
Machine). For the same reason, JAVA code is more portable.
C is a low-level language(difficult interpretation for the user, closer significance to the machine-level code) while JAVA is
a high-level language (abstracted from the machine-level details, closer significance to the program itself).
4. C uses the top-down {sharp & smooth} approach while JAVA uses the bottom-up {on the rocks}approach.
In C, formulating the program begins by defining the whole and then splitting them into smaller elements. JAVA(and C++
and other OOP languages) follows the bottom-up approach where the smaller elements combine together to form the
whole.
When it comes to JAVA, we don‟t need the *‟s & &‟s to deal with pointers & their addressing. More formally, there is no
pointer syntax required in JAVA. It does what it needs to do. While in JAVA, we do create references for objects.
6. The Behind-the-scenes Memory Management with JAVA & The User-Based Memory Management in C.
Remember „malloc‟ & „free‟? Those are the library calls used in C to allocate & free chunks of memory for specific
data(specified using the keyword „sizeof‟). Hence in C, the memory is managed by the user while JAVA uses a garbage
collector that deletes the objects that no longer have any references to them.
7. JAVA supports Method Overloading while C does not support overloading at all.
JAVA supports function or method overloading-that is we can have two or more functions with the same name(with
certain varying parameters like return types to allow the machine to differentiate between them). That it to say, we can
overload methods with the same name having different method signatures. JAVA(unlike C++), does not support Operator
Overloading while C does not allow overloading at all.
8. Unlike C, JAVA does not support Preprocessors, & does not really them.
The preprocessor directives like #include & #define, etc are considered one of the most essential elements of C
programming. However, there are no preprocessors in JAVA. JAVA uses other alternatives for the preprocessors. For
instance, public static final is used instead of the #define preprocessor. Java maps class names to a directory and file
structure instead of the #include used to include files in C.
Although this difference might not hold any conceptual(intuitive) significance, it‟s maybe just the tradition. C uses the
printf & scanf functions as its standard input & output while JAVA uses the System.out.print & System.in.read functions.
When an error occurs in a Java program it results in an exception being thrown. It can then be handled using various
exception handling techniques. While in C, if there‟s an error, there IS an error.
4 DBMS
15. Write some sql queries.
SQL, 'Structured Query Language', is a programming language designed to manage data stored in relational databases.
SQL operates through simple, declarative statements. This keeps data accurate and secure, and helps maintain the integrity
of databases, regardless of size.
COMMANDS
ALTER TABLE
ALTER TABLE table_name ADD column datatype;
AND
SELECT column_name(s)
FROM table_name
WHERE column_1 = value_1
AND column_2 = value_2;
AND is an operator that combines two conditions. Both conditions must be true for the row to be included in the result set.
AS
SELECT column_name AS 'Alias'
FROM table_name;
AS is a keyword in SQL that allows you to rename a column or table using an alias.
AVG
SELECT AVG(column_name)
FROM table_name;
AVG() is an aggregate function that returns the average value for a numeric column.
BETWEEN
SELECT column_name(s)
FROM table_name
WHERE column_name BETWEEN value_1 AND value_2;
The BETWEEN operator is used to filter the result set within a certain range. The values can be numbers, text or dates.
COUNT
SELECT COUNT(column_name)
FROM table_name;
COUNT() is a function that takes the name of a column as an argument and counts the number of rows where the column
is not NULL.
CREATE TABLE
CREATE TABLE table_name (column_1 datatype, column_2 datatype, column_3 datatype);
CREATE TABLE creates a new table in the database. It allows you to specify the name of the table and the name of each
column in the table.
DELETE
DELETE FROM table_name WHERE some_column = some_value;
GROUP BY
SELECT COUNT(*)
FROM table_name
GROUP BY column_name;
GROUP BY is a clause in SQL that is only used with aggregate functions. It is used in collaboration with
the SELECT statement to arrange identical data into groups.
INNER JOIN
SELECT column_name(s) FROM table_1
JOIN table_2
ON table_1.column_name = table_2.column_name;
An inner join will combine rows from different tables if the join condition is true.
INSERT
INSERT INTO table_name (column_1, column_2, column_3) VALUES (value_1, 'value_2', value_3);
LIKE
SELECT column_name(s)
FROM table_name
WHERE column_name LIKE pattern;
LIKE is a special operator used with the WHERE clause to search for a specific pattern in a column.
LIMIT
SELECT column_name(s)
FROM table_name
LIMIT number;
LIMIT is a clause that lets you specify the maximum number of rows the result set will have.
MAX
SELECT MAX(column_name)
FROM table_name;
MAX() is a function that takes the name of a column as an argument and returns the largest value in that column.
MIN
SELECT MIN(column_name)
FROM table_name;
MIN() is a function that takes the name of a column as an argument and returns the smallest value in that column.
OR
SELECT column_name
FROM table_name
WHERE column_name = value_1
OR column_name = value_2;
OR is an operator that filters the result set to only include rows where either condition is true.
ORDER BY
SELECT column_name
FROM table_name
ORDER BY column_name ASC|DESC;
ORDER BY is a clause that indicates you want to sort the result set by a particular column either alphabetically or
numerically.
OUTER JOIN
SELECT column_name(s) FROM table_1
LEFT JOIN table_2
ON table_1.column_name = table_2.column_name;
An outer join will combine rows from different tables even if the the join condition is not met. Every row in the left table is
returned in the result set, and if the join condition is not met, then NULL values are used to fill in the columns from
the right table.
ROUND
SELECT ROUND(column_name, integer)
FROM table_name;
ROUND() is a function that takes a column name and an integer as an argument. It rounds the values in the column to the
number of decimal places specified by the integer.
SELECT
SELECT column_name FROM table_name;
SELECT statements are used to fetch data from a database. Every query will begin with SELECT.
SELECT DISTINCT
SELECT DISTINCT column_name FROM table_name;
SELECT DISTINCT specifies that the statement is going to be a query that returns unique values in the specified
column(s).
SUM
SELECT SUM(column_name)
FROM table_name;
SUM() is a function that takes the name of a column as an argument and returns the sum of all the values in that column.
UPDATE
UPDATE table_name
SET some_column = some_value
WHERE some_column = some_value;
WHERE
SELECT column_name(s)
FROM table_name
WHERE column_name operator value;
WHERE is a clause that indicates you want to filter the result set to include only rows where the following condition is
true.
16. What is normalization? Types of normalization?
Anomalies in DBMS
There are three types of anomalies that occur when the database is not normalized. These are – Insertion, update and
deletion anomaly. Let’s take an example to understand this.
Example: Suppose a manufacturing company stores the employee details in a table named employee that has four
attributes: emp_id for storing employee’s id, emp_name for storing employee’s name, emp_address for storing
employee’s address and emp_dept for storing the department details in which the employee works. At some point of
time the table looks like this:
Update anomaly: In the above table we have two rows for employee Rick as he belongs to two departments of the
company. If we want to update the address of Rick then we have to update the same in two rows or the data will become
inconsistent. If somehow, the correct address gets updated in one department but not in other then as per the database,
Rick would be having two different addresses, which is not correct and would lead to inconsistent data.
Insert anomaly: Suppose a new employee joins the company, who is under training and currently not assigned to any
department then we would not be able to insert the data into the table if emp_dept field doesn’t allow nulls.
Delete anomaly: Suppose, if at a point of time the company closes the department D890 then deleting the rows that are
having emp_dept as D890 would also delete the information of employee Maggie since she is assigned only to this
department.
To overcome these anomalies we need to normalize the data. In the next section we will discuss about normalization.
Normalization
As per the rule of first normal form, an attribute (column) of a table cannot hold multiple values. It should hold only
atomic values.
Example: Suppose a company wants to store the names and contact details of its employees. It creates a table that looks
like this:
emp_id emp_name emp_address emp_mobile
8812121212
102 Jon Kanpur
9900012222
9990000123
104 Lester Bangalore
8123450987
Two employees (Jon & Lester) are having two mobile numbers so the company stored them in the same field as you can
see in the table above.
This table is not in 1NF as the rule says “each attribute of a table must have atomic (single) values”, the emp_mobile
values for employees Jon & Lester violates that rule.
To make the table complies with 1NF we should have the data like this:
No non-prime attribute is dependent on the proper subset of any candidate key of table.
An attribute that is not part of any candidate key is known as non-prime attribute.
Example: Suppose a school wants to store the data of teachers and the subjects they teach. They create a table that looks
like this: Since a teacher can teach more than one subjects, the table can have multiple rows for a same teacher.
111 Maths 38
111 Physics 38
222 Biology 38
333 Physics 40
333 Chemistry 40
Candidate Keys: {teacher_id, subject}
Non prime attribute: teacher_age
The table is in 1 NF because each attribute has atomic values. However, it is not in 2NF because non prime attribute
teacher_age is dependent on teacher_id alone which is a proper subset of candidate key. This violates the rule for 2NF as
the rule says “no non-prime attribute is dependent on the proper subset of any candidate key of the table”.
To make the table complies with 2NF we can break it in two tables like this:
teacher_details table:
teacher_id teacher_age
111 38
222 38
333 40
teacher_subject table:
teacher_id subject
111 Maths
111 Physics
222 Biology
333 Physics
333 Chemistry
Now the tables comply with Second normal form (2NF).
Transitive functional dependency of non-prime attribute on any super key should be removed.
An attribute that is not part of any candidate key is known as non-prime attribute.
In other words 3NF can be explained like this: A table is in 3NF if it is in 2NF and for each functional dependency X-> Y at
least one of the following conditions hold:
An attribute that is a part of one of the candidate keys is known as prime attribute.
Example: Suppose a company wants to store the complete address of each employee, they create a table named
employee_details that looks like this:
Here, emp_state, emp_city & emp_district dependent on emp_zip. And, emp_zip is dependent on emp_id that makes
non-prime attributes (emp_state, emp_city & emp_district) transitively dependent on super key (emp_id). This violates
the rule of 3NF.
To make this table complies with 3NF we have to break the table into two tables to remove the transitive dependency:
employee table:
It is an advance version of 3NF that’s why it is also referred as 3.5NF. BCNF is stricter than 3NF. A table complies with
BCNF if it is in 3NF and for every functional dependency X->Y, X should be the super key of the table.
Example: Suppose there is a company wherein employees work in more than one department. They store the data like
this:
emp_id emp_nationality emp_dept dept_type dept_no_of_emp
To make the table comply with BCNF we can break the table in three tables like this:
emp_nationality table:
emp_id emp_nationality
1001 Austrian
1002 American
emp_dept table:
emp_id emp_dept
1001 stores
Candidate keys:
For first table: emp_id
For second table: emp_dept
For third table: {emp_id, emp_dept}
This is now in BCNF as in both the functional dependencies left side part is a key.
o Figure 7.4 shows how we must either have a corresponding value for customer name, or include a null.
o Repetition of information also occurs.
o Every occurrence of the banker's name must be accompanied by the branch name.
3. If we must choose between BCNF and dependency preservation, it is generally better to opt for 3NF.
o If we cannot check for dependency preservation efficiently, we either pay a high price in system
performance or risk the integrity of the data.
o The limited amount of redundancy in 3NF is then a lesser evil.
4. To summarize, our goal for a relational database design is
o BCNF.
o Lossless-join.
o Dependency-preservation.
5. If we cannot achieve this, we accept
o 3NF
o Lossless-join.
o Dependency-preservation.
6. A final point: there is a price to pay for decomposition. When we decompose a relation, we have to use natural
joins or Cartesian products to put the pieces back together. This takes computational time.
18. Find the employee with highest and second highest salary
Based on what I have heard from friends and other online users and from my own personal experience, the most common
job interview question for database programmers is “How do you find the highest salary in an employee table?”
This question tests a candidate‟s knowledge of ranking functions, subqueries, common table expression (CTE) and basic
SQL.
We will explore the answer with a series of scenarios and questions asked in relation to finding the highest, lowest, and nth
highest salary.
Let‟s create an employee table and populate it with some test data.
The query above uses the derived table concept, where the subquery with row_number ranking function assigns a unique
sequential number (1,2,3.. to N) to a salary which is ordered in descending order (highest to lowest). Thus, 1 will be
assigned to the highest salary, 2 to the second highest salary, and so on, using the derived table to fetch the row with
row_number assigned as 1.
Query 1.2 Find the Employee with the Highest Salary When There Is a Tie (Two employees both have the highest
salary and the number is the same)
I am inserting one more employee whose salary matches the highest salary fetched using Query 1.1 to demonstrate this
example.
In the query above, the Dense_rank function assigns the same consecutive rank number when there is a tie. Therefore, it
assigns number 1 to both of the highest salaries (45,000), and both are returned using the derived table query with the
salary_order = 1 filter.
Query 1.3 Finding the Employee with the Second Highest Salary
Here we are using the same logic used in Query 1.1 with the ROW_NUMBER() function, but we are using Salary_order =
2 to fetch second Highest salary.
Query 1.4 Finding the Employee with the Nth Highest Salary
To find the lowest salary, we are using Order by salary in ascending order, so the result is sorted in ascending order for
salary (lowest to highest). Hence, the lowest salary will get row_number = 1 and so on. We are using the filter
Salary_Order = 1 to retrieve the first lowest salary in the employee table.
Query 1.6 Finding the Employee with the Lowest Salary When There Is a Tie (Two employees both have the lowest
salary and it is the same)
I am inserting one more employee whose salary matches the lowest salary fetched using the query above to demonstrate
this example.
To find the lowest salary with ties, we are using the dense_rank function which is the same as Query 1.2. The dense_rank
function will assign consecutive numbers where there is a duplicate salary, so for the lowest salary (20000.00), it will
assign the number 1 to both the salaries. Using the Salary_Order = 1 filter, we are able to retrieve both the lowest salary
when there is tie using the dense_rank function.
Query 1.7 Finding the Employee with the Second Lowest Salary
Name Salary
---------------
abc 100000
bcd 1000000
efg 40000
ghi 500000
How to find the employee whose salary is second highest. For example, in above table, “ghi” has the second
highest salary as 500000.
Below is simple query to find the employee whose salary is highest.
We can nest the above query to find the second largest salary.
SQL Joins
A JOIN clause is used to combine rows from two or more tables, based on a related column
between them.
10308 2 1996-09-18
10309 37 1996-09-19
10310 77 1996-09-20
Notice that the "CustomerID" column in the "Orders" table refers to the "CustomerID" in the
"Customers" table. The relationship between the two tables above is the "CustomerID" column.
Then, we can create the following SQL statement (that contains an INNER JOIN), that selects
records that have matching values in both tables:
Example
SELECT Orders.OrderID, Customers.CustomerName, Orders.OrderDate
FROM Orders
INNER JOIN Customers ON Orders.CustomerID=Customers.CustomerID;
Try it Yourself »
(INNER) JOIN: Returns records that have matching values in both tables
LEFT (OUTER) JOIN: Return all records from the left table, and the matched records
from the right table
RIGHT (OUTER) JOIN: Return all records from the right table, and the matched records
from the left table
FULL (OUTER) JOIN: Return all records when there is a match in either left or right
table
Again, it's important to stress that before you can begin using any join type, you'll need to extract the data and load it
into an RDBMS like Amazon Redshift, where you can query tables from multiple sources. You build that process manually,
or you can use an ETL service like Stitch, which automates that process for you.
Let‟s say we have two sets of data in our relational database: table A and table B, with some sort of relation specified by
primary and foreign keys. The result of joining these tables together can be visually represented by the following diagram:
The extent of the overlap, if any, is determined by how many records in Table A match the records in Table B. Depending
on what subset of data we would like to select from the two tables, the four join types can be visualized by highlighting the
Select all records from Table A and Table B, where the join condition is met.
Select all records from Table A, along with records from Table B for which the join condition is met (if at all).
Select all records from Table B, along with records from Table A for which the join condition is met (if at all).
Select all records from Table A and Table B, regardless of whether the join condition is met or not.
Examples of SQL Join Types
Let's use the tables we introduced in the “What is a SQL join?” section to show examples of these joins in action. The
relationship between the two tables is specified by the customer_id key, which is the "primary key" in customers table
Inner Join
Let‟s say we wanted to get a list of those customers who placed an order and the details of the order they placed. This
would be a perfect fit for an inner join, since an inner join returns records at the intersection of the two tables.
select first_name, last_name, order_date, order_amount
from customers c
inner join orders o
on c.customer_id = o.customer_id
view rawinner-join.sql hosted with ❤ by GitHub
Note that only George Washington, John Adams and Thomas Jefferson placed orders, with Thomas Jefferson placing two
Left Join
If we wanted to simply append information about orders to our customers table, regardless of whether a customer placed an
order or not, we would use a left join. A left join returns all records from table A and any matching records from table B.
select first_name, last_name, order_date, order_amount
from customers c
left join orders o
on c.customer_id = o.customer_id
view rawleft-join.sql hosted with ❤ by GitHub
Note that since there were no matching records for James Madison and James Monroe in our orders table,
the order_date and order_amount are NULL, which simply means there is no data for these fields.
So why would this be useful? By simply adding a “where order_date is NULL” line to our SQL query, it returns a list of all
Right Join
Right join is a mirror version of the left join and allows to get a list of all orders, appended with customer information.
select first_name, last_name, order_date, order_amount
from customers c
right join orders o
on c.customer_id = o.customer_id
view rawright-join.sql hosted with ❤ by GitHub
Note that since there were no matching customer records for orders placed in 1795 and 1787,
the first_name and last_name fields are NULL in the resulting set.
Also note that the order in which the tables are joined is important. We are right joining the orders table to the customers
table. If we were to right join the customers table to the orders table, the result would be the same as left joining the orders
Why is this useful? Simply adding a “where first_name is NULL” line to our SQL query returns a list of all orders for
which we failed to record information about the customers who placed them:
select first_name, last_name, order_date, order_amount
from customers c
right join orders o
on c.customer_id = o.customer_id
where first_name is NULL
view rawright-join-alt.sql hosted with ❤ by GitHub
Full Join
Finally, for a list of all records from both tables, we can use a full join.
select first_name, last_name, order_date, order_amount
from customers c
full join orders o
on c.customer_id = o.customer_id
view rawfull-join.sql hosted with ❤ by GitHub
The DELETE FROM statement in SQL is used to remove records from a table.
Please note that the DELETE FROM command cannot delete any rows of data that would violate FOREIGN KEY or
other constraints.
Syntax
The WHERE clause is important here. Without specifying a condition, all records from the table will be deleted.
"Condition" can be simple (such as "Sales > 500") or complex (such as from the result of a subquery).
Examples
Two examples of how to use the DELETE FROM statement are shown below.
Table Store_Information
We decide not to keep any information on Los Angeles in this table. To accomplish this, we type the following SQL:
DELETE FROM Store_Information
WHERE Store_Name = 'Los Angeles';
Table Store_Information
In Example 1, the criteria we use to determine which rows to delete is quite simple. We can also use a more
complex condition. Below is an example where we use a subquery as the condition. Assume we have the
following two tables:
Table Store_Information
Table Geography
Region_Name Store_Name
East Boston
East New York
West Los Angeles
West San Diego
We want to remove data for all stores in the East region from Store_Information (assuming that a store is either in
the East region or the West region—it cannot be in more than one region). We use the following SQL statement to
accomplish this:
If we leave out the WHERE clause in a DELETE FROM command, we will delete all rows from the table. Most times,
this is not what we intend to do. To prevent this, it is a best practice in database management to always run the
corresponding SELECT statement first to make sure the rows selected are the ones we intend to remove from the
table. This can be done by replacing "DELETE" with "SELECT *".
Exercises
For the questions below, we use the following table as the starting point:
Table Clients
1. Which of the following SQL statements is valid? (There may be more than one answer)
a) DELETE * FROM Clients WHERE State = 'CO';
b) DELETE FROM Clients WHERE State = 'CO';
c) DELETE FROM Clients HAVING State = 'CO';
d) DELETE FROM Clients WHERE Customer_ID < 10;
2. How many rows are deleted after the following SQL statement is executed?
DELETE FROM Clients WHERE State = 'CO';
A database management system (DBMS) is system software for creating and managing databases.
The DBMS provides users and programmers with a systematic way to create, retrieve, update and
manage data.
So at a shell prompt you type all one single line to connect to database server install on localhost for vivek user:
$ mysql -u vivek -h localhost -p
Supply the password when prompted for password. Make sure you replace vivek and localhost name with your
database username and hostname.
Task: Use PHP to connect to MySQL
<?php
$link = mysql_connect("localhost", "USERNAME", "PASSWORD");
mysql_select_db("DATABASE");
mysql_close($link);
?>
Make sure you replace USERNAME and PASSWORD with your database user name and password. Also,
replace TABLE and DATABASE with the valid table and database names from your database.
24. Table given and said to convert into corresponding 2 NF and 3 NF.
Overview
1 1st Normal Form / 1NF
2. 2nd Normal Form / 2NF
3. 3rd Normal Form / 3NF
4. Boyce-Code Normal Form (BCNF)
5. 4th Normal Form / 4NF
6. 5th Normal Form / 5NF
A table meets 1st Normal form if it doesn’t have multivalued attribute, composite attribute or its combination in
the same data domain.
Each attribute in that table should have an atomic value (can be divided).
The example below doesn’t meet the 1NF
This table meets the 1NF but doesn’t meet 2NF because lesson_name doesn’t fully dependent to lesson_id
as the primary key.
When it has met the 2NF, and there is no non primary key attribute that dependent to the other non primary
key, the table is met 3NF.
The table below accomplish the 2NF but not 3NF
IN Syntax
SELECT column_name(s)
FROM table_name
WHERE column_name IN (value1, value2, ...);
or:
SELECT column_name(s)
FROM table_name
WHERE column_name IN (SELECT STATEMENT);
Demo Database
Below is a selection from the "Customers" table in the Northwind sample database:
4 Around the Horn Thomas 120 Hanover Sq. London WA1 1DP UK
Hardy
N Operator Examples
[1] The following SQL statement selects all customers that are located in "Germany", "France"
and "UK":
Example
SELECT * FROM Customers
WHERE Country IN ('Germany', 'France', 'UK');
The LIKE operator is used in a WHERE clause to search for a specified pattern in a column.
There are two wildcards used in conjunction with the LIKE operator:
Note: MS Access uses a question mark (?) instead of the underscore (_).
The percent sign and the underscore can also be used in combinations!
LIKE Syntax
Tip: You can also combine any number of conditions using AND or OR operators.
Here are some examples showing different LIKE operators with '%' and '_' wildcards:
WHERE CustomerName LIKE 'a%' Finds any values that starts with "a"
WHERE CustomerName LIKE '%a' Finds any values that ends with "a"
WHERE CustomerName LIKE '%or%' Finds any values that have "or" in any position
WHERE CustomerName LIKE '_r%' Finds any values that have "r" in the second position
WHERE CustomerName LIKE 'a_%_%' Finds any values that starts with "a" and are at least 3 characters in length
WHERE ContactName LIKE 'a%o' Finds any values that starts with "a" and ends with "o"
5 OS
5. What is inter process communication?
Interprocess communication (IPC) is a set of programming interfaces that allow a programmer to coordinate activities
among different program processes that can run concurrently in an operating system. This allows a program to handle
many user requests at the same time. Since even a single user request may result in multiple processes running in the
operating system on the user's behalf, the processes need to communicate with each other. The IPC interfaces make this
possible. Each IPC method has its own advantages and limitations so it is not unusual for a single program to use all of the
IPC methods.
7. Give a scenario in operating system and asked which algorithm fit for it?
Explain the following allocation algorithms.
First Fit
Best fit
Worst fit
Buddy's system
Next fit
Answer:
First Fit
In the first fit approach is to allocate the first free partition or hole large enough which can
accommodate the process. It finishes after finding the first suitable free partition.
Advantage
Disadvantage
The remaining unused memory areas left after allocation become waste if it is too smaller. Thus
request for larger memory requirement cannot be accomplished.
Best Fit
The best fit deals with allocating the smallest free partition which meets the requirement of the
requesting process. This algorithm first searches the entire list of free partitions and considers
the smallest hole that is adequate. It then tries to find a hole which is close to actual process
size needed.
Advantage
Memory utilization is much better than first fit as it searches the smallest free partition first
available.
Disadvantage
It is slower and may even tend to fill up memory with tiny useless holes.
Worst fit
In worst fit approach is to locate largest available free portion so that the portion left will be big
enough to be useful. It is the reverse of best fit.
Advantage
If a process requiring larger memory arrives at a later stage then it cannot be accommodated as
the largest hole is already split and occupied.
Buddy's System
In buddy system, sizes of free blocks are in form of integral power of 2. E.g. 2, 4, 8, 16 etc. Up
to the size of memory. When a free block of size 2k is requested, a free block from the list of
free blocks of size 2k is allocated. If no free block of size 2k is available, the block of next larger
size, 2k+1 is split in two halves called buddies to satisfy the request.
Example
Let total memory size be 512KB and let a process P1, requires 70KB to be swapped in. As the
hole lists are only for powers of 2, 128KB will be big enough. Initially no 128KB is there, nor are
blocks 256KB. Thus 512KB block is split into two buddies of 256KB each, one is further split into
two 128KB blocks and one of them is allocated to the process. Next P2 requires 35KB. Rounding
35KB up to a power of 2, a 64KB block is required.
So when 128KB block is split into two 64KB buddies. Again a process P3(130KB) will be adjusted
in the whole 256KB. After satisfying the request in this way when such block is free, the two
blocks/buddies can be recombined to form the twice larger original block when it is second half
buddy is also free.
Advantage
Buddy system is faster. When a block of size 2k is freed, a hole of 2k memory size is searched
to check if a merge is possible, whereas in other algorithms all the hole list must be searched.
Disadvantage
It is often become inefficient in terms of memory utilization. As all requests must be rounded up
to a power of 2, a 35KB process is allocated to 64KB, thus wasting extra 29KB causing internal
fragmentation. There may be holes between the buddies causing external fragmentation.
Next fit
Next fit is a modified version of first fit. It begins as first fit to find a free partition. When called
next time it starts searching from where it left off, not from the beginning.
1. ls
The ls command - the list command - functions in the Linux terminal to show all of the major directories filed
under a given file system. For example, the command:
ls /applications
...will show the user all of the folders stored in the overall applications folder.
2. cd
The cd command - change directory - will allow the user to change between file directories. As the name
command name suggest, you would use the cd command to circulate between two different directories. For
example, if you wanted to change from the home directory to the Arora directory, you would input the
following command:
cd/arora/applications
As you might have noted, the path name listed lists in reverse order. Logically cd/arora/applications reads
change to the arora directory which is stored in the applications directory. All Linux commands follow a logical
path.
3. mv
The mv command - move - allows a user to move a file to another folder or directory. Just like dragging a file
located on a PC desktop to a folder stored within the "Documents" folder, the mv command functions in the
same manner. An example of the mv command is:
mv/arora/applications/majorapps /arora/applications/minorapps
The first part of the command mv/arora/applications/majorapps lists the application to be moved. In this case,
arora. The second part of the command /arora/applications/minorapps lists where arora will be moved to -
from majorapps to minorapps.
4. man
The man command - the manual command - is used to show the manual of the inputted command. Just like a
film on the nature of film, the man command is the meta command of the Linux CLI. Inputting the man
command will show you all information about the command you are using. An example:
man cd
The inputting command will show the manual or all relevant information for the change directory command.
5. mkdir
The mkdir - make directory - command allows the user to make a new directory. Just like making a new
directory within a PC or Mac desktop environment, the mkdir command makes new directories in a Linux
environment. An example of the mkdir command
mkdir testdirectory
6. rmdir
The rmdir - remove directory - command allows the user to remove an existing command using the Linux CLI.
An example of the rmdir command:
rmdir testdirectory
The example command removed the directory "testdirectory".
It should be noted: both the mkdir and rmdir commands make and remove directories. They do not make
files and they will also not remove a directory which has files in it. The mkdir will make an empty directory
and the rmdir command will remove an empty directory.
7. touch
The touch command - a.k.a. the make file command - allows users to make files using the Linux CLI. Just as the
mkdir command makes directories, the touch command makes files. Just as you would make a .doc or a .txt
using a PC desktop, the touch command makes empty files. An example of the touch command:
touch testfile.txt
The example touch command effectively created the file testfile.txt. As noted by the extension, the file
created is a .txt or text file. To equate, a .txt file in Linux is akin to a .txt notebook file within a Windows or
Mac OS.
8. rm
The rm command - remove - like the rmdir command is meant to remove files from your Linux OS. Whereas
the rmdir command will remove directories and files held within, the rm command will delete created files. An
example of the rm command:
rm testfile.txt
The aforementioned command removed testfile.txt. Interestingly, whereas the rmdir command will only
delete an empty directory, the rm command will remove both files and directories with files in it. This said, the
rm command carries more weight than the rmdir command and should be used with more specificity.
9. locate
The locate - a.k.a. find - command is meant to find a file within the Linux OS. If you don't know the name of a
certain file or you aren't sure where the file is saved and stored, the locate command comes in handy. A locate
command example:
locate -i *red*house**city*
The stated command will locate an file with the a file name containing "Red", "House" and "City". A note on
the input: the use of "-i" tells the system to search for a file unspecific of capitalization (Linux functions in
lower case). The use of the asterik "*" signifies searching for a wildcard. A wildcard tells the system to pull any
and all files containing the search criteria.
By specifying -i with wildcards, the locate CLI command will pull back all files containing your search criteria
effectivley casting the widest search net the system will allow.
10. clear
The clear command does exactly what it says. When your Linux CLI gets all mucked up with various readouts
and information, the clear command clears the screen and wipes the board clean. Using the clear command
will take the user back to the start prompt of whatever directory you are currently operating in. To use the
clear command simply type clear.
------------ ====================== ==========
6 Software Engineering
8. SDLC?
Software Development Life Cycle (SDLC) is a process used by the software industry to
design, develop and test high quality softwares. The SDLC aims to produce a high-quality
software that meets or exceeds customer expectations, reaches completion within times
and cost estimates.
SDLC is a framework defining tasks performed at each step in the software development
process.
What is SDLC?
SDLC is a process followed for a software project, within a software organization. It consists of a
detailed plan describing how to develop, maintain, replace and alter or enhance specific
software. The life cycle defines a methodology for improving the quality of software and the
overall development process.
The following figure is a graphical representation of the various stages of a typical SDLC.
Requirement analysis is the most important and fundamental stage in SDLC. It is performed by
the senior members of the team with inputs from the customer, the sales department, market
surveys and domain experts in the industry. This information is then used to plan the basic
project approach and to conduct product feasibility study in the economical, operational and
technical areas.
Planning for the quality assurance requirements and identification of the risks associated with
the project is also done in the planning stage. The outcome of the technical feasibility study is to
define the various technical approaches that can be followed to implement the project
successfully with minimum risks.
Once the requirement analysis is done the next step is to clearly define and document the
product requirements and get them approved from the customer or the market analysts. This is
done through an SRS (Software Requirement Specification) document which consists of all
the product requirements to be designed and developed during the project life cycle.
SRS is the reference for product architects to come out with the best architecture for the
product to be developed. Based on the requirements specified in SRS, usually more than one
design approach for the product architecture is proposed and documented in a DDS - Design
Document Specification.
This DDS is reviewed by all the important stakeholders and based on various parameters as risk
assessment, product robustness, design modularity, budget and time constraints, the best
design approach is selected for the product.
A design approach clearly defines all the architectural modules of the product along with its
communication and data flow representation with the external and third party modules (if any).
The internal design of all the modules of the proposed architecture should be clearly defined
with the minutest of the details in DDS.
In this stage of SDLC the actual development starts and the product is built. The programming
code is generated as per DDS during this stage. If the design is performed in a detailed and
organized manner, code generation can be accomplished without much hassle.
Developers must follow the coding guidelines defined by their organization and programming
tools like compilers, interpreters, debuggers, etc. are used to generate the code. Different high
level programming languages such as C, C++, Pascal, Java and PHP are used for coding. The
programming language is chosen with respect to the type of software being developed.
Stage 5: Testing the Product
This stage is usually a subset of all the stages as in the modern SDLC models, the testing
activities are mostly involved in all the stages of SDLC. However, this stage refers to the testing
only stage of the product where product defects are reported, tracked, fixed and retested, until
the product reaches the quality standards defined in the SRS.
Once the product is tested and ready to be deployed it is released formally in the appropriate
market. Sometimes product deployment happens in stages as per the business strategy of that
organization. The product may first be released in a limited segment and tested in the real
business environment (UAT- User acceptance testing).
Then based on the feedback, the product may be released as it is or with suggested
enhancements in the targeting market segment. After the product is released in the market, its
maintenance is done for the existing customer base.
SDLC Models
There are various software development life cycle models defined and designed which are
followed during the software development process. These models are also referred as Software
Development Process Models". Each process model follows a Series of steps unique to its type to
ensure success in the process of software development.
Following are the most important and popular SDLC models followed in the industry &miuns;
Waterfall Model
Iterative Model
Spiral Model
V-Model
Other related methodologies are Agile Model, RAD Model, Rapid Application Development and
Prototyping Models.
The Waterfall model is a sequential design process, used in software development processes and it is the first
process model introduced. It is also known as Classic Life Cycle Model (or) Linear Sequential Model.
In a waterfall model, each phase must be completed fully before the next phase can begin. This type of model
is basically used for the project which is small and there are no uncertain requirements. It is very simple to
understand and use.
What is meant by V model?
V- Model means Verification and Validation model and it is a modified version of the Waterfall method. In V-
Model developer and tester works parallel. The V-Model demonstrates the relationships between each phase of
the development life cycle and its associated phase of testing.
What is meant by Incremental model?
The incremental model is an intuitive approach to the waterfall model. Multiple development cycles take place
here, making the life cycle a “multi-waterfall” cycle. Cycles are divided up into smaller, more easily managed
iterations. Each iteration passes through the requirements, design, implementation and testing phases.
What is meant by RAD model?
RAD (rapid application development) is a concept that products can be developed faster and of higher quality
through:
In agile model, the product or solution is first divided into features which need to be developed. If there are new
features identified in the midst of complete product release it again gets planned across sprints. Agile Sprint
duration is decided based on feature to be developed. Every sprint goes through the phases of Requirement,
Design, Development and Testing phase. The most important of the principles is customer satisfaction by giving
rapid and continuous delivery of small and useful software.
What is meant by Iterative model?
An iterative life cycle model does not attempt to start with a full specification of requirements. Instead,
development begins by specifying and implementing just part of the software, which can then be reviewed in
order to identify further requirements. This process is then repeated, producing a new version of the software
for each cycle of the model.
What is meant by Spiral model?
The spiral model is similar to the incremental model, but incorporates risk analysis. The spiral model has four
phases: Planning, Risk Analysis, Engineering and Evaluation. A software project repeatedly passes through
these phases in iterations (called Spirals in this model). The baseline spiral, starting in the planning phase,
requirements are gathered and risk is assessed. Each subsequent spiral builds on the baseline spiral.
Requirements are gathered during the planning phase.
This model of development combines the features of the prototyping model and the waterfall model. The spiral
model is intended for large, expensive, and complicated projects.
The Big Bang model follows no specific process, and very little time is spent on planning. Even the customer is
not sure about what exactly they want and the requirements are implemented on the fly without much analysis.
This is typically used for small projects and not recommended for large or complex projects, as it’s a high-risk
model; if the requirements are misunderstood in the beginning, you could get to the end and realize the project
may have to be started all over again.
What is meant by Prototype model?
A prototype is a model or a program which is not based on strict planning, but is an early approximation of the
final product or software system. A prototype acts as a sample to test the process.
A prototype model focuses on developing the software little by little and tested in a real time environment with
the customers in mind.
What is meant by Capability Maturity model?
Capability Maturity Model is a bench-mark for measuring the maturity of an organization’s software process. It is
a methodology used to develop and refine an organization’s software development process. CMM can be used
to assess an organization against a scale of five process maturity levels based on certain Key Process Areas
(KPA). It describes the maturity of the company based upon the project the company is dealing with and the
clients. Each level ranks the organization according to its standardization of processes in the subject area being
assessed.
Requirements gathering
Design
Implementation
Testing
Maintenance
Software testing is the process of evaluation a software item to detect differences between given input and
expected output. Also to assess the feature of A software item. Testing assesses the quality of the product.
Software testing is a process that should be done during the development process. In other words
software testing is a verification and validation process.
Verification
Verification is the process to make sure the product satisfies the conditions imposed at the start of the
development phase. In other words, to make sure the product behaves the way we want it to.
Validation
Validation is the process to make sure the product satisfies the specified requirements at the end of the
development phase. In other words, to make sure the product is built as per customer requirements.
Black box testing – Internal system design is not considered in this type of testing. Tests are
based on requirements and functionality.
White box testing – This testing is based on knowledge of the internal logic of an application’s
code. Also known as Glass box Testing. Internal software and code working should be known for
this type of testing. Tests are based on coverage of code statements, branches, paths,
conditions.
Unit testing – Testing of individual software components or modules. Typically done by the
programmer and not by testers, as it requires detailed knowledge of the internal program design
and code. may require developing test driver modules or test harnesses.
Incremental integration testing – Bottom up approach for testing i.e continuous testing of an
application as new functionality is added; Application functionality and modules should be
independent enough to test separately. done by programmers or by testers.
Functional testing – This type of testing ignores the internal parts and focus on the output is as
per requirement or not. Black-box type testing geared to functional requirements of an
application.
System testing – Entire system is tested as per the requirements. Black-box type testing that is
based on overall requirements specifications, covers all combined parts of a system.
End-to-end testing – Similar to system testing, involves testing of a complete application
environment in a situation that mimics real-world use, such as interacting with a database, using
network communications, or interacting with other hardware, applications, or systems if
appropriate.
Sanity testing – Testing to determine if a new software version is performing well enough to
accept it for a major testing effort. If application is crashing for initial use then system is not
stable enough for further testing and build or application is assigned to fix.
Regression testing – Testing the application as a whole for the modification in any module or
functionality. Difficult to cover all the system in regression testing so typically automation tools
are used for these testing types.
Acceptance testing -Normally this type of testing is done to verify if system meets the
customer specified requirements. User or customer do this testing to determine whether to
accept application.
Load testing – Its a performance testing to check system behavior under load. Testing an
application under heavy loads, such as testing of a web site under a range of loads to determine
at what point the system’s response time degrades or fails.
Black Box Testing is a software testing White Box Testing is a software testing
method in which the internal method in which the internal
Definition structure/ design/ implementation of structure/ design/ implementation of
the item being tested is NOT known to the item being tested is known to the
the tester tester.
Implementation
Not Required Required
Knowledge
Applications:
Deployment Models
Based on how and where the Cloud is set up and deployed, the cloud may be classified into three major
deployment models
Private Cloud An organization may choose to build a Cloud within their datacenter. The organization
purchases own hardware and software to set up the Cloud. The main intention behind this kind of Cloud is to
deliver cloud service to internal departments within the organization. Security could be a major factor
contributing to the decision to set up a cloud in-house. This type of cloud is known as Private Cloud.
An example of a private cloud deployment is where you maintain your own servers and infrastructure that
hosts your applications and data. What we call a datacenter.
SBI bank in India has built their own private cloud on top of VMware technologies with the name of “
Meghadoot”.
Public Cloud This is a more general form of Cloud. It is deployed to provide cloud-services to the general
population irrespective of their organization affiliation. The services are generally available through a website
using an on-demand payment and subscription mechanism. Public Cloud is considered less secure than Private
Clouds. From an end-user perspective, there’s no capital expenditure involved in setting up a public cloud. The
end-user pays only a monthly subscription fee based on the usage.
Examples: Amazon Elastic Compute Cloud (EC2), IBM's Blue Cloud, Sun Cloud, Google AppEngine and Windows
Azure Services Platform.
Hybrid Cloud As the name indicates, the Cloud is set up to handle a fraction of the workload on Private Cloud
and a fraction of the workload on the Public Cloud.
Typically, a customer would normally place their production workload on the Private Cloud and use Public
Cloud for development and test environments. The workload can be moved between the Private and Public
section of the Hybrid Cloud based on demand. The non-production workload on the public cloud moves back
to the private cloud when the private cloud is less loaded.
Hybrid Clouds combine the benefits of public and private cloud and help further optimize the capital and
operational expenses of running a workload.
An example of the Hybrid Cloud would be a business maintaining in-house backup, but using a services
like oneExchange, a Cloud-based email application provided by NIRIX.
Delivery Models
Another classification of Cloud is based on the layer at which a cloud service is delivered. This model is known
Delivery Model or service model.
IaaS (Infrastructure as s Service) The cloud provides infrastructure services to the end-user on a subscription
basis. The infrastructure services may include custom designed virtual machines, storage and backup
infrastructure, tape backup as service etc. This type of cloud deals primarily with the hardware resources and
services. Some common examples are Amazon EC2, Rackspace etc.
PaaS (Platform as a Service) This type of cloud provides platform services to end-users on a subscription basis.
The platform services may include the webserver stacks, middleware or other similar platforms. Some
common examples are:, Microsoft Azure, IBM blue Mix , Google App Engine, and Force.com moodle LMS etc.
SaaS (Software as a Service) This type of cloud provides software services to end-users on a subscription
basis. The end-user customer is not required to maintain any license for using the cloud provided software. All
updates to the software is taken care by the cloud service provider. For example: Google Apps, Amazon Web
Services, Salesforce.com, Microsoft Office 365 etc.
BPaaS ( Business Process as a Service) This type of cloud provides a particular business process as a service
along with the staff that is required to run the process activities. The end-user is not required to hold any
license or hire any staff for using the Business Process services. This kind of service provides an end-to-end
business process coverage for a business on an on-demand subscription basis. For example: Providing business
analytics as a service to end-customers, tailor made for the business.
[5] Given the situation Which cloud model you will choose and their advantage
and disadvantage
Above----------
1. Smart home
2. Wearable: Apple’s new smartwatch, smartphone
3. Smart City
4. Smart grids
5. Industrial internet
6. Connected car
7. Connected Health (Digital health/Telehealth/Telemedicine)
8. Smart retail
9. Smart supply chain
10. Smart farming
Security must be built into the design of these devices and systems to create trust in both the hardware and
integrity of the data.
2.To gain sales & market intelligence. With CRM solution collects the data about your customers and tries
to make sense of it, presents it to you in various tables and charts. That may include the entire sales cycle, from
winning new customers, to servicing and tracking existing customers, to providing post-sales services.
3.Results closer to established goals. With BI you can keep track of information, and have it accessible by
parties that need it, when they need it. BI goes a long way in helping achieving what you aim for.
4.Return on Investment (ROI). Through better strategic awareness, faster reporting, decreased operating
costs/lower overheads and access to better quality data and information, BI can positively influence a
company‟s ROI.
5.Gain insights into consumer behaviour. One of the main advantages of investing in BI and skilled
personnel is the fact that it will boost your ability to analyze the current consumer buying trends.
6.To improve visibility. If you want to improve your control over various important processes in your
organization, BI will improve the visibility of these processes and make it possible to identify any areas that
need improvement.
7.To turn data into actionable information. A BI system is an analytical tool that can give you the insight
you need to make successful strategic plans for your organization. This is because such a system would be able
to identify key trends and patterns in your organization‟s data and consequently make it easier for you to make
important connections between different areas of your business that may otherwise seem unrelated.
List of BI tools
1. IBM Cognos Intelligence
2. Sisense
3. Tableau
4. Looker
5. Microsoft BI platform
6. Oracle BI
7. Rapid insight
8. SAS BI
[8] Project was on big data. What big data, Hadoop, hive ?
Big data is a term that describes the large volume of data – both structured and unstructured – that floods a
business on a day-to-day basis. But it’s not the amount of data that’s important. It’s what organizations do
with the data that matters. Big data can be analyzed for insights that lead to better decisions and strategic
business moves.
Big data involves the data produced by different devices and applications. Given below are some of the fields
that come under the umbrella of Big Data.
Black Box Data : It is a component of helicopter, airplanes, and jets, etc. It captures voices of the flight
crew, recordings of microphones and earphones, and the performance information of the aircraft.
Social Media Data : Social media such as Facebook and Twitter hold information and the views posted
by millions of people across the globe.
Stock Exchange Data : The stock exchange data holds information about the ‘buy’ and ‘sell’ decisions
made on a share of different companies made by the customers.
Power Grid Data : The power grid data holds information consumed by a particular node with respect
to a base station.
Transport Data : Transport data includes model, capacity, distance and availability of a vehicle.
Search Engine Data : Search engines retrieve lots of data from different databases.
Hadoop
Hadoop is an open source, Java-based programming framework that supports the
processing and storage of extremely large data sets in a distributed computing
environment. It is part of the Apache project sponsored by the Apache Software
Foundation.
Hadoop runs applications using the MapReduce algorithm, where the data is processed in
parallel on different CPU nodes. In short, Hadoop framework is capable enough to develop
applications capable of running on clusters of computers and they could perform complete
statistical analysis for a huge amounts of data.
Cognos concept
Standard Reporting
Ad-Hoc Reporting
Analysis Reporting
Dashboard
Subject Area Analytics
Predictive Analytics
Cognos features:
1. Simple interface
2. Smart search works in context
3. Personalized experience
4. Scheduling and alerts
5. Interactive content available online or offline
6. A complete web-based experience
7. Easy upload of personal/external data
8. Report directly off a data source
9. Effortlessly combine data sources
10. Data models can be automatically generated based on keywords
11. Dashboards created using drag and drop on mobile device or desktop
12. Best automatic visualizations
13. Various reporting templates and styles
14. Data protected with layers of permissions, authentication, and history
15. Report integrity maintained regardless of range of inputs across business
16. Scheduling and alerts
1) Tell me about summer internship and project in details. – very - very Important
6) What difficulty you came across while completing the project. How did you overcome
those difficulties?
9) If we you a project other than your favorite language then how you handle the situation.
9 HR
3) The toughest moment in life? /What is the worst situation you faced? How did you
manage that?
For me, toughest moment was when I had option to choose traditional B.Tech CSE program or B.tech CSE
with specialization in Business Analytics. I did lot of verification and I came to know that specialization
programs have to study 20 credits more including traditional btech CSE but specialized students have wider
acceptability by IT industries, due to having applied skills on current-futuristic technology.
Finally I have chosen , B. Tech in Computer Science & Engineering with specialization in Business Analytics &
optimization.
Why should I recruit you? Why should we hire you? What trait in you will help us in our
company growth? How will you be an asset to us?
Sir, Although I have no experience, I am serious and willing to learn anything. I do things with patience and
hard work. I am quick learner.
4) What is Smart work & Hard Work.. Why 1 do you prefer?
Hard work - working with lot of Effort. Here our Body plays active role.
Smart work - getting the maximum work done with little effort. Here Brain plays active role.
In hard work with dedication and effort one can complete work with in a time limit. Here success is guaranteed. But in
smart work one can attain success using their smart way of thinking.. here success depend on their proper planning,
Creative thinking, skills, effort, etc.
5) Why should I select you and prove how you are optimistic?
In 2014 I have choosen , B. Tech in Computer Science & Engineering with specialization in Business Analytics &
optimization in lieu of Tradition B.tech CSE.
10) What sort of criteria are you using to decide the organization you will work for?
Most importantly, I am looking for a company that values quality , ethics, and teamwork. I would like
to work for a company that hires overachievers.
In long term (6 or 7 years down the line), I will try to become a good manager. Because it's very difficult task
to manage a set of people from various cultural backgrounds, various technical skills, various interests and get
the work (project) done. I want to take up that challenging task.
13. Do you really think as a mechanical engineer you can work in IT field?
Sir(with more confidence), co-founder of Infosys, Mr. Narayan murty had done electrical engineering. Google
CEO, Mr. sundar pichai is from metallurgical engineering, Microsoft CEO, Mr. Satya nadella is from Electrical
engineering. If they can get such high position even though they are from non-cs background, then i can
definitely join Infosys as a trainee. And i also heard that Infosys gives world class training, so i will learn my
best from training.
14. WHAT IS YOUR SALARY REQUIREMENT?
As per industry norms
15. Lastly he asked me “Do you have any questions for me?”
Always have some questions prepared for the interviewer. How soon will I be able to be join? etc.
Infosys Limited is an Indian multinational corporation that provides business consulting, information
technology and outsourcing services. It has its headquarters in Bengaluru, India. Infosys is the second-
largest Indian IT firm by 2016 revenues.
• CEO: U. B. Pravin Rao (Aug 2017–), Vishal Sikka (August 2014 to August 2017)
• Founded: 7 July 1981, Pune
• Profit: US$2.140 billion (2017)
• Total assets: US$12.854 billion (2017)
• Headquarters: Bengaluru
• Founders: N. R. Narayana Murthy, Nandan Nilekani, S. Gopalakrishnan, S. D. Shibulal, K.
Dinesh, N. S. Raghavan , Ashok Arora
Parameters to Accentur
Infosys TCS CTS Wipro Comments
look for e
B.Tech : 3.25 and
Figures in LPA
equivalent,M.Tec
Entry Level Salary 3.1 3.015 2.75 to 3.25 2.75 [Lakh per
h : 3.50 and
annum in INR]
equivalent
Easy
Training
Tough Easy to Moderat Easy Easy -
Standards
e
Figures are in
Training Duration 4 to 5 2 3 2.5 to 3.5 3
months
Salary during
13000 25000 20500 15000 18000 Figures in INR
training
Accomodatio
Accomodation
Yes No No No No n at Mysore
during Training
campus
Entry Assistant Associate
Programmer
LevelDesignation System Engineer System ProjectEngineer Software
Analyst
s Engineer Engineer
Yes [1 year
Bond completion of 2 years No 1 year 1 year
training]
Salary after 1
28000 27000 24000 26000 27500 Figures in INR
year
Has Product Yes (Infosys
No No No No
Company Edgeverve)
Cities are in
Has office 12 Cities 29 Cities 15 Cities 13 Cities 10 Cities
India
Coporate Moderat Below Moderat
Good Good Good
Goverance e e
Indian Foreign Foreign
Origin Indian Company Indian Company
Company Company Company
11 Suggestions:
1. Always Remember confidence and eye contact as well.
2. to keep your responses short and sweet...30 seconds max.
3. What are the right skill required to get a job?
[1] -Creative
[2] -Mindset
[3] -Spirit of innovation
[4] -Excellent communication skill
[5] ability to work in a team
[6] Sense of responsibility
1) www.indiabix.com for interview
2) http://www.mygeekmonkey.com for placement supports
3) Apply for AMCAT or E-Litmus. AMCAT is easy, for E-Litmus u need to prepare from Books like the Arun
Sharma series.
4) Facebook for preparations: AMCAT - eLitmus - Cocubes Prep
5) Books: 3 Set books quants, Apti, Verbal and Reasoning - Arun Sharma
6) Bulk Exams for Placements
Yogi Singh, Placed in Google, cracked Wipro test, IITJEE top 100
Answered Oct 27, 2016
[1] First of all, u need to understand that the LEVEL of aptitude test and interviews or u can
say the placement process is different for different companies. If u wanna prepare for companies
like Infosys, Wipro, TCS, CTS, ITC etc. All u need is to solve R.S. Agrawal, be fluent in English
and have some really basic knowledge of C,C++, JAVA and Bingo! That's it. 100% U'll get placed.
[2] Now comes if u wanna prepare for better companies. Buddy u gotta be really strong in ur
Core Subjects... I tell u, companies like Samsung, Dell etc, they may take upto 4 to 5 rounds.
Mainly technical.
[3] There are other methods to get jobs: Apply for AMCAT or E-Litmus.
AMCAT is easy, for E-Litmus u need to prepare from Books like the Arun Sharma series.
[4] As you are in 3rd year your responsibilities are to get started with the very basics of this
branch. From the very first you have learned about Fundamentals of computer, read them.Then
move towards C, C is the pillar of every coding languages that you may have learned.
Clear out the basic concepts of C.Moving towards C++, most asked part in any interview session.
Learn about the properties of C++ in deep.Focus on algorithms of Data structure and
algorithms.Also learn the operating system and clear your basic concepts.You must know about
the new technologies that are used in industry.Last but not the least keep your command on at
least one language. Command means that you should have the knowledge about each and
everything present in that language, i.e.,in which year that language was developed.What's the
speciality of that language.What properties it holds, etc.A little advice for you, please be very
specific about your career. From this I mean that for which company you want to workwork,
which language is your strength and which is weakness, find out and start working on them.
1.just go through all the key features of any programming language which you are comfortable with...if you
are not too much into programming ,not an issue.just go through each basic features of language and the
syntax for that.
2.Project work which you have done in your college should be your most important weapon when you go for
interview...They will surely ask questions related to that...give u different scenarios related to that project..
answer them confidently .if u r having crystal clear knowledge about your project.. Try to draw interviewer
more into your project so that he asks many questions and answer all questions confidently
3.software engineering is very important...just go through the technical terms ...some key points are
Black box white box testing
Software development life cycle(each phase )
Waterfall ,spiral, agile etc projects..
4.Last and the most important thing...confidence and a bit of attitude...Dont show it more. It can be harmful...
I hope these points will help you...and help you to crack it...
“Best of Luck”