IBM
50+ Interview Questions and Answers
Given an array/list of integer numbers 'CHOCOLATES' of size 'N', where each value of the array/list represents the number of chocolates in the packet. There are ‘M’ number of students and the t...read more
Print the following pattern
Pattern for N = 4
The dots represent spaces.
Input Format :
N (Total no. of rows)
Output Format :
Pattern in N lines
Constraints :
0 <= N <= 50
If I leave you in a room along with 4 people of software engineers and I give you time to formulate any idea or a project, what will it be?
What projects you have worked on?
This question included a large problem including the basics and condition of a business problem in my case related to various taxes, and I had to form a solution to get the final output.There ...read more
Questions on Speed time and distance were asked the most
Logical questions
Verbal question were just passage based question and answers
In DBMS most questions were from normalization
OOPs Inheritance i...read more
Q6. Design a system for railway ticket booking
Design a system for railway ticket booking
Create a user-friendly interface for booking tickets
Integrate payment gateway for secure transactions
Implement seat availability and reservation system
Include features for cancellation and refund
Develop a database to store user and ticket information
Q7. In C# --> Abstraction, Interface , Abstract Method, Abstract Class, Polymorphisms, Encapsulation ,Inheritance, Serialization,
C# concepts including abstraction, interface, abstract method, abstract class, polymorphism, encapsulation, inheritance, and serialization.
Abstraction: hiding implementation details
Interface: defining a contract for behavior
Abstract method: method without implementation
Abstract class: class with one or more abstract methods
Polymorphism: ability of objects to take on multiple forms
Encapsulation: bundling data and behavior together
Inheritance: creating new classes from existing...read more
Match the orientations according to the rotation degrees suggested
Q9. 2.Difference between comparable and comparator 3. Diff between controller and rest controller 4. Controller advice annotation 5. Treemap and hashmap 6. Autowiring, dependency injection
Questions related to Java programming concepts
Comparable is an interface used for natural ordering of objects while Comparator is an interface used for custom ordering of objects
Controller is a class that handles incoming requests and returns a response while RestController is a specialized controller for RESTful web services
ControllerAdvice is an annotation used to define global exception handling for all controllers
HashMap is a collection that stores key-value pairs while T...read more
Q10. waterfall model in software development life cycle
Waterfall model is a linear sequential approach to software development.
It follows a sequential flow from requirements gathering to testing and maintenance.
Each phase must be completed before moving on to the next.
Changes are difficult to implement once a phase is completed.
Suitable for projects with well-defined requirements and stable technology.
Examples include building a bridge or a physical product.
Q11. Design a complete solution with Java Spring boot, Spring Data, DB Integration
Design a solution with Java Spring boot, Spring Data, DB Integration
Create a Spring Boot project with Spring Data dependency
Configure the database connection in application.properties
Create entity classes with JPA annotations
Create repository interfaces extending JpaRepository
Use repository methods in service classes
Expose REST endpoints using @RestController
Handle exceptions using @ControllerAdvice
Secure endpoints using Spring Security
Example: A blog application with user au...read more
Q12. What is the difference between c and java or python
C is a low-level language with manual memory management, while Java and Python are high-level languages with automatic memory management.
C is a low-level language, closer to the hardware, and requires manual memory management
Java and Python are high-level languages, with automatic memory management handled by the runtime environment
C is compiled directly to machine code, while Java and Python are typically compiled to bytecode and run on a virtual machine
Java is statically ty...read more
Q13. 4 pillars of object oriented programming wht are the
The 4 pillars of object-oriented programming are abstraction, encapsulation, inheritance, and polymorphism.
Abstraction: focusing on essential features and ignoring the rest
Encapsulation: hiding implementation details and exposing only necessary information
Inheritance: creating new classes from existing ones, inheriting their properties and methods
Polymorphism: using a single interface to represent different types of objects
Q14. What is Java,explain about oops concept of java
Java is a popular programming language used for developing various applications. It follows OOPs concepts.
Java is an object-oriented programming language.
It supports encapsulation, inheritance, and polymorphism.
Encapsulation is the process of hiding data and methods within a class.
Inheritance allows a class to inherit properties and methods from another class.
Polymorphism allows objects to take on multiple forms.
Java also supports abstraction, which is the process of hiding i...read more
Q15. Any questions?
Yes, I have a few questions regarding the company culture and team dynamics.
Can you tell me more about the team structure and how collaboration is encouraged?
What is the company's approach to professional development and growth?
How does the company prioritize work-life balance for its employees?
Q16. Is Python multi threaded or single threaded?
Python supports both single-threaded and multi-threaded programming.
Python has a Global Interpreter Lock (GIL) which allows only one thread to execute Python bytecode at a time.
However, Python supports multi-threading through the 'threading' module which allows for concurrent execution of multiple threads.
For CPU-bound tasks, multi-threading in Python may not provide performance benefits due to the GIL.
For I/O-bound tasks, multi-threading can be useful to improve performance ...read more
Q17. Arrays and linkedlist difference and how to use
Arrays store elements in contiguous memory, while linked lists store elements in nodes with pointers to the next element.
Arrays have constant time access to elements using index, while linked lists require traversal from the head to access elements.
Arrays have fixed size, while linked lists can dynamically grow and shrink.
Arrays are better for random access, while linked lists are better for insertion and deletion in the middle of the list.
Q18. Two Sum: given 2 numbers, check if there exists 2 numbers such that they sum to target
Given an array of numbers, check if there exists two numbers that sum to a target number.
Use a hash set to store the complement of each number as you iterate through the array.
For each number, check if its complement exists in the hash set.
If the complement exists, return true. Otherwise, add the number to the hash set.
If no two numbers sum to the target, return false.
Q19. Find the 2nd largest element of an array without sorting
Iterate through the array to find the 2nd largest element without sorting.
Iterate through the array and keep track of the largest and second largest elements.
Compare each element with the current largest and second largest elements to update them accordingly.
Handle edge cases like duplicates and empty arrays.
Q20. List comprehension and difference between overloading and overriding?
List comprehension is a concise way to create lists in Python. Overloading is having multiple methods with the same name but different parameters. Overriding is implementing a method in a subclass that is already defined in the superclass.
List comprehension is a concise way to create lists in Python, for example: squares = [x**2 for x in range(10)]
Overloading is having multiple methods with the same name but different parameters, for example: def add(a, b) and def add(a, b, c...read more
Q21. 1. Difference between inheritance and abstraction
Inheritance is a way to create a new class from an existing class while abstraction is a way to hide implementation details.
Inheritance allows a subclass to inherit properties and methods from a superclass.
Abstraction allows a class to provide only essential information to the outside world and hide implementation details.
Inheritance is a 'is-a' relationship while abstraction is a 'has-a' relationship.
Example of inheritance: class Dog extends Animal
Example of abstraction: int...read more
Q22. Extracting words from a line in java?
To extract words from a line in Java, split the line using whitespace as delimiter.
Use the split() method of String class
Pass the whitespace regex as argument to split() method
Iterate over the resulting array to get individual words
Q23. Difference between useCallback and useMemo hooks ?
useCallback is used to memoize functions, while useMemo is used to memoize values.
useCallback is used to memoize functions to prevent unnecessary re-renders.
useMemo is used to memoize the result of an expensive computation.
Both hooks help optimize performance by memoizing values.
Example: useCallback can be used to memoize event handler functions.
Example: useMemo can be used to memoize the result of a complex calculation.
Q24. What is CRM? WHAT WORK FLOW?
CRM stands for Customer Relationship Management. It is a software that helps businesses manage their interactions with customers.
CRM helps businesses organize customer data and interactions
It can track sales, marketing campaigns, and customer support
Examples of CRM software include Salesforce, HubSpot, and Zoho CRM
Q25. What is flatMap in Java 8
flatMap in Java 8 is a method used to transform and flatten streams of elements.
flatMap is used to transform each element of a stream into a new stream and then flatten the streams into a single stream.
It is commonly used with streams of collections to flatten the nested collections into a single stream.
Example: List
- > list = Arrays.asList(Arrays.asList(1, 2), Arrays.asList(3, 4)); list.stream().flatMap(Collection::stream).forEach(System.out::println);
Q26. What is the String class in java
String class in Java is a built-in class that represents a sequence of characters.
String class is part of java.lang package
It is immutable, meaning once a String object is created, it cannot be changed
String objects can be created using double quotes or the new keyword
String class provides many useful methods for manipulating strings such as length(), charAt(), substring(), etc.
Q27. Oops concepts in Java?
Oops concepts in Java
Encapsulation - hiding implementation details
Inheritance - reusing code and creating parent-child relationships
Polymorphism - multiple forms of a method or object
Abstraction - creating abstract classes and interfaces
Example: Encapsulation - using private variables and public methods
Example: Inheritance - creating a subclass that inherits from a superclass
Example: Polymorphism - using method overloading or overriding
Example: Abstraction - creating an inter...read more
Q28. Reversing a number in java?
Reversing a number in Java
Convert the number to a string
Use StringBuilder to reverse the string
Convert the reversed string back to a number
Q29. How many types of jobs
There are various types of jobs based on industry, function, and skillset.
Jobs can be categorized into industries such as healthcare, technology, finance, etc.
They can also be classified based on functions like software development, marketing, sales, etc.
Different skillsets like programming, design, management, etc., lead to different job types.
Examples: Software Developer, Marketing Manager, Nurse, Financial Analyst, Graphic Designer.
Q30. Altering columns in Databases?
Altering columns in databases involves modifying the structure of a table by adding, deleting or modifying columns.
Use ALTER TABLE statement to modify columns
Add new columns using ADD COLUMN
Delete columns using DROP COLUMN
Modify columns using MODIFY COLUMN
Changing column data type may result in data loss
Q31. Write the one of the project code.
A project code for a web application that tracks inventory and generates reports.
Use HTML, CSS, and JavaScript for front-end development
Utilize Node.js and Express for back-end development
Implement a database like MongoDB for data storage
Include features like user authentication and CRUD operations
Q32. What is Bean scope in spring
Bean scope in Spring determines the lifecycle and visibility of a bean within the Spring container.
Bean scope can be singleton, prototype, request, session, or application
Singleton scope creates a single instance of the bean per container
Prototype scope creates a new instance of the bean whenever requested
Request scope creates a new instance for each HTTP request
Session scope creates a new instance for each HTTP session
Application scope creates a single instance per ServletCo...read more
Q33. cant recollect right now
I'm sorry, I can't recall the question at the moment.
Q34. What is string in java
String is a sequence of characters in Java.
String is a class in Java.
Strings are immutable, meaning their values cannot be changed once created.
Strings can be created using double quotes or the String constructor.
String concatenation can be done using the '+' operator.
Strings have many built-in methods for manipulation and comparison.
Q35. What are joins in java
Joins in Java are used to combine data from two or more tables based on a related column between them.
Joins are used in database queries to retrieve data from multiple tables.
There are different types of joins like inner join, outer join, left join, and right join.
Joins are performed using the JOIN keyword in SQL queries.
Joins help in retrieving related data and creating meaningful results from multiple tables.
Q36. What is Oops concepts
Oops concepts refer to Object-Oriented Programming concepts which include inheritance, polymorphism, encapsulation, and abstraction.
Inheritance: Allows a class to inherit properties and behavior from another class.
Polymorphism: Allows objects to be treated as instances of their parent class.
Encapsulation: Bundling data and methods that operate on the data into a single unit.
Abstraction: Hides the complex implementation details and only shows the necessary features of an objec...read more
Q37. method overloading vs method overriding
Method overloading is having multiple methods in the same class with the same name but different parameters, while method overriding is redefining a method in a subclass with the same name and parameters as in the superclass.
Method overloading allows a class to have multiple methods with the same name but different parameters.
Method overriding involves redefining a method in a subclass that has the same name and parameters as a method in the superclass.
Method overloading is r...read more
Q38. Rotate the array by one place
Rotate the array by one place
Create a new array with the same length as the original array
Copy elements from the original array starting from index 1 to the new array
Copy the first element of the original array to the last index of the new array
Q39. What is JCL cobol
JCL (Job Control Language) is used to instruct the mainframe operating system on how to run batch jobs, while COBOL is a programming language commonly used for business applications on mainframes.
JCL is used to define and control jobs on mainframe systems
COBOL is a programming language commonly used for business applications on mainframes
JCL is often used to call COBOL programs as part of batch processing
Q40. What is rest api
REST API is a set of rules and conventions for building and interacting with web services using HTTP methods.
REST stands for Representational State Transfer
Uses standard HTTP methods like GET, POST, PUT, DELETE
Data is transferred in JSON or XML format
Stateless communication between client and server
Example: GET request to retrieve data from a server
Q41. What is soap api
SOAP API is a protocol for exchanging structured information in the implementation of web services.
SOAP stands for Simple Object Access Protocol
It uses XML for message format
It relies on HTTP or SMTP for message transmission
It is a widely used protocol for web services communication
Q42. high level system design
High level system design involves creating an overall architecture for a software system.
Identify the main components of the system
Define the interactions between components
Consider scalability, performance, and security
Use diagrams like UML to visualize the design
Q43. explain oops concepts
OOPs concepts are fundamental principles in object-oriented programming that help in organizing and designing code efficiently.
Encapsulation: Bundling data and methods that operate on the data into a single unit (class).
Inheritance: Ability of a class to inherit properties and behavior from another class.
Polymorphism: Ability to present the same interface for different data types.
Abstraction: Hiding the complex implementation details and showing only the necessary features to...read more
Q44. Define scope in python
Scope in Python refers to the visibility of variables within a program.
Scope determines where in a program a variable is accessible.
There are four types of scope in Python: local, enclosing, global, and built-in.
Variables defined inside a function have local scope and are only accessible within that function.
Global variables are accessible throughout the entire program.
Enclosing scope refers to variables defined in the outer function of a nested function.
Built-in scope includ...read more
Q45. Define namespace in python
Namespace in Python is a way to organize and group related code together.
Namespaces help avoid naming conflicts by providing a unique space for each identifier
Python uses dictionaries to implement namespaces
There are two types of namespaces in Python: local namespace and global namespace
Q46. Move zeros to the end
Move all zeros in an array of strings to the end while maintaining the order of non-zero elements.
Iterate through the array and move all zeros to the end by swapping with non-zero elements.
Maintain two pointers, one for iterating through the array and another for placing non-zero elements.
Example: Input: ['a', 'b', 'c', '0', 'd', '0'], Output: ['a', 'b', 'c', 'd', '0', '0']
Q47. Cond parameter in jcl
COND parameter in JCL is used to specify conditions for executing a job step based on the return code of a previous step.
COND parameter can be used to specify conditions like 'ONLY', 'EVEN', 'ONLY IF', etc.
Example: COND=(0,NE) means the step will only execute if the return code of the previous step is not 0.
Q48. Database acid properties
ACID properties ensure database transactions are processed reliably.
Atomicity: All operations in a transaction are completed successfully or none at all.
Consistency: Database remains in a consistent state before and after a transaction.
Isolation: Transactions are isolated from each other until they are completed.
Durability: Once a transaction is committed, changes are permanent and cannot be lost.
Example: If a bank transfer transaction fails, the amount should not be deducted...read more
Q49. Write a code in C++
Code in C++ to print 'Hello, World!'
Use the 'cout' function from the 'iostream' library to print the message
Include the 'iostream' header file at the beginning of the code
Use the 'namespace std;' declaration to avoid writing 'std::' before 'cout'
Q50. Write a code in Java
Code in Java to sort an array of strings alphabetically
Use Arrays.sort() method to sort the array of strings
Implement a custom Comparator if needed for custom sorting criteria
Handle null or empty strings appropriately
Q51. multithread example
Multithreading allows multiple threads to run concurrently, improving performance and responsiveness.
Multithreading is used to execute multiple tasks simultaneously.
Threads share the same memory space, allowing for efficient communication and data sharing.
Example: A web server handling multiple client requests concurrently using separate threads.
More about working at IBM
Top HR Questions asked in null
Interview Process at null
Top Software Developer Interview Questions from Similar Companies
Reviews
Interviews
Salaries
Users/Month