Open In App

IBM Interview Questions and Answers for Technical Profiles

Last Updated : 09 Nov, 2023
Improve
Improve
Like Article
Like
Save
Share
Report

IBM is one of the top technical company in the world and it’s interview process is highly competitive and difficult. If you want to get a job for a technical role at IBM it is very important for you to be prepared to answer a wide range of questions about your experience, skills and knowledge. This article contains frequently asked questions in technical interviews at IBM. So keep reading in order to ace your interview and land your dream job.

To know more about IBM Recruitment Process please go through this attached link

1. What is Process Scheduling ?
Process scheduling is the activity of the process manager that handles the removal of the running process from the CPU and the selection of another process on the basis of a particular strategy.

2.What is a Deadlock in Operating System ?
. A deadlock is a situation where a set of processes are blocked because each process is holding a resource and waiting for another resource acquired by some other process.

3. What is virtual memory in OS ?
Virtual Memory is a storage allocation scheme in which secondary memory can be addressed as though it were part of the main memory. The addresses a program may use to reference memory are distinguished from the addresses the memory system uses to identify physical storage sites and program-generated addresses are translated automatically to the corresponding machine addresses.

4. What is Process Synchronization ?
Process Synchronization is the coordination of execution of multiple processes in a multi-process system to ensure that they access shared resources in a controlled and predictable manner. It aims to resolve the problem of race conditions and other synchronization issues in a concurrent system.

5. How to handle page fault in OS ?
A page fault occurs when a program attempts to access data or code that is in its address space, but is not currently located in the system RAM.

6. What’s the difference between SDLC and STLC ?

SDLC

STLC

SDLC is mainly related to software development. STLC is mainly related to software testing.
Besides development other phases like testing is also included. It focuses only on testing the software.
SDLC involves total six phases or steps. STLC involves only five phases or steps.
In SDLC, more number of members (developers) are required for the whole process. In STLC, less number of members (testers) are needed.

7. What are semaphores ?
Semaphores are just normal variables used to coordinate the activities of multiple processes in a computer system. They are used to enforce mutual exclusion, avoid race conditions, and implement synchronization between processes.

8. What are ACID propertise in DBMS ?
A transaction is a single logical unit of work that accesses and possibly modifies the contents of a database. Transactions access data using read-and-write operations.In order to maintain consistency in a database, before and after the transaction, certain properties are followed. These are called ACID properties.

9. What is Relational Algebra in the DBMS system?
The main purpose of using Relational Algebra is to define operators that transform one or more input relations into an output relation

10. What’s the difference between RDBMS and OODBMS ?

BASIS

RDBMS

OODBMS

Long Form

Stands for Relational Database Management System.

Stands for Object Oriented Database Management System.

Way of storing data

Stores data in Entities, defined as tables hold specific information.

Stores data as Objects.

Data Complexity

Handles comparatively simpler data.

Handles larger and complex data than RDBMS.

Grouping

Entity type refers to the collection of entity that share a common definition.

Class describes a group of objects that have common relationships, behaviors, and also have similar properties.

Data Handling

RDBMS stores only data.

Stores data as well as methods to use it.

Main Objective

Data Independence from application program.

Data Encapsulation.

11. What ‘s the difference between Function Overloading and Function Overriding in C++ ?

Function Overloading

Function Overriding

Function Overloading provides multiple definitions of the function by changing signature.

Function Overriding is the redefinition of base class function in its derived class with same signature.

An example of compile time polymorphism.

An example of run time polymorphism.

Function signatures should be different.

Function signatures should be the same.

Overloaded functions are in same scope.

Overridden functions are in different scopes.

12. What’s difference Between List and Tuple ?
 

LIST

TUPLE

Lists are mutable

Tuples are immutable

The implication of iterations is Time-consuming

The implication of iterations is comparatively Faster

The list is better for performing operations, such as insertion and deletion.

A Tuple data type is appropriate for accessing the elements

Lists consume more memory

Tuple consumes less memory as compared to the list

Lists have several built-in methods

Tuple does not have many built-in methods.

13. What are the various types of Storage Classes in C ?
C Storage Classes are used to describe the features of a variable/function. These features basically include the scope, visibility, and lifetime which help us to trace the existence of a particular variable during the runtime of a program.

14. What’s the difference between Mutex and Semaphore ?

Mutex

Semaphore

A mutex is an object. A semaphore is an integer.
Mutex works upon the locking mechanism. Semaphore uses signaling mechanism

