- Complexity: OOP can lead to more complex code, especially for simple tasks, due to the need for creating multiple classes and objects.
- Performance Overhead: The use of objects and inheritance can introduce performance overhead, making OOP programs slower than procedural ones in some cases.
- Learning Curve: OOP concepts like inheritance, polymorphism, and encapsulation can be difficult for beginners to grasp.
- Inflexibility: Overemphasis on objects can make it harder to modify or extend existing code, especially in tightly coupled systems.
Q)What are the differences between C and C++? (Infosys technical interview pyqs for freshers)
Solution:
Here are some important differences between C and C++:
- Paradigm:
- C: Procedural programming language, focused on functions and procedures.
- C++: Multi-paradigm (supports both procedural and object-oriented programming), allowing for both structured and object-oriented programming.
- Data Encapsulation:
- C: Lacks built-in support for data encapsulation. Everything is exposed.
- C++: Supports data encapsulation using classes, allowing for data hiding and modular design.
- Inheritance:
- C: Does not support inheritance, as it is not an object-oriented language.
- C++: Supports inheritance, allowing classes to inherit properties and behaviors from other classes.
- Function Overloading:
- C: Does not support function overloading; each function must have a unique name.
- C++: Supports function overloading, allowing multiple functions with the same name but different parameters.
- Memory Management:
- C: Manual memory management using
malloc
and free
.
- C++: Provides both manual (
new
/delete
) and automatic memory management (constructors and destructors).
- Standard Library:
- C: Standard library is mainly focused on functions for handling basic tasks like I/O, string handling, and memory management.
- C++: Includes a richer standard library (STL) with features like containers, algorithms, and iterators.
- Reference Variables:
- C: Does not support reference variables; only pointers are used.
- C++: Supports reference variables, which are safer and easier to use than pointers for certain tasks.
Q)Define Real-Time OS? (Infosys technical interview pyqs for freshers)
Solution: A Real-Time Operating System (RTOS) is an operating system designed to process data and execute tasks within a strict time constraint or deadline. It is used in systems where timely and predictable responses to events are critical, such as in embedded systems, medical devices, and industrial automation.
Q)Differentiate between TCP and UDP. (Infosys technical interview pyqs for freshers)
Solution:
Here are the key differences between TCP and UDP:
- Connection:
- TCP (Transmission Control Protocol): Connection-oriented; establishes a connection before data transfer, ensuring reliable communication.
- UDP (User Datagram Protocol): Connectionless; sends data without establishing a connection, making it faster but less reliable.
- Reliability:
- TCP: Ensures data is delivered in the correct order and without errors, using error-checking, acknowledgments, and retransmission.
- UDP: Does not guarantee data delivery or order; packets may be lost or received out of order.
- Speed:
- TCP: Slower due to the overhead of connection management and error-checking.
- UDP: Faster because it has minimal overhead and does not ensure reliable delivery.
- Use Cases:
- TCP: Used for applications where reliability is crucial, such as web browsing, file transfers, and email.
- UDP: Used for applications where speed is more important than reliability, such as video streaming, online gaming, and VoIP.
- Overhead:
- TCP: Higher overhead due to connection setup, error correction, and flow control mechanisms.
- UDP: Lower overhead as it lacks these additional features.
Q)Explain virtual function and state the pure virtual function? (Infosys technical interview pyqs for freshers)
Solution:
- Virtual Function: A function in a base class that can be overridden by derived classes. It ensures that the correct function implementation is called based on the object’s runtime type, enabling polymorphism.
- Pure Virtual Function: A virtual function declared in a base class with
= 0
in its declaration, making the class abstract. This means the class cannot be instantiated, and derived classes must provide an implementation for this function.
Q)Differentiate between Inner join and Outer join? (Infosys technical interview pyqs for freshers)
Solution:
- Definition:
- Inner Join: Returns only the rows with matching values in both tables.
- Outer Join: Returns all rows from one or both tables, with matching rows where available; includes non-matching rows with NULLs.
- Result Set:
- Inner Join: Excludes rows with no match in either table.
- Outer Join: Includes unmatched rows from one or both tables (Left, Right, or Full Outer Join).
- Usage:
- Inner Join: Used when you need only the intersecting data between tables.
- Outer Join: Used when you need to include all rows from one or both tables, even if they don’t have matching entries.
Q)Make a comparison between array and pointer? (Infosys technical interview pyqs for freshers)
Solution:
Here are the key differences between an array and a pointer in C/C++:
- Definition:
- Array: A collection of elements of the same type, stored in contiguous memory locations, with a fixed size defined at compile-time.
- Pointer: A variable that stores the memory address of another variable, which can point to any data type.
- Size and Allocation:
- Array: The size is fixed upon declaration and cannot be changed. Memory for the array is allocated in a contiguous block.
- Pointer: The size of the pointer itself is fixed (e.g., 4 or 8 bytes), but the memory it points to can be dynamically allocated and resized using functions like
malloc
and realloc
.
- Usage:
- Array: Used to access elements using an index and provides a convenient way to work with a fixed-size collection of data.
- Pointer: Used for dynamic memory allocation, accessing elements indirectly, and passing large amounts of data to functions efficiently.
Q)How abstraction and encapsulation complementary? (Infosys technical interview pyqs for freshers)
Solution:
Abstraction and encapsulation are complementary in object-oriented programming:
- Abstraction: Hides the complex implementation details and exposes only the essential features of an object. It helps in defining what an object does.
- Encapsulation: Bundles data and methods that operate on the data into a single unit (class) and restricts direct access to some of the object’s components. It helps in defining how an object does it.
Q)Briefly describe the term platform independence? (Infosys technical interview pyqs for freshers)
Solution: Platform independence refers to the ability of software or code to run on different operating systems or hardware architectures without modification. It means that the same code can be executed on various platforms, making it versatile and reducing the need for platform-specific adjustments.
Q)State some key differences between Char and Varchar in DBMS? (Infosys technical interview pyqs for freshers)
Solution:
Here are the key differences between CHAR and VARCHAR in DBMS:
- Storage:
- CHAR: Fixed-length storage; if the data is shorter than the defined length, it is padded with spaces.
- VARCHAR: Variable-length storage; uses only as much space as needed for the data plus a small overhead for length information.
- Performance:
- CHAR: Generally faster for fixed-length data since the storage size is consistent and predictable.
- VARCHAR: May have a slight performance overhead due to variable length and additional space management.
- Use Cases:
- CHAR: Suitable for fields where data is of a consistent length, such as country codes or fixed-format identifiers.
- VARCHAR: Ideal for fields where data length can vary, such as names or descriptions, to save space.
Q)Define class and object in C++. (Infosys technical interview pyqs for freshers)
Solution:
- Class: A blueprint or template in C++ that defines the structure and behavior (data members and member functions) of objects. It serves as a user-defined data type.
- Object: An instance of a class. It represents a specific entity with its own set of data and behaviors defined by the class.
Q)State the various subsets of SQL? (Infosys technical interview pyqs for freshers)
Solution:
The main SQL subsets are:
- DDL (Data Definition Language): Defines and manages database structure (e.g.,
CREATE
, ALTER
, DROP
).
- DML (Data Manipulation Language): Handles data manipulation and retrieval (e.g.,
SELECT
, INSERT
, UPDATE
, DELETE
).
- DCL (Data Control Language): Manages permissions and access control (e.g.,
GRANT
, REVOKE
).
- TCL (Transaction Control Language): Manages transactions within the database (e.g.,
COMMIT
, ROLLBACK
, SAVEPOINT
).
Q)Briefly explain a node and network. (Infosys technical interview pyqs for freshers)
Solution:
Node: A node is any active device or point within a network that can send, receive, or route data. Examples include computers, servers, routers, switches, and printers. Each node typically has a unique address and plays a role in the network’s communication and data exchange.
Network: A network is a collection of interconnected devices or nodes that communicate with each other to share resources and information. It can range from a small local area network (LAN) to a vast global network like the Internet.
Q)State the various software testing techniques? (Infosys technical interview pyqs for freshers)
Solution:
Various software testing techniques include:
- Unit Testing: Tests individual components or functions in isolation to ensure they work as expected.
- Integration Testing: Tests the interaction between integrated components or systems to ensure they work together correctly.
- System Testing: Tests the complete and integrated software system to verify it meets the specified requirements.
- Acceptance Testing: Validates the software against user requirements and business needs, often performed by the end-users.
- Regression Testing: Ensures that new changes or additions have not adversely affected existing functionalities.
- Performance Testing: Assesses the software’s performance under various conditions, including load and stress testing.
- Security Testing: Identifies vulnerabilities and ensures that the software is secure against potential threats and attacks.
- Usability Testing: Evaluates the software’s user interface and user experience to ensure it is intuitive and user-friendly.
- Compatibility Testing: Checks if the software functions correctly across different environments, such as various operating systems or browsers.
- Smoke Testing: Performs preliminary testing to check if the basic functions of the software are working and if it’s stable enough for more detailed testing.
Q)Describe varieties of networks. (Infosys technical interview pyqs for freshers)
Solution:
Here are the main varieties of networks:
- LAN (Local Area Network): Connects devices within a small geographic area, like a home or office. It allows for high-speed data transfer and resource sharing.
- WAN (Wide Area Network): Covers a large geographic area, such as cities, countries, or even globally. It connects multiple LANs and is often used for internet connectivity.
- MAN (Metropolitan Area Network): Spans a city or large campus, larger than a LAN but smaller than a WAN. It is used for connecting networks across a metropolitan area.
- PAN (Personal Area Network): Connects devices over a very short range, typically within a few meters. It is used for personal devices like smartphones, tablets, and laptops.
- VPN (Virtual Private Network): Creates a secure, encrypted connection over a public network (like the internet) to connect remote users or sites securely to a private network.
- CAN (Campus Area Network): Connects multiple LANs within a campus or organization, such as a university or business campus, to facilitate internal communication and resource sharing.
Q)Differentiate between Class and Structure in C++. (Infosys technical interview pyqs for freshers)
Solution:
Here are the key differences between class and structure in C++:
- Default Access Control:
- Class: Members are private by default.
- Structure: Members are public by default.
- Inheritance:
- Class: Supports different types of inheritance (public, protected, private), and inheritance is private by default.
- Structure: Inheritance is public by default, but it supports the same types of inheritance as classes.
- Usage:
- Class: Typically used for more complex data structures with encapsulation, private data, and member functions.
- Structure: Traditionally used for simpler data structures where public access and data grouping are the primary concerns, though it can also have member functions and access control in modern C++.
Q)Differentiate between ‘Macro’ and ‘ordinary’ definition. (Infosys technical interview pyqs for freshers)
Solution:
Here are the key differences between macro and ordinary (or standard) definitions:
- Definition:
- Macro: Defined using preprocessor directives (e.g.,
#define
in C/C++), macros are replaced by their definitions before compilation. They are simple text substitutions.
- Ordinary Definition: Refers to standard definitions in code, such as functions or variables, which are processed during compilation.
- Scope:
- Macro: Has a global scope and is replaced everywhere in the code where it is used, potentially leading to unintended side effects.
- Ordinary Definition: Has scope determined by its declaration (e.g., within a function or class), and its visibility and behavior are controlled by the language’s rules.
- Type Checking:
- Macro: Lacks type checking, as they are just textual substitutions, which can lead to errors if not used carefully.
- Ordinary Definition: Involves type checking and follows the language’s type rules, providing more safety and robustness.
Thank You For visiting our website. In our website, you get more such educational content so don’t forget to allow the notification for more such content.
For more visit: https://deepblogs.net/category/educational-courses/