LTIMindtree
30+ Pfizer Interview Questions and Answers
Q1. What are some real-life examples that illustrate the concepts of Object-Oriented Programming (OOP)?
Real-life examples of Object-Oriented Programming include modeling a car as an object with properties and methods.
Modeling a car as an object with properties like color, make, model, and methods like start, stop, accelerate
Creating a banking system where accounts are objects with properties like balance and methods like deposit, withdraw
Developing a video game where characters are objects with properties like health, position and methods like move, attack
Q2. What is the Difference between C & C++?
C is a procedural programming language while C++ is a multi-paradigm programming language with object-oriented features.
C is a procedural programming language while C++ supports both procedural and object-oriented programming.
C does not have classes and objects like C++.
C++ has features like inheritance, polymorphism, and encapsulation which are not present in C.
C++ allows function overloading and operator overloading which are not supported in C.
C++ has a richer standard lib...read more
Q3. What is the code to calculate the factorial of a number?
Factorial of a number is calculated by multiplying all positive integers up to that number.
Use a loop to multiply all positive integers up to the given number.
Handle edge cases like 0 and negative numbers separately.
Example: For input 5, factorial = 5*4*3*2*1 = 120.
Q4. What is the code to generate the first 12 prime numbers?
The code to generate the first 12 prime numbers involves checking divisibility by numbers up to the square root of the number.
Start with a list of prime numbers and a counter for the number of primes found.
Loop through numbers starting from 2 and check if they are prime by dividing them by all previous prime numbers.
If a number is not divisible by any previous prime numbers, add it to the list of primes.
Continue this process until you have found 12 prime numbers.
Q5. What are the key concepts of Object-Oriented Programming (OOP)?
Key concepts of OOP include encapsulation, inheritance, polymorphism, and abstraction.
Encapsulation: Bundling data and methods that operate on the data into a single unit (class).
Inheritance: Allows a class to inherit properties and behavior from another class.
Polymorphism: Ability for objects to be treated as instances of their parent class or their own class.
Abstraction: Hiding complex implementation details and showing only the necessary features to the outside world.
Q6. What is the difference between type casting and type conversion
Type casting is changing the data type of a variable, while type conversion is converting a value from one data type to another.
Type casting is done explicitly by the programmer, while type conversion can be done implicitly by the compiler.
Type casting can lead to loss of data if the new data type cannot hold the original value, while type conversion may involve data loss depending on the conversion.
Example of type casting: int x = (int) 3.14;
Example of type conversion: int y...read more
Q7. What is the thread lifecycle in programming?
Thread lifecycle in programming refers to the various stages a thread goes through from creation to termination.
Thread creation: A new thread is created using the 'Thread' class or by implementing the 'Runnable' interface.
Thread start: The thread transitions from 'new' to 'runnable' state when 'start()' method is called.
Thread running: The thread is executing its task in the 'running' state.
Thread waiting: The thread can enter the 'waiting' state due to various reasons like w...read more
Q8. What is the purpose of collections in Java?
Collections in Java are used to store and manipulate groups of objects.
Collections provide a way to store, retrieve, and manipulate groups of objects in Java.
They offer various data structures like lists, sets, maps, etc. for different purposes.
Collections framework includes interfaces like List, Set, Map, and classes like ArrayList, HashSet, HashMap.
Collections provide methods for sorting, searching, and iterating over elements efficiently.
Q9. What function used to change string to int
The function used to change a string to an integer is parseInt() in JavaScript.
parseInt() function is used to convert a string to an integer in JavaScript.
It takes in the string as an argument and returns the integer value.
Example: parseInt('10') will return 10.
Q10. basic sql query to find the maximum salary of an employee from a table
Use SQL query with MAX() function to find the maximum salary of an employee from a table.
Use SELECT MAX(salary) FROM employees;
Make sure to replace 'employees' with the actual table name where employee salaries are stored.
Q11. Explain about all types of join with real life examples
Different types of joins in databases with real life examples
Inner Join: Returns rows when there is a match in both tables. Example: Matching students with their courses.
Left Join: Returns all rows from the left table and the matched rows from the right table. Example: All employees and their assigned projects.
Right Join: Returns all rows from the right table and the matched rows from the left table. Example: All products and their sales data.
Full Outer Join: Returns rows whe...read more
Q12. What do you know about LTIMindtree?
LTIMindtree is a global technology consulting and services company specializing in digital transformation and IT services.
LTIMindtree was founded in 1999 and is headquartered in Bangalore, India.
It offers services in areas such as application development, data analytics, cloud computing, and digital transformation.
LTIMindtree has a strong focus on innovation and has partnerships with leading technology companies.
The company has a global presence with offices in multiple count...read more
Q13. Does C program run without main function
No, a C program cannot run without a main function.
The main function is the entry point of a C program, without it the program cannot be executed.
The main function is mandatory in C programming as it tells the compiler where to start the execution of the program.
Attempting to compile a C program without a main function will result in a compilation error.
Q14. What is the use of lamba function?
Lambda functions are anonymous functions in programming that can be used for short, one-time tasks.
Lambda functions are used for writing short, concise code without the need to define a separate function.
They are commonly used in functional programming languages like Python, JavaScript, and Ruby.
Lambda functions can be passed as arguments to higher-order functions.
They are useful for tasks like sorting, filtering, and mapping data in a more compact way.
Example: In Python, a l...read more
Q15. What is your knowledge of Java?
Proficient in Java with experience in object-oriented programming, data structures, and algorithms.
Strong understanding of Java syntax and concepts such as classes, objects, inheritance, polymorphism, and interfaces.
Experience in developing applications using Java frameworks like Spring and Hibernate.
Knowledge of data structures and algorithms in Java for efficient problem-solving.
Familiarity with Java libraries and tools for development and testing, such as JUnit and Maven.
Q16. What is html and write syntaxes
HTML is a markup language used for creating web pages.
HTML stands for HyperText Markup Language
HTML uses tags to structure content on a web page
Example: <h1>This is a heading</h1>
Example: <p>This is a paragraph</p>
Q17. What are the types of Exceptions
Types of Exceptions include checked, unchecked, and errors.
Checked Exceptions: Must be either caught or declared in the method signature. Example: IOException
Unchecked Exceptions: Not required to be caught or declared. Example: NullPointerException
Errors: Irrecoverable issues that should not be caught or handled. Example: OutOfMemoryError
Q18. write a code for matrix multiplication?
Matrix multiplication code implementation in C++
Declare two matrices A and B of appropriate sizes
Iterate through rows and columns to calculate each element of the resulting matrix C
Use nested loops for efficient computation
Ensure the number of columns in matrix A is equal to the number of rows in matrix B
Example: A = {{1, 2}, {3, 4}}, B = {{5, 6}, {7, 8}}, C = A*B = {{19, 22}, {43, 50}}
Q19. Mention few object oriented programming languages
Some object oriented programming languages include Java, C++, Python, and C#.
Java
C++
Python
C#
Q20. What is Agile methodology?
Agile methodology is a project management approach that emphasizes flexibility, collaboration, and iterative development.
Agile methodology involves breaking down projects into smaller tasks and completing them in short iterations.
It prioritizes customer feedback and collaboration among team members.
Common Agile frameworks include Scrum, Kanban, and Extreme Programming (XP).
Q21. what is dbms and its uses
DBMS stands for Database Management System. It is a software that manages databases and allows users to interact with data.
DBMS helps in storing, retrieving, and managing data efficiently.
It provides data security by allowing access control and data encryption.
DBMS ensures data integrity by enforcing constraints and maintaining consistency.
Examples of DBMS include MySQL, Oracle, SQL Server, and PostgreSQL.
Q22. explain method overloading and overriding
Method overloading is having multiple methods in the same class with the same name but different parameters. Method overriding is redefining a method in a subclass with the same signature as in the superclass.
Method overloading allows multiple methods with the same name but different parameters in the same class.
Method overriding involves redefining a method in a subclass with the same signature as in the superclass.
Example of method overloading: void print(int num) and void ...read more
Q23. Tell me abt ltimindtree
Mindtree is a global technology consulting and services company, specializing in IT services and digital transformation.
Founded in 1999 in Bangalore, India
Provides services in application development, maintenance, infrastructure management, and testing
Acquired by L&T (Larsen & Toubro) in 2019
Has offices in multiple countries including the USA, UK, and India
Q24. Time and space complexity of merge sort.
Merge sort has a time complexity of O(n log n) and a space complexity of O(n).
Time complexity of merge sort is O(n log n) where n is the number of elements in the array.
Space complexity of merge sort is O(n) as it requires additional space to store the temporary arrays during the merging process.
Merge sort is a divide and conquer algorithm that recursively divides the array into halves until each subarray contains only one element, then merges them in sorted order.
Q25. sdlc model,what is agile
Agile is a software development methodology that emphasizes flexibility, collaboration, and iterative development.
Agile focuses on delivering working software in short iterations
It values customer collaboration and responding to change over following a strict plan
Agile teams work closely together and adapt to changing requirements
Popular Agile frameworks include Scrum, Kanban, and Extreme Programming (XP)
Q26. What is dsa, explain knapsack
DSA stands for Data Structures and Algorithms. Knapsack is a problem in combinatorial optimization.
DSA is a field of study that involves the design and analysis of data structures and algorithms.
Knapsack problem involves maximizing the value of items in a knapsack without exceeding its capacity.
There are two types of knapsack problems: 0/1 knapsack (where items cannot be broken) and fractional knapsack (where items can be broken).
Q27. What is cross site scripting
Cross site scripting (XSS) is a type of security vulnerability typically found in web applications where malicious scripts are injected into trusted websites.
XSS allows attackers to execute scripts in the victim's browser, potentially stealing sensitive information or altering the website's content.
There are three main types of XSS: stored XSS, reflected XSS, and DOM-based XSS.
Preventing XSS involves input validation, output encoding, and implementing Content Security Policy ...read more
Q28. Flexible to move from locations
Yes, I am flexible to move to different locations for work opportunities.
I have no ties or commitments that would prevent me from relocating
I am open to experiencing new places and cultures
I understand the importance of being adaptable in the engineering field
Q29. Reason for choosing LTIMindtree
Chose LTIMindtree for its reputation, innovative projects, and opportunities for growth.
Reputation: LTIMindtree is known for its strong reputation in the industry.
Innovative projects: I was attracted to the company's focus on cutting-edge technologies and projects.
Opportunities for growth: LTIMindtree offers ample opportunities for career development and advancement.
Work culture: The company's work culture and values align with my own professional goals.
Q30. talk about ur parents for 2min
My parents are hardworking and supportive individuals who have always encouraged me to pursue my goals.
My parents have always prioritized education and have instilled in me the value of hard work and perseverance.
They have supported me in all my endeavors, whether it be academics, extracurricular activities, or personal interests.
My parents have been a constant source of guidance and inspiration for me, always pushing me to strive for excellence.
I am grateful for the love and...read more
Q31. Lifecycle components of threads
Lifecycle components of threads include creation, scheduling, execution, and termination.
Creation: Threads are created using the 'Thread' class in Java or 'pthread_create' function in C.
Scheduling: Threads are scheduled by the operating system based on priority and other factors.
Execution: Threads execute the code specified in their run method or function.
Termination: Threads can terminate either by completing their task or by being explicitly stopped.
Q32. What is inheritance
Inheritance is a concept in object-oriented programming where a class can inherit attributes and methods from another class.
Allows for code reusability and promotes the concept of hierarchy
Derived class inherits properties and behaviors from a base class
Types of inheritance include single, multiple, multilevel, and hierarchical
Example: Class 'Car' can inherit from class 'Vehicle' to access common attributes like 'color' and methods like 'drive()'
Q33. What is MITM
MITM stands for Man-in-the-Middle attack, where a third party intercepts communication between two parties without their knowledge.
MITM attack involves a hacker intercepting communication between two parties to steal information or manipulate data.
Common examples include eavesdropping on Wi-Fi networks or intercepting emails.
To prevent MITM attacks, encryption and secure communication protocols like HTTPS are used.
Q34. Types of Joins
Types of joins in SQL are inner join, left join, right join, and full outer join.
Inner join: Returns rows when there is a match in both tables.
Left join: Returns all rows from the left table and the matched rows from the right table.
Right join: Returns all rows from the right table and the matched rows from the left table.
Full outer join: Returns rows when there is a match in either table.
Q35. TCP/IP vs UDP
TCP/IP is a connection-oriented protocol that ensures data delivery, while UDP is a connectionless protocol that prioritizes speed.
TCP/IP is reliable as it guarantees delivery of data packets in the correct order.
UDP is faster as it does not require a connection setup before transmitting data.
TCP/IP is used for applications that require high reliability, such as web browsing and email.
UDP is used for real-time applications like online gaming and video streaming.
TCP/IP include...read more
Q36. types of testing
Types of testing include unit testing, integration testing, system testing, and acceptance testing.
Unit testing focuses on testing individual components or modules of a system.
Integration testing involves testing how different components work together.
System testing tests the entire system as a whole.
Acceptance testing is done to ensure the system meets the requirements of the end users.
Q37. room for relocation
I am open to relocation for the right opportunity.
I am willing to relocate for the job if necessary.
I am flexible and open to new experiences in different locations.
I have relocated in the past for internships or other opportunities.
I understand the importance of being geographically mobile in the engineering field.
Q38. Explain OOPS
OOPS stands for Object-Oriented Programming System. It is a programming paradigm based on the concept of objects.
OOPS is based on the four main principles: Encapsulation, Inheritance, Polymorphism, and Abstraction.
Encapsulation is the process of hiding the implementation details of an object from the outside world.
Inheritance allows a class to inherit properties and methods from another class.
Polymorphism allows objects to take on multiple forms or behaviors.
Abstraction is th...read more
Q39. Write merge sort
Merge sort is a divide and conquer algorithm that recursively splits an array into halves, sorts them, and then merges them back together.
Divide the array into two halves
Recursively sort each half
Merge the sorted halves back together
More about working at LTIMindtree
Top HR Questions asked in Pfizer
Interview Process at Pfizer
Top Graduate Engineer Interview Questions from Similar Companies
Reviews
Interviews
Salaries
Users/Month