Operations on mutex:

  • Lock
  • Unlock

Operation on semaphore:

  • Wait
  • Signal
Mutex doesn’t have any subtypes.

Semaphore is of two types:

  • Counting Semaphore
  • Binary Semaphore
A mutex can only be modified by the process that is requesting or releasing a resource. Semaphore work with two atomic operations (Wait, signal) which can modify it.

15.  What is Inheritance in C++ ? 
The capability of a class to derive properties and characteristics from another class is called Inheritance

Types Of Inheritance:-

  • Single inheritance
  • Multilevel inheritance
  • Multiple inheritance
  • Hierarchical inheritance
  • Hybrid inheritance

16. What’s the difference between Quick Sort and Merge Sort ?

Basis for comparison

Quick Sort

Merge Sort

The partition of elements in the array The splitting of a array of elements is in any ratio, not necessarily divided into half. In the merge sort, the array is parted into just 2 halves (i.e. n/2).
Worst case complexity O(n^2) O(nlogn)
Works well on It works well on smaller array It operates fine on any size of array
Speed of execution It work faster than other sorting algorithms for small data set like Selection sort etc It has a consistent speed on any size of data

17. What’s the difference between Dangling, Void , Null and Wild Pointers ?

  • Dangling pointer: A pointer pointing to a memory location that has been deleted (or freed) is called dangling pointer. There are three different ways where Pointer acts as dangling pointer
  • Void pointer: Void pointer is a specific pointer type – void * – a pointer that points to some data location in storage, which doesn’t have any specific type.
  • NULL Pointer: NULL Pointer is a pointer which is pointing to nothing. In case, if we don’t have address to be assigned to a pointer, then we can simply use NULL.
  • Wild pointer: A pointer that has not been initialized to anything (not even NULL) is known as wild pointer.

18. What’s the difference between Short-Term, Medium Term, and Long-Term Scheduler ?

Basis Short-Term Scheduler  Medium-term Scheduler Long-Term Scheduler
1. Alternate Name It is also called a CPU scheduler. It is also called a process swapping scheduler. It is also called a job scheduler.
2. Degree in programming It provides lesser control over the degree of multiprogramming. It reduces the control over the degree of multiprogramming. It controls the degree of multiprogramming.
3. Speed The speed of the short-term scheduler is very fast. Speed of medium scheduler between the short-term and long-term scheduler The speed of a long-term term scheduler is more than medium-term scheduler.
4. Usage in time- sharing system sharing system It is minimal in the time-sharing system. It is a part of the time-sharing system. It is almost absent or minimal in a sharing system.
5. Purpose It selects the processes from among the process that is ready to execute. It can reintroduce the from among the process into memory that executes and its execution can be continued.
 
It selects processes from the pool and loads them into memory for execution

19. What is Software Development Life Cycle?
The software development life cycle (SDLC) is a structured process that is used to design, develop, and test good-quality software. SDLC, or software development life cycle is a methodology that defines the entire procedure of software development step-by-step.

20. What is Variable Scope?
 Ans:  In programming also the scope of a variable is defined as the extent of the program code within which the variable can be accessed or declared or worked with. There are mainly two types of variable scopes: 

  • Local Variables: Variables defined within a function or block are said to be local to those functions.
  • Global Variables: As the name suggests, Global Variables can be accessed from any part of the program.

21. What is Marshalling in Distributed System ?
A Distributed system consists of numerous components located on different machines that communicate and coordinate operations to seem like a single system to the end-user.

22. What is an API ?
API is an abbreviation for Application Programming Interface which is a collection of communication protocols and subroutines used by various programs to communicate between them.

23. Difference between Queue and Deque (Queue vs. Deque)

ueue

Deque

A queue is a linear data structure that stores a collection of elements, with operations to enqueue (add) elements at the back of the queue, and dequeue (remove) elements from the front of the queue. A deque (double-ended queue) is a linear data structure that stores a collection of elements, with operations to add and remove elements from both ends of the deque.
Elements can only be inserted at the end of the data structure. Elements can be inserted from both ends of the data structure.
Elements can only be removed from the front of the data structure. Elements can be removed from both ends of the data structure.
Queues are a specialized data structure that uses the FIFO approach i.e., First In First Out. Deque can be used to implement the functionalities of both Stack (LIFO approach i.e., Last In First Out) and Queue (FIFO approach i.e., First In First Out).
A queue can be implemented using Array or Linked List. Deque can be implemented using Circular Array or Doubly Linked List.

