IBM Technical Interview Questions
1) What are the Semaphores?
Semaphore is a “procedure synchronization device” or variable or abstract data type which is used to control access to a common resource by multiple processes in a concurrent system such as a multitasking operating system.
It assigns two tasks:
- wait (p)
- signal (v)
It expresses that if there are numerous processes sharing the same variable, at that point different processes must hold up it until the point when the procedure in the basic area is finished, as the procedure in the basic segment is finished, it sends a flag to alternate procedure to enter the basic segment.
2) What is Synchronization?
Synchronization is the procedure by which Data Protection Manager (DPM) exchanges information changes from an ensured record server to a DPM server, and afterward applies the progressions to the copy of the secured information. DPM depends on synchronization to keep imitations synchronized with the ensured information on the document servers.
3) What is the virtual memory?
Virtual memory is a memory administration capacity of an OS that utilizes equipment and programming to enable a PC to make up for physical memory deficiencies by briefly exchanging information from irregular access memory (RAM) to plate stockpiling.
4) What are paging, faulting, and deadlock?
In PC working frameworks, paging is a memory administration by which, computer stores and recovers information from secondary storage for use in main memory. In this scheme, the operating system retrieves data from secondary storage in same-size blocks called paging.
Faulting: A page fault (now and then called #PF, PF or hard fault) is a sort of special case raised by PC equipment when a running system gets to a memory page that isn’t right now mapped by the memory administration unit (MMU) into the virtual address space of a procedure.
Deadlock: A deadlock is a situation in which two computer programs sharing the same resource are effectively preventing each other from accessing the resource, resulting in both programs ceasing to function. The earliest computer operating systems ran only one program at a time procedure.
5) Evaluate a+=a+ ++a if a=20 initially.
a += a+ (++a) is the same as a = a + a + (++a) First thing that happens is that a++ will set a to 21, after that it will calculate: a = a + a + a; 21 + 21 + 21 = 63 so the result is 63.
6) What is Process Scheduling?
The procedure planning is the action of the procedure director that handles the expulsion of the running procedure from the CPU and the determination of another procedure based on a specific methodology.
Process planning is a fundamental piece of Multiprogramming working frameworks. Such working frameworks enable in excess of one procedure to be stacked into the executable memory at once and the stacked procedure shares the CPU utilizing time multiplexing.
7) Difference between Quick Sort and Merge Sort.
Comparison | Quick Sort | Merge Sort |
---|---|---|
Partition of the element in the array. | The splitting of a list of elements is not necessarily divided into half. | The Array is always divided into half(n/2) |
Worst Case Complexity | O(n2) | O(n log n) |
Speed | Faster than another sorting algorithm for the small dataset. | Consistent speed in all type of datasets. |
Additional Storage Space Requirement | Less | More |
Efficiency | Inefficient for the larger array. | More efficient |
Sorting Method | Internal | External |
8) What is Base Class and Derived Class? How are these two interrelated?
Derivation (C++ only) Inheritance is implemented in C++ through the mechanism of derivation. Derivation allows you to derive a class, called a derived class, from another class, called a base class. In the declaration of a derived class, you list the base classes of the derived class.
9) What is the advantage of inheritance in OOPS??
The most frequent use of inheritance is for deriving classes using existing classes, which provides reusability. The existing classes remain unaltered. By reusability, the development time of software is reduced. The derived classes extend the properties of base classes to generate more dominant objects.
10) What is Procedural Programming?
Procedural programming is a programming paradigm that uses a linear or top-down approach. It relies on procedures or subroutines to perform computations.
Procedural programming is also known as imperative programming.
11) What is the Entry Control Loop?
A passage control circle checks the condition at the season of the section and if condition or articulation turns out to be genuine at that point control moves into the body of the circle. Such kind of circle controls passage to the circle that is the reason it is called the section control circle.
12) What is Variable Scope?
A scope is a region of the program and broadly speaking there are three places, where variables can be declared ? Inside a function or a block which is called local variables. In the definition of function parameters which is called formal parameters. Outside of all functions which are called global variables.
13) What is Dangling Else problem?
Dangling else is a problem happens when we utilize settled if. … Here in the above case we really need to give the else provision to the external most if condition however it is considered for the deepest if condition .this is called dangling else problem.
14) What is the Condition of Deadlock?
Deadlock can exist if and only if 4 conditions hold simultaneously:
- Mutual exclusion: at least one process must be held in a non-sharable mode.
- Hold and wait: there must be a process holding one resource and waiting for another.
- No preemption: resources cannot be preempted.
- Circular wait: there must exist a set of processes
[p1, p2, , pn] such that p1 is waiting for p2, p2 for p3, and so on.
15) What does Object Oriented Database Management System (OODBMS)?
An object-oriented database management system (OODBMS) is a database management system that supports the creation and modeling of data as objects. OODBMS also includes support for classes of objects and the inheritance of class properties and incorporates methods, subclasses, and their objects.
Also called an object database management system (ODMS).
16) Difference between Structure and Union.
The Basis of Comparison | Structure | Union |
---|---|---|
Basic | The isolated memory area is distributed to every individual from the ‘structure’. | All individuals from the ‘association’ share a similar memory area. |
Declaration |
struct struct_name { type element1; type element2; . . } variable1, variable2, ...; |
union u_name{ type element1; type element2; . . } variable1, variable2, ...; |
Keyword | ‘struct’ | ‘union’ |
Size | Size of Structure=entirety of the size of the considerable number of information member. | Size of Union=Size of the biggest individuals. |
At a Time | A ‘structure’ stores numerous qualities, of the diverse individuals, of the ‘structure’. | An ‘association’ stores a solitary incentive at any given moment for all individuals. |
The Way of Viewing | Provide a single approach to see every memory location | Provide numerous approach to see the same memory area. |
Anonymous Feature | No Anonymous feature | Anonymous association can be pronounced. |
17) What is the purpose of ‘SUDO’ Command?
The reason for sudo is to execute the charge given to it with root benefits. The motivation behind su is to switch the present client setting. It is fundamentally an antecedent to sudo. On the off chance that no client name is determined for su, at that point it changes to root.
18) What is the String?
In programming, a string is a contiguous sequence of symbols or values, such as character strings (a sequence of characters)or a binary digits string(a string of binary values).
19) What is an Array? What is the Importance of an Array?
An array is a data structure that contains a group of elements. Regularly, these elements are of the same data type such as integer or string. Arrays are commonly used in the computer program to organized data so that a related set of values can be easily sorted or searched.
Importance:
1. it is a better and convenient way of storing data of the same data type with the same size.
2. It allows users to store a number of elements in it.
20) What is the advantage and disadvantage of the stored procedure?
Advantage:
- Maintainability: Since contents are in one area, updates and following of conditions in light of composition changes ends up less demanding.
- Testing: Can be tried autonomous of the application.
- Speed: 1. Stored Procedure is cache on the server.
2. Execution plans for the process are easily reviewable without having to run the application.
Disadvantage:
- Restricted Coding Functionality: Put away technique code isn’t as hearty as application code, especially in the territory of circling (also that iterative builds, similar to cursors, are moderate and processor escalated)
- Testing: Any information blunders in dealing with Stored Procedures are not produced until runtime