SLK Software ( CALL BASED ONLY THOSE GOT CALL COMPANY ) INTERVIEW

SLK Software ( CALL BASED ONLY THOSE GOT CALL COMPANY )

FOR 2017 BATCH
ONLY THOSE GOT CALL FROM COMPANY

DEVELOPER

Address: 40/A, 5 Cross 12 Main Road, 4th Phase, KHB Colony, SFS 208 Colony, Yelahanka New Town, Bengaluru, Karnataka 560064

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

INTERVIEW QUESTION CHHECK THESE LINKS

**********************************************************************************************
https://www.glassdoor.co.in/Interview/SLK-Group-Associate-Software-Engineer-Interview-Questions-EI_IE331369.0,9_KO10,37.htm

*******************************************************************
Initially it was aptitude round… Which consisting of 4 sections
1) verbal (20 marks)
2) quantitative+logical reasoning(40 marks)
3) technical (15)
4) psychometric
Quantitative n logical reasoning mains contains questions on probability, sequence, odd man out, profit n loss, combinations, ratios, speed, distance, time, allocation n mixtures…
Technical round consists of questions on java, c, guess the output, c++, dbms, data structures…

verbal (20 marks)

Logical Sequence of Words
Syllogism
Cause and Effect
Venn Diagrams
Analogy
Character Puzzles
Classification

Arrange the words given below in a meaningful sequence.

1. Key 2. Door 3. Lock
4. Room 5. Switch on
A. 5, 1, 2, 4, 3
B. 4, 2, 1, 5, 3
C. 1, 3, 2, 4, 5
D. 1, 2, 3, 5, 4
View Answer Discuss in Forum Workspace Report
2.
Arrange the words given below in a meaningful sequence.

1. Word 2. Paragraph 3. Sentence
4. Letters 5. Phrase
A. 4, 1, 5, 2, 3
B. 4, 1, 3, 5, 2
C. 4, 2, 5, 1, 3
D. 4, 1, 5, 3, 2
View Answer Discuss in Forum Workspace Report
3.
Arrange the words given below in a meaningful sequence.

1. Police 2. Punishment 3. Crime
4. Judge 5. Judgement
A. 3, 1, 2, 4, 5
B. 1, 2, 4, 3, 5
C. 5, 4, 3, 2, 1
D. 3, 1, 4, 5, 2
View Answer Discuss in Forum Workspace Report
4.
Arrange the words given below in a meaningful sequence.

1. Family 2. Community 3. Member
4. Locality 5. Country
A. 3, 1, 2, 4, 5
B. 3, 1, 2, 5, 4
C. 3, 1, 4, 2, 5
D. 3, 1, 4, 5, 2
View Answer Discuss in Forum Workspace Report
5.
Arrange the words given below in a meaningful sequence.

1. Poverty 2. Population 3. Death
4. Unemployment 5. Disease
A. 2, 3, 4, 5, 1
B. 3, 4, 2, 5, 1
C. 2, 4, 1, 5, 3
D. 1, 2, 3, 4, 5

6.
Arrange the words given below in a meaningful sequence.

1. Leaf 2. Fruit 3. Stem
4. Root 5. Flower
A. 3, 4, 5, 1, 2
B. 4, 3, 1, 5, 2
C. 4, 1, 3, 5, 2
D. 4, 3, 1, 2, 5
View Answer Discuss in Forum Workspace Report
7.
Arrange the words given below in a meaningful sequence.

1. Nation 2. Village 3. City
4. District 5. State
A. 2, 3, 4, 5, 1
B. 2, 3, 4, 1, 5
C. 1, 3, 5, 4, 2
D. 1, 2, 3, 4, 5
View Answer Discuss in Forum Workspace Report
8.
Arrange the words given below in a meaningful sequence.

1. Caste 2. Family 3. Newly married Couple
4. Clan 5. Species
A. 2, 3, 1, 4, 5
B. 3, 4, 5, 1, 2
C. 3, 2, 1, 4, 5
D. 4, 5, 3, 2, 1
View Answer Discuss in Forum Workspace Report
9.
Arrange the words given below in a meaningful sequence.

1. Cut 2. Put on 3. Mark
4. Measure 5. Tailor
A. 3, 1, 5, 4, 2
B. 2, 4, 3, 1, 5
C. 1, 3, 2, 4, 5
D. 4, 3, 1, 5, 2
View Answer Discuss in Forum Workspace Report
10.
Arrange the words given below in a meaningful sequence.