24.What’s the difference between Primary and Secondary Memory ?

Primary memory

Secondary memory

Primary memory is temporary. Secondary memory is permanent.
Primary memory is directly accessible by Processor/CPU. Secondary memory is not directly accessible by the CPU.
Nature of Parts of Primary memory varies, RAM- volatile in nature. ROM- Non-volatile. It’s always Non-volatile in nature.
Primary memory devices are more expensive than secondary storage devices. Secondary memory devices are less expensive when compared to primary memory devices.
The memory devices used for primary memory are semiconductor memories. The secondary memory devices are magnetic and optical memories.

25. What is the purpose of ‘SUDO’ Command?
sudo (Super User DO) command in Linux is generally used as a prefix for some commands that only superusers are allowed to run. If you prefix any command with “sudo”, it will run that command with elevated privileges or in other words allow a user with proper permissions to execute a command as another user, such as the superuser.

26. What are the various types of sorting algorithm ?
Sorting refers to rearrangement of a given array or list of elements according to a comparison operator on the elements. The comparison operator is used to decide the new order of elements in the respective data structure.

27. Write a program to Reverse a Linked List ?

The idea is to use three pointers curr, prev, and next to keep track of nodes to update reverse links.

Follow the steps below to solve the problem:

  • Initialize three pointers prev as NULL, curr as head, and next as NULL.
  • Iterate through the linked list. In a loop, do the following:
    • Before changing the next of curr, store the next node 
      • next = curr -> next
    • Now update the next pointer of curr to the prev 
      • curr -> next = prev 
    • Update prev as curr and curr as next 
      • prev = curr 
      • curr = next

28. What is Kruskal’s Minimum Spanning Tree (MST) Algorithm ?
A minimum spanning tree (MST) or minimum weight spanning tree for a weighted, connected, undirected graph is a spanning tree with a weight less than or equal to the weight of every other spanning tree. To learn more about Minimum Spanning Tree, refer to this article.

29. Write a program for Best Time to Buy and Sell Stock ?
In order to maximize the profit, we have to minimize the cost price and maximize the selling price. So at every step, we will keep track of the minimum buy price of stock encountered so far. If the current price of stock is lower than the previous buy price, then we will update the buy price, else if the current price of stock is greater than the previous buy price then we can sell at this price to get some profit. After iterating over the entire array, return the maximum profit.

30. Write a program to find transpose of a matrix ?

  • Run a nested loop using two integer pointers i and j for 0 <= i < N and 0 <= j < M
  • Set B[i][j] equal to A[j][i]

31. What is LRU Cache?
Cache replacement algorithms are efficiently designed to replace the cache when the space is full. The Least Recently Used (LRU) is one of those algorithms. As the name suggests when the cache memory is full, LRU picks the data that is least recently used and removes it in order to make space for the new data. The priority of the data in the cache changes according to the need of that data i.e. if some data is fetched or updated recently then the priority of that data would be changed and assigned to the highest priority, and the priority of the data decreases if it remains unused operations after operations.

32. Write a program to Find the Maximum Depth or Height of given Binary Tree ?

  • Recursively do a Depth-first search.
  • If the tree is empty then return 0
  • Otherwise, do the following
    • Get the max depth of the left subtree recursively  i.e. call maxDepth( tree->left-subtree)
    • Get the max depth of the right subtree recursively  i.e. call maxDepth( tree->right-subtree)
    • Get the max of max depths of left and right subtrees and add 1 to it for the current node.
      • max_depth = max(max dept of left subtree,  max depth of right subtree) + 1
  • Return max_depth.

33. Write a program to print all the anagrams together ?
A simple method is to create a Hash Table. Calculate the hash value of each word in such a way that all anagrams have the same hash value. Populate the Hash Table with these hash values. Finally, print those words together with the same hash values. A simple hashing mechanism can be modulo sum of all characters. With modulo sum, two non-anagram words may have the same hash value. This can be handled by matching individual characters.

34. Sort a stack
The idea of the solution is to hold all values in Function Call Stack until the stack becomes empty. When the stack becomes empty, insert all held items one by one in sorted order. and then print the stack

35. Maximum Product Subarray
The idea is to traverse over every contiguous subarray, find the product of each of these subarrays and return the maximum product from these results.

To check the IBM Experiences and other asked question go through the attached link



Like Article
Suggest improvement
Previous
Next
Share your thoughts in the comments

Similar Reads