Wipro Technical Interview Questions
1) What are the functionalities of an operating system?
These are some major functionalities of an operating system:
- The operating system shares the Computer’s memory and sharing of the central processing unit time by various applications and peripheral devices.
- An operating system provides a user interface, i.e., graphical user interface and command line.
- An operating system includes functionality for booting the computer.
- Perform some basic tasks, i.e., managing the peripheral devices.
- It provides file management which refers to the way that operating system stores, retrieves, manipulates, and saves data.
2) What is the difference between UNIQUE key and PRIMARY key constraints?
Difference between unique key and primary key constraints:
| Unique key | Primary key |
|---|---|
| A table can contain multiple unique keys. | A table can contain only one primary key. |
| NULL values are allowed. | NULL values are not allowed. |
| It helps to maintain a unique data in a column of a table. | It helps to identify a unique row from a table. |
| For MS SQL server databases, a unique constraint will generate a unique NON-CLUSTERED INDEX | Primary key will generate a unique CLUSTERED INDEX |
3) How can you delete the duplicate row in a table?
In case of duplicate rows, you have to be more careful at the time of fetching records from the table.
To overcome this problem, we use a DISTINCT keyword.
It is used along with a SELECT statement to eliminate all duplicate records and fetching unique records.
Syntax:
The basic syntax to eliminate duplicate records from a table is:
- SELECT DISTINCT column1, column2,….columnN
- FROM table _name
- WHERE [conditions]
4) Define the SQL Profiler?
SQL Profiler can be defined as the profiler utility which is mainly used to track connections to the SQL Server and also determine the activities such as which SQL Scripts are running, and which one is getting failed, etc.
5) What is stored procedure? Explain with example.
Stored procedures are a batch of SQL statements that can be executed in a couple of ways. Most of the DBMS support stored procedures; however, not all do. The stored procedure increases the reusability as here the code or the procedure is stored into the system and used again and again that makes the work easy.
Syntax:
- CREATE PROCEDURE procedure_name
- AS
- sql_statement
- GO;
To execute a stored procedure
- EXEC procedure_name;
Create a table and use this syntax for example.
6) What is a process and what is a thread?
A thread is a lightweight sub-process, the smallest unit of processing. It is a separate path of execution.
Threads are independent that means if there is an exception in one thread, it doesn’t affect other threads. It uses a shared memory area.
The process is heavyweight and can consists of multiple threads. It is a small part of a program.
7) What are the advantages of a thread? How does the multithreading look like?
These are the following advantages of a Thread:
- It provides efficient communication.
- It minimizes the context switching time.
- By using thread, we can get the concurrency within a process.
- Thread allows utilization of multiprocessor architectures to a greater scale and efficiency.
- A process which executes multiple threads simultaneously is known as multithreading.
- A thread is a lightweight sub-process, the smallest unit of processing.
To achieve multitasking in java, we have two ways:
Multiprocessing and multithreading
One process may contain more than one thread and execute simultaneously is known as multi-threading.
8) What are Multi-Processing and Multitasking?
Multitasking: As the name indicates multiple tasks run on a single CPU. We use multitasking to utilize the CPU.
Multitasking can be achieved in two ways:
- Process-based Multitasking (Multiprocessing)
- Thread-based Multitasking (Multithreading)
Multi-processing: Multi-processing refers to the ability of a system to support more than one central processing unit at the same time.
Multithreading: As the name indicates multiple threads run concurrently.
A thread is a lightweight sub-process, the smallest unit of processing.
9) What are stack and Queue and its applications?
Stack
- The stack is an ordered list in which, insertion and deletion can be performed only at one end that is called a top.
- The stack is a recursive data structure having a pointer to its top element.
- Stacks are sometimes called as Last-In-First-Out (LIFO) lists, i.e., the element which is inserted first in the stack will be deleted last from the stack.
Applications of Stack:
- Recursion
- Expression evaluations and conversions
- Parsing
- Browsers
- Editors
- Tree Traversals
Queue
- A queue can be defined as an ordered list which enables insert operations to be performed at one end called REAR and delete operations to be performed at another end called FRONT.
- The queue is referred to be as the First-In-First-Out list.
- For example, people waiting in line for a rail ticket form a queue.
Applications of Queue:
- The queues are widely used as waiting lists for a single shared resource like a printer, disk, CPU.
- The queues are used in the asynchronous transfer of data (where data is not being transferred at the same rate between two processes), e.g., Pipes, file IO, sockets.
- The queues are used as buffers in most of the applications like MP3 media player, CD player, etc.
- The queues are used to maintain the playlist in media players to add and remove the songs from the playlist.
- The queues are used in operating systems for handling interrupts.
10) What is indexing, what are the advantages and disadvantages of it?
Indexes are special lookup tables. It is used to retrieve data from the database very fast.
An Index is used to speed up select queries and where clauses. But it shows down the data input with insert and update statements. Without affecting the data, we can create or drop indexes
An index in a database is just like an index in the back of a book.
Indexing can be of the following types
Primary index, secondary index, and clustering index.
The advantages of indexes are as follows:
- An index makes it possible to retrieve data quickly.
- Index’s use in queries usually results in much better performance.
- They can be used for sorting. A post-fetch-sort operation can be eliminated.
- Index guarantees uniquely identifiable records in the database.
The disadvantages of indexes are as follows:
- Indexes decrease the performance on inserts, updates, and deletes.
- Indexes take up space (this increase with the number of fields used and the length of the fields).
- Databases will have monocase values in fields that are indexed.
11) What is De-Normalization where does it have?
Denormalization is the process of boosting up database performance and adding of redundant data which helps to get rid of complex data. Denormalization is a part of database optimization technique. This process is used to avoid the use of complex and costly joins.
Denormalization doesn’t refer to the thought of not to normalize instead of that denormalization takes place after normalization. In this process, firstly the redundancy of the data will be removed using normalization process than through denormalization process we will add redundant data as per the requirement so that we can easily avoid the costly joins.
12) What are the Different Objects in DBMS?
A database objects use to store or reference data in the database. Any statement which is written with CREATE Command is known as the database object.
Different types of object in DBMS are:
View: This object is used to create a view in the database. It is a logical table based on another view. A table on which view is based is called the base table.
Table: we can create a table in a database by using the CREATE TABLE statement.
Sequence: This object command used to create a sequence in the database. It is a user-created database object which is shared by multiple users to generate unique integers.
Index: A database object can create indexes in the database by using an index. Indexes are used for fast retrieval of rows from a table.
Synonym: This object is also used for creating indexes in the database. By synonym, you can easily access the objects
13) What are Self-Join and Outer Join, where do you use it?
Self-Join: A self-join is a join which joins the table with itself, means that each row of the table is combined with itself and with every other row of the table. The table contains a FOREIGN KEY which references its PRIMARY KEY.
It shows the one-to-many relationship in a table also known as a unary relationship.
Now come to SQL outer join, all the content of both tables is integrated together either they are matched or not.
An outer join is of two types:
1. Left outer join (also known as left join): this join returns all the rows from left table combine with the matching rows of the right table. If you get no matching in the right table, it returns NULL values.
Syntax: Left outer join
- SELECT table1.column1, table2.column2…..
- FROM table1
- LEFTJOIN table2
- ON table1.column_field = table2.column_field;
2. Right outer join (also known as right join): this join returns all the rows from right table are combined with the matching rows of left table .If you get no column matching in the left table .it returns null value.
Basic syntax for right joins:
- SELECT table1.column1, table2.column2…..
- FROM table1
- RIGHT JOIN table2
- ON table1.column_field = table2.column_field;
15) Explain some differences between TRUNCATE and DELETE commands with their syntax?
There is a slight difference b/w delete and truncate statement. The DELETE statement only removes the rows from the table based on the condition defined by WHERE clause or remove all the rows from the table when the condition is not specified.
But it does not free the space containing by the table.
16) Define memory management in C.
When you run a program, it loads into your computer memory and starts execution by sending and receiving the instructions from the computer’s processor. When your program needs to run a function, then it loads at another part of the memory till it runs and releases that memory when the task is complete.
Now, talk about the concept of dynamic memory allocation in c language, which enables the C programmer to allocate memory at runtime. Dynamic memory allocation in c language is possible by four functions of stdlib.h header file.
- malloc()
- calloc()
- realloc()
- free()
17) What are the steps involved in designing complete software?
To build software, a programmer should have to follow the SDLC.
Software development life cycle is a process of developing new software
There are six steps of SDLC:
- Planning: Plan about the scope, approach, functionalities, etc.
- Requirement analysis: Gather the required tools, data, and information that are required for the project
- Designing: Design a prototype to check the architecture of the project.
- Coding: coding as per designing.
- Testing: testing is done to check whether the actual result meets the required result.
- Maintenance: Updates
18) What is the difference between Abstract classes and interface?
Java interface should be implemented using the keyword “implements”; A Java abstract class should be extended using the keyword “extends.”
An Interface can extend interface only; Abstract class have two properties, it can extend only one java class but implement more than one interface at a time.
19) What is the property of a class?
We can define property in a way that property is a member of a class that provides the access of an object or a class to an attribute. For e.g., Properties include the length of a string, the size of a font, the caption of a window, the name of a customer, and so on.
20) Define precondition and postcondition to a member function.
A pre-condition is a condition that must be true before a method runs for it to work
A post-condition is a condition that must be truly guaranteed after a method is finished.
If all the preconditions of this method are satisfied, then postconditions will also meet for the same method.
No guarantee for behavior if the preconditions not meet.
21) How can you sort the elements of an array in ascending order?
C program to sort the element of an array in ascending order.
- #include<stdio.h>
- include<conio.h>
- void main()
- {
- int i, j, a, m, num[30];
- printf(“Enter the value of N \n”);
- scanf(“%d”, &m);
- printf(“Enter the numbers \n”);
- for (i = 0; i < m; ++i)
- scanf(“%d”, &num[i]);
- for (i = 0; i < m; ++i)
- {
- for (j = i + 1; j < m; ++j)
- {
- if (num[i] > num[j])
- {
- a = num[i];
- num[i] = num[j];
- num[j] = a;
- }
- }
- }
- printf(“Ascending order of elements \n”);
- for (i = 0; i < m; ++i)
- printf(“%d\n”, num[i]);
- }
22) How can you sort the elements of an array in descending order?
C program to sort the element of an array in descending order.
- #include<stdio.h>
- include<conio.h>
- void main ()
- {
- int num[30];
- int i, j, a, m;
- printf(“Enter the value of N\n”);
- scanf(“%d”, &m);
- printf(“Enter the numbers \n”);
- for (i = 0; i < m; ++i)
- scanf(“%d”, &num[i]);
- /* sorting begins … */
- for (i = 0; i < m; ++i)
- {
- for (j = i + 1; j < m; ++j)
- {
- if (num[i] < num[j])
- {
- a = num[i];
- num[i] = num[j];
- num[j] = a;
- }
- }
- }
- printf(“Descending order of the elements \n”);
- for (i = 0; i < m; ++i)
- {
- printf(“%d\n”, num[i]);
- }
- }
23) How is macro execution faster than a function?
Macros can define before the main method or within the main method. Macros are pre-processed that means all the macros are processed before the compilation of the program, and the functions are processed after compilation of the program.
24) Write a program to sort the string by using bubble sort.
Bubble sort: Bubble sort is a technique by which you can print the elements of an array in ascending or descending order. Bubble sort is used to sort string too.
Program to sort the string:
- #include <stdio.h>
- #include <string.h>
- void main()
- {
- int num, i, j;
- char name[15][20], temp[20];
- printf(“\n Sorts the strings of an array using bubble sort :\n”);
- printf(“Number of strings :”);
- scanf(“%d”, &num);
- printf(“Input string %d :\n”, num);
- for(i=0;i<=num; i++)
- {
- fgets(name[i], sizeof name, stdin);
- }
- for(i=1;i<=num;i++)
- for(j=0;j<=num-i;j++)
- if(strcmp(name[j],name[j+1])>0)
- {
- strcpy(temp,name[j]);
- strcpy(name[j],name[j+1]);
- strcpy(name[j+1],temp);
- }
- printf(“The strings appears after sorting :\n”);
- for(i=0;i<=num;i++)
- printf(“%s\n”,name[i]);
- }
25) Write code in C to print “hello world” without using a semicolon
- #include<conio.h>
- #include<stdio.h>
- void main()
- {
- if(printf(“hello world”))
- {
- }
- }
Output:
hello world
26) Write a program to find factorial of a number.
- #include<conio.h>
- #include<stdio.h>
- Void main()
- {
- int i, fact=1, num;
- clrscr();
- printf(“Enter the number for which you want to find factorial\n”);
- scanf(“%d”, &num);
- for(i=1;i<=num; i++)
- {
- fact=fact*i;
- }
- printf(“Factorial of %d is : %d”,num,f);
- return 0;
- }
27) Write a C program for Fibonacci series.
- #include<stdio.h>
- #include<conio.h>
- int main()
- {
- int n1=0,n2=1,n3,i,number;
- printf(“Enter the number of elements:”);
- scanf(“%d”,&number);
- printf(“\n%d %d”,n1,n2); //printing 0 and 1
- for(i=2;i<number;++i) //loop starts from 2 because 0 and 1 are already printed
- {
- n3=n1+n2;
- printf(” %d”,n3);
- n1=n2;
- n2=n3;
- }
- return 0;
- }
28) What is the logic behind reverse of a string in java?
The reverse of a string:
- import java.util.*;
- class ReverseString
- {
- public static void main(String parvez[])
- {
- String original, reverse= ” “;
- Scanner in=new scanner(system.in);
- System.out.println(“Enter the string: “);
- original= in.nextLine();
- int length=original.Length();
- for(i=length-1;i>=0;i–)
- reverse=reverse+original.charAt(i);
- System.out.println(“Reversed string: “ +reverse);
- }
- }
Output:
Enter the string: parvez Reverse string: zevrap
29) Name the operators that can’t be overloaded.
These are the following operators that can’t be overloaded.
- Scope Resolution operator (::)
- Pointer-to-member Operator (.*)
- Member Access or Dot Operator (.)
- Ternary or conditional operator (?:)
- Object size Operator (sizeof)
- Object type operator (typeid)
30) What is polymorphism?
In an object-oriented programming language, polymorphism is a characteristic which means one name with many forms.
We can say that polymorphism shows different behavior in a different scenario.
There are two types of Polymorphism.
- Compile time polymorphism: It is known as method overloading.
- Runtime polymorphism: it is also known as method overriding.
31) How is C++ struct different from C++ class?
A struct is a bundle. It is a combination of all related elements that need to work together in a particular context. Such as, the restricted number of arguments context can pass to a function:
If you don’t specify the access modifier, visibility (public, private or protected) of the members will be public in the struct and private in the class.
The visibility by default goes just a little further than members: for inheritance, if you don’t specify anything then the struct will inherit publicly from its base class, while the class will do private inheritance:
32) What is DOM?
DOM stands for Document Object Model. It is a programming API for the HTML and XML documents. DOM provides the logical structure of the document and the way in which a document is accessed and manipulated.
DOM represents a table in the hierarchical form.
33) Specify the characters which can be used as the second character of an identifier, but not as the first character of an identifier?
Any number within the range of 0 to 9 can be taken as the second character of an identifier, but as per restriction, it can’t be treated as the first character on an identifier.
34) What Is The List Interface?
List Interface is the subinterface of Collection. It contains methods to insert and delete elements on an index basis. It is a factory of List-Iterator interface. Lists may contain duplicate items. The List interface includes operations for the following:
- Positional Access: Manipulate elements based on their numerical position in the list.
- Search: Search for specified objects in the list and return its numerical position.
- List Iteration: Extend Iterator semantics to take advantage of the list’s sequential nature.
- Range-view: Perform arbitrary range operations on the list.
List Interface declaration
- public interface List<E> <strong>extends</strong> Collection<E>
35) What Is The Vector Class?
Vector implements List interface and maintains insertion order. Array list and vector class both are similar but with few differences.
Vector is synchronized: Vector is slow because it is synchronized, i.e., in multithreading environment; it will hold the other threads in runnable or non-runnable state until current thread releases the lock of the object.
Vector is a legacy class
Vector increments 100% means doubles the array size if the total number of elements exceeds than its capacity.
36) What is an Iterator Interface?
An iterator is a Java interface, and it has methods to iterate on elements of collections.
You can create your iterator object by calling iterator() method present in collection interface.
The methods of the interface are:
- hasNext(): To know if any other elements left in the collection.
- next (): Returns the next element.
- remove (): To remove the current element from the collection(better not use that method).
37) What is the major difference between yield () and sleep ()?
Sleep () method in Java has two variants one which takes millisecond as sleeping time while other which takes both millisecond and nanosecond for the sleeping duration.
Yield () method pause all the currently executing thread, and give a chance to execute those threads or processes that need to be run. The current thread will continue to run again if no other thread is available to execute.
38) What Are Wrapped Classes?
Wrapper class in Java provides the mechanism to convert primitive into object and object into primitive. The eight classes of the java.lang package is known as wrapper classes in java.
The list of eight wrapper classes is given below:
| Primitive Type | Wrapper class |
|---|---|
| Boolean | Boolean |
| Char | Character |
| Byte | Byte |
| Short | Short |
| Int | Integer |
| Long | Long |
| Float | Float |
| Double | Double |
39) What is garbage collection? Does it guarantee that a program will not run out of memory?
Garbage collection:
Garbage Collection is a process of reclaiming the unused runtime memory automatically. i.e., it is a way to destroy the unused objects.
To do so, we were using free () function in the C language and delete () in C++. But, in Java, it is performed automatically. So, java provides better memory management.
In some cases, programs use up memory resources faster than they are garbage collected. We can also create objects “without new keyword” in programs that are not subject to garbage collection. That’s why garbage collection doesn’t guarantee that a program will not run out of memory.
40) What is the Name of the immediate superclass of the Applet class?
A panel is the immediate superclass of all Applet class.
The panel allows us to format the string.
A panel must have a specific layout out of FlowLayout, BorderLayout, GridLayout. If a Layout is not specified, then the default will be a FlowLayout.
41) What Is A Native Method?
The native is a keyword applied to a method to show that the method is implemented in Native Code (c, c++) using JNI (Java Native Interface). Hence, it is also known as foreign methods. It acts as an interface between Java Native Interface (JNI) and other programming languages.
It is a modifier that is not applicable to classes and objects. Native method declaration should compulsory ends with “;” because its implementation is already given.
42) What are the collections API?
The Collection in Java is a framework that provides an architecture to store and manipulate the group of objects.
All the operations that you perform on a data such as searching, sorting, insertion, manipulation, deletion, etc. can be achieved by Java Collections.
Java Collection means a single unit of objects. Java Collection framework provides many interfaces (Set, List, Queue, Deque, etc.) and classes (ArrayList, Vector, LinkedList, PriorityQueue, HashSet, LinkedHashSet, TreeSet, etc.)
Collection framework has:
- Interfaces and its implementations, i.e., classes
- Algorithm
43) List out some modifiers that may be used with an Inner class that is a member of an Outer class?
All the modifiers such as
- public
- private
- abstract
- final
- protected
- strictfp
- static
- default
44) What is the name of the method of the component class which is used to set the position and size of a component?
setBounds () method is having four coordinates (x, y, width, height) to specifying the position and size of a GUI component .
45) Which Java.util Classes and Interfaces Support Event Handling?
- java.awt.event.*; Support event handling.
46) How many number of bits are used to represent a character in Unicode, ASCII, UTF-32, UTF-16, And UTF-8 characters?
Unicode requires 16 bits (2 bytes) to represent a character, ASCII requires 7 or 8 bits, and UTF-8 requires 8, 16 and 18-bit pattern.
UTF=16 requires 16 bits and 32 bits pattern.
UTF-32 requires 32 bits pattern
47) What are the restrictions for the location of a package statement within a source code file?
Restriction for the package:
A package must be appeared in the first line of the program source code, excluding blank lines and comments.
48) What are the major differences between preemptive scheduling and time slicing?
Preemptive scheduling:
Under primitive scheduling, the highest priority task executes until it enters the waiting or dead states or any other higher priority task comes into existence.
Time slicing:
Time slicing: A task executes for a fixed period of time and then reenters again in the pool of ready tasks to execute the remaining task later. The scheduler then determines that which task should execute next, based on priority and other factors.
49) Give the name of three component subclasses that support painting.
The canvas class, the Frame class, and Applet class are the subclasses which support painting.
50) When a Readline () reach at the end of file then what will it return?
Readline() will return a null value when it would reach at the end of the file.
51) What is the name of the immediate superclass of the Dialog class?
The window class is the immediate superclass of Dialog class.
52) Define Order of precedence and Associativity, how are they used?
Order of precedence is used with the operators. When a number of operators are used in an expression, it evaluates with the priority of the operators.
Associativity is used to check whether an expression is evaluated from left-to-right or right-to-left.
Order of precedence example:
- (5 > 2 + 5 && 4)
The given expression is equivalent to:
- ((5 > (2 + 5)) && 4)
The expression (2 + 5) will executes first and the result will be 7
Then after first part of the expression (5 > 7) executes and gives 0 (false) as an output
Finally, (0 && 4) executes and gives 0 (false).
Associativity:
- 4 * 2 / 4
Here, operators * and / have the same precedence. Both “*” and “/” are left to right associative, i.e., the expression on the left is executed first and moves towards the right.
Thus, the expression above is equivalent to:
- ((4 * 2) / 4)
- i.e., (4 * 2) executes first and the result will be 8 (true)
- then, (8 / 4) executes and the final output will be 2 (true)
53) What is the rule for a catch or declare method declarations?
Catch block catches any exception that results from the try block. If a checked exception is thrown within the body of the method, the thrown exception must be caught by the method (with the help of try/catch block) or declare it in its throws clause.
54) What is the top class of the AWT Event Hierarchy?
java.awt.AWTEVENT class is the highest-level class of AWT event hierarchy.
55) When is a thread created and started, what is its initial state?
A thread is created and started with its Initial state called “ready” state where a thread is ready to run.
56) Is it possible to declare an anonymous class which implements an interface and extends a class?
Yes, an anonymous class can extend its superclass or implement an interface but cannot use both simultaneously.
57) Define Synchronization and why is it important?
Synchronization is a process which provides a feature by which access of multiple threads to any shared resource can control.
Hence, Java Synchronization is a better option for restriction. i.e., It allows only one thread to access the shared resource.
The synchronization is mainly used to
- To prevent thread interference.
- To prevent consistency problem.
58) Is Sizeof a Keyword?
Sizeof is an operator in C++ and a keyword in C, but it is not available in java.
59) What is a priority of task and how is it used in scheduling?
The entire task can’t execute simultaneously so that a scheduler assign priorities to all tasks for its execution. Priorities can be high or low depending on the task’s importance, and the integer values determine it.
Higher priority gets CPU for execution first.
60) Describe the three levels of data abstraction?
Data abstraction in DBMS is a process of hiding irrelevant details from users. Because database systems are made of complex data structures, so it makes accessible the user interaction with the database.
Following are three levels of data abstraction:
Physical level: It is the lowest level of abstraction. It describes how data are stored.
Logical level: It is the next higher level of abstraction. It describes what data are stored in the database and what the relationship among those data is.
View level: It is the highest level of data abstraction. It describes only part of the entire database.
61) What is Hashing technique in the data structure?
Hashing is a faster searching technique. The process of mapping a large amount of data item to a smaller table with the help of a hashing function is called hashing. In other words, hashing is a technique to convert a range of key values into a range of indexes of an array.
In terms of java: Hashing is a way to assign a unique code for any variable or object after applying any function or algorithm on its properties.