1. House 2. Street 3. Room
4. Town 5. District
A. 3, 2, 1, 4, 5
B. 3, 1, 4, 2, 5
C. 3, 1, 2, 4, 5
D. 3, 1, 2, 5, 4

Arrange the words given below in a meaningful sequence.

1. Wall 2. Clay 3. House
4. Room 5. Bricks
A. 5, 2, 1, 4, 3
B. 2, 5, 4, 1, 3
C. 2, 5, 1, 4, 3
D. 1, 2, 3, 4, 5
View Answer Discuss in Forum Workspace Report
12.
Arrange the words given below in a meaningful sequence.

1. Probation 2. Interview 3. Selection
4. Appointment 5. Advertisement 6. Application
A. 5, 6, 3, 2, 4, 1
B. 5, 6, 4, 2, 3, 1
C. 5, 6, 2, 3, 4, 1
D. 6, 5, 4, 2, 3, 1
View Answer Discuss in Forum Workspace Report
13.
Arrange the words given below in a meaningful sequence.

1. Elephant 2. Cat 3. Mosquito
4. Tiger 5. Whale
A. 5, 3, 1, 2, 4
B. 3, 2, 4, 1, 5
C. 1, 3, 5, 4, 2
D. 2, 5, 1, 4, 3
View Answer Discuss in Forum Workspace Report
14.
Arrange the words given below in a meaningful sequence.

1. Yarn 2. Plant 3. Saree
4. Cotton 5. Cloth
A. 2, 4, 5, 1, 3
B. 2, 4, 3, 5, 1
C. 2, 4, 1, 5, 3
D. 2, 4, 5, 3, 1
View Answer Discuss in Forum Workspace Report
15.
Arrange the words given below in a meaningful sequence.

1. Infant 2. Old 3. Adult
4. Adolescent 5. Child
A. 5, 4, 3, 2, 1
B. 3, 4, 2, 1, 5
C. 2, 3, 4, 5, 1
D. 1, 5, 4, 3, 2

Arrange the words given below in a meaningful sequence.

1. Leaves 2. Branch 3. Flower
4. Tree 5. Fruit
A. 4, 3, 1, 2, 5
B. 4, 2, 5, 1, 3
C. 4, 3, 2, 1, 5
D. 4, 2, 1, 3, 5
View Answer Discuss in Forum Workspace Report
17.
Arrange the words given below in a meaningful sequence.

1. Tree 2. Seed 3. Flowers
4. Fruit 5. Plant
A. 5, 2, 1, 3, 4
B. 2, 5, 1, 4, 3
C. 2, 5, 1, 3, 4
D. 2, 5, 3, 1, 4
View Answer Discuss in Forum Workspace Report
18.
Arrange the words given below in a meaningful sequence.

1. Adult 2. Child 3. Infant
4. Boy 5. Adolescent
A. 1, 3, 4, 5, 2
B. 2, 3, 5, 4, 1
C. 2, 3, 4, 1, 5
D. 3, 2, 4, 5, 1

A, P, R, X, S and Z are sitting in a row. S and Z are in the centre. A and P are at the ends. R is sitting to the left of A. Who is to the right of P ?

A. A
B. X
C. S
D. Z
View Answer Discuss in Forum Workspace Report
2.
There are 8 houses in a line and in each house only one boy lives with the conditions as given below:

Jack is not the neighbour Siman.
Harry is just next to the left of Larry.
There is at least one to the left of Larry.
Paul lives in one of the two houses in the middle.
Mike lives in between Paul and Larry.
If at least one lives to the right of Robert and Harry is not between Taud and Larry, then which one of the following statement is not correct ?

A. Robert is not at the left end.
B. Robert is in between Simon and Taud.
C. Taud is in between Paul and Jack.
D. There are three persons to the right of Paul.
View Answer Discuss in Forum Workspace Report
3.
A, B, C, D and E are sitting on a bench. A is sitting next to B, C is sitting next to D, D is not sitting with E who is on the left end of the bench. C is on the second position from the right. A is to the right of B and E. A and C are sitting together. In which position A is sitting ?

A. Between B and D
B. Between B and C
C. Between E and D
D. Between C and E

*******************************************************
INTERVIEW QUESTION
*************************************************

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”)) ;
}
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);
// 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.
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

void f()
{
int *ptr = (int *) malloc(sizeof(int));

/* Do some work */

return; /* Return without freeing ptr*/
}
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
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
What are static functions? What is their use?
Ans:In C, functions are global by default. The “static” keyword before a function name makes it static. Unlike global functions in C, access to static functions is restricted to the file where they are declared. Therefore, when we want to restrict access to functions, we make them static. Another reason for making functions static can be reuse of the same function name in other files. See this for examples and more details.

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.

****************************************************************************************************************
DATA STURCTURE
**********************************************

Overview of Data Structures | Set 1 (Linear Data Structures)
A data structure is a particular way of organizing data in a computer so that it can be used effectively. The idea is to reduce the space and time complexities of different tasks. Below is an overview of some popular linear data structures.

1. Array
2. Linked List
3. Stack
4. Queue

Array

Array is a data structure used to store homogeneous elements at contiguous locations. Size of an array must be provided before storing data.
Let size of array be n.
Accessing Time: O(1) [This is possible because elements
are stored at contiguous locations]
Search Time: O(n) for Sequential Search:
O(log n) for Binary Search [If Array is sorted]
Insertion Time: O(n) [The worst case occurs when insertion
happens at the Beginning of an array and
requires shifting all of the elements]
Deletion Time: O(n) [The worst case occurs when deletion
happens at the Beginning of an array and
requires shifting all of the elements]
Example : For example, let us say, we want to store marks of all students in a class, we can use an array to store them. This helps in reducing the use of number of variables as we don’t need to create a separate variable for marks of every subject. All marks can be accessed by simply traversing the array.

Linked List

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 :
1. 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

2. Doubly Linked List : In this type of Linked list, there are two references associated with each node, One of the reference points to the next node and one to the previous node. Advantage of this data structure is that we can traverse in both the directions and for deletion we don’t need to have explicit access to previous node. Eg. NULL<-1<->2<->3->NULL

3. 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. Advantage of this data structure is that any node can be made as starting node. This is useful in implementation of circular queue in linked list. Eg. 1->2->3->1 [The next pointer of last node is pointing to the first]

Accessing time of an element : O(n)
Search time of an element : O(n)
Insertion of an Element : O(1) [If we are at the position
where we have to insert
an element]
Deletion of an Element : O(1) [If we know address of node
previous the node to be
deleted]
Example : Consider the previous example where we made an array of marks of student. Now if a new subject is added in the course, its marks also to be added in the array of marks. But the size of the array was fixed and it is already full so it can not add any new element. If we make an array of a size lot more than the number of subjects it is possible that most of the array will remain empty. We reduce the space wastage Linked List is formed which adds a node only when a new element is introduced. Insertions and deletions also become easier with linked list.
One big drawback of linked list is, random access is not allowed. With arrays, we can access i’th element in O(1) time. In linked list, it takes Θ(i) time.

Stack

A stack or LIFO (last in, first out) is an abstract data type that serves as a collection of elements, with two principal operations: push, which adds an element to the collection, and pop, which removes the last element that was added. In stack both the operations of push and pop takes place at the same end that is top of the stack. It can be implemented by using both array and linked list.
Insertion : O(1)
Deletion : O(1)
Access Time : O(n) [Worst Case]
Insertion and Deletion are allowed on one end.
Example : Stacks are used for maintaining function calls (the last called function must finish execution first), we can always remove recursion with the help of stacks. Stacks are also used in cases where we have to reverse a word, check for balanced parenthesis and in editors where the word you typed the last is the first to be removed when you use undo operation. Similarly, to implement back functionality in web browsers.

Queue

A queue or FIFO (first in, first out) is an abstract data type that serves as a collection of elements, with two principal operations: enqueue, the process of adding an element to the collection.(The element is added from the rear side) and dequeue, the process of removing the first element that was added. (The element is removed from the front side). It can be implemented by using both array and linked list.
Insertion : O(1)
Deletion : O(1)
Access Time : O(n) [Worst Case]
Example : Queue as the name says is the data structure built according to the queues of bus stop or train where the person who is standing in the front of the queue(standing for the longest time) is the first one to get the ticket. So any situation where resources are shared among multiple users and served on first come first server basis. Examples include CPU scheduling, Disk Scheduling. Another application of queue is when data is transferred asynchronously (data not necessarily received at same rate as sent) between two processes. Examples include IO Buffers, pipes, file IO, etc.

Circular Queue The advantage of this data structure is that it reduces wastage of space in case of array implementation, As the insertion of the (n+1)’th element is done at the 0’th index if it is empty.
*****************************************************************************************************************************************************************************