i
HCLTech
Filter interviews by
Mutex is used in multithreading to prevent multiple threads from accessing shared resources simultaneously.
Mutex stands for mutual exclusion and is used to synchronize access to shared resources in multithreaded programs.
It allows only one thread to access the shared resource at a time, preventing data corruption or race conditions.
Mutexes are typically used in critical sections of code where data integrity is imp...
STL libraries provide efficient and easy-to-use container classes like Vector for storing and manipulating data.
STL Vector is a dynamic array that can resize itself automatically.
It provides random access to elements, similar to arrays.
Vector supports various operations like push_back, pop_back, insert, erase, etc.
Example: std::vector<int> numbers = {1, 2, 3, 4, 5};
OOP is a programming paradigm based on the concept of objects, which can contain data and code to manipulate that data.
OOP focuses on creating objects that interact with each other to solve complex problems.
Encapsulation: Objects encapsulate data and behavior within a single unit.
Inheritance: Objects can inherit attributes and methods from other objects.
Polymorphism: Objects can take on different forms or have mul...
Vtable and Vptr are mechanisms in C++ for supporting dynamic polymorphism through virtual functions.
Vtable (Virtual Table) is a static table created by the compiler for each class with virtual functions.
Vptr (Virtual Pointer) is a pointer in each object instance that points to the Vtable of its class.
When a virtual function is called, the Vptr is used to look up the correct function in the Vtable.
Example: If class...
What people are saying about HCLTech
Runtime polymorphism allows objects of different classes to be treated as objects of a common superclass.
Use virtual functions in base class and override them in derived classes
Use pointers or references of base class to call derived class methods
Example: Animal class with virtual function 'makeSound', Dog and Cat classes overriding 'makeSound'
Use a loop to copy characters from one string to another
Create two character arrays to store the strings
Use a loop to iterate through each character of the source string and copy it to the destination string
Add a null terminator at the end of the destination string to mark the end of the copied string
Compile time polymorphism is achieved through function overloading and templates in C++.
Compile time polymorphism allows for different functions to be called based on the arguments provided at compile time.
Function overloading is a form of compile time polymorphism where multiple functions have the same name but different parameters.
Templates in C++ allow for generic programming and compile time polymorphism by cr...
Overload + operator to add two complex numbers in C++.
Define a class for complex numbers with real and imaginary parts.
Overload the + operator as a member function of the class.
Return a new complex number with the sum of real and imaginary parts.
To delete a node from a linked list, update the pointers of the previous node to skip the node to be deleted.
Traverse the linked list to find the node to be deleted
Update the pointers of the previous node to skip the node to be deleted
Free the memory allocated to the node to be deleted
A function pointer is a variable that stores the address of a function. Its signature includes the return type and parameter types of the function.
Function pointers allow for dynamic function calls based on the stored address
Syntax: return_type (*pointer_name)(parameter_types)
Example: void (*funcPtr)(int) = &someFunction;
I appeared for an interview in Dec 2024.
20 - MCQ test related C&C++ basic to advance
2 - coding questions -
1) create class which allows only one instance creation at a time if you try to create another before deleting existing object then class should throw exception..
2) find the distance between leftmost string and rightmost string(string's chars order doesn't matter) In a given long shuffled string.
Ex :-
Shuffled string = "xaxxcxbxxxcxxaxxbx"
target string= "abc"
Ans: 3
(Leftmost string is last index 6
Right most is 9 so 9-6=3)
Note:- other chars not necessarily 'x' it can be any
OOP is a programming paradigm based on the concept of objects, which can contain data and code to manipulate that data.
OOP focuses on creating objects that interact with each other to solve complex problems.
Encapsulation: Objects encapsulate data and behavior within a single unit.
Inheritance: Objects can inherit attributes and methods from other objects.
Polymorphism: Objects can take on different forms or have multiple...
Runtime polymorphism allows objects of different classes to be treated as objects of a common superclass.
Use virtual functions in base class and override them in derived classes
Use pointers or references of base class to call derived class methods
Example: Animal class with virtual function 'makeSound', Dog and Cat classes overriding 'makeSound'
Vtable and Vptr are mechanisms in C++ for supporting dynamic polymorphism through virtual functions.
Vtable (Virtual Table) is a static table created by the compiler for each class with virtual functions.
Vptr (Virtual Pointer) is a pointer in each object instance that points to the Vtable of its class.
When a virtual function is called, the Vptr is used to look up the correct function in the Vtable.
Example: If class A ha...
STL libraries provide efficient and easy-to-use container classes like Vector for storing and manipulating data.
STL Vector is a dynamic array that can resize itself automatically.
It provides random access to elements, similar to arrays.
Vector supports various operations like push_back, pop_back, insert, erase, etc.
Example: std::vector<int> numbers = {1, 2, 3, 4, 5};
Singleton class ensures only one instance of a class is created and provides a global point of access to it.
Ensures only one instance of a class is created
Provides a global point of access to the instance
Useful for managing global resources or settings
Mutex is used in multithreading to prevent multiple threads from accessing shared resources simultaneously.
Mutex stands for mutual exclusion and is used to synchronize access to shared resources in multithreaded programs.
It allows only one thread to access the shared resource at a time, preventing data corruption or race conditions.
Mutexes are typically used in critical sections of code where data integrity is importan...
I applied via Naukri.com and was interviewed in Sep 2024. There was 1 interview round.
Bit shift 1 by 4 positions from LSB results in 16
Use the left shift operator (<<) to shift the bits by 4 positions
1 << 4 = 16
Use a loop to copy characters from one string to another
Create two character arrays to store the strings
Use a loop to iterate through each character of the source string and copy it to the destination string
Add a null terminator at the end of the destination string to mark the end of the copied string
A function pointer is a variable that stores the address of a function. Its signature includes the return type and parameter types of the function.
Function pointers allow for dynamic function calls based on the stored address
Syntax: return_type (*pointer_name)(parameter_types)
Example: void (*funcPtr)(int) = &someFunction;
Polymorphism is the ability of a function to behave differently based on the object it is called with.
Polymorphism allows objects of different classes to be treated as objects of a common superclass.
There are two types of polymorphism: compile-time (function overloading) and runtime (virtual functions).
Example: A base class Animal with a virtual function 'makeSound'. Subclasses Dog and Cat override 'makeSound' to bark ...
Compile time polymorphism is achieved through function overloading and templates in C++.
Compile time polymorphism allows for different functions to be called based on the arguments provided at compile time.
Function overloading is a form of compile time polymorphism where multiple functions have the same name but different parameters.
Templates in C++ allow for generic programming and compile time polymorphism by creatin...
Default arguments in C++ allow functions to be called with fewer arguments than defined, enhancing flexibility.
Default arguments are specified in the function declaration, e.g., `void func(int x, int y = 10);`.
If a default argument is provided, it can be omitted when calling the function, e.g., `func(5);` uses `y = 10`.
Default arguments can be used for any data type, including user-defined types.
They must be specified ...
Overload + operator to add two complex numbers in C++.
Define a class for complex numbers with real and imaginary parts.
Overload the + operator as a member function of the class.
Return a new complex number with the sum of real and imaginary parts.
A template-based stack implementation in C++ that can handle any data type.
Use templates to define a generic Stack class: `template <typename T>`.
Implement basic stack operations: push, pop, and top.
Use a dynamic array (or linked list) to store stack elements.
Example: `Stack<int> intStack; intStack.push(5);`
Example: `Stack<std::string> stringStack; stringStack.push("Hello");`
To delete a node from a linked list, update the pointers of the previous node to skip the node to be deleted.
Traverse the linked list to find the node to be deleted
Update the pointers of the previous node to skip the node to be deleted
Free the memory allocated to the node to be deleted
I applied via Naukri.com and was interviewed in Jul 2021. There were 3 interview rounds.
Yes, I have worked on RFPs in my previous roles.
I have experience in responding to RFPs from clients.
I have worked on creating proposals and presentations for RFPs.
I have collaborated with cross-functional teams to gather information and create RFP responses.
I have also reviewed and evaluated RFPs from potential vendors.
For example, in my previous role at XYZ Company, I was responsible for leading the RFP response proc...
What people are saying about HCLTech
I applied via Company Website and was interviewed in Jul 2020. There were 3 interview rounds.
CI/CD pipeline is a process of continuous integration and continuous delivery/deployment of software.
CI/CD pipeline automates the software delivery process
It helps in detecting and fixing bugs early in the development cycle
It ensures that the software is always in a releasable state
It reduces the time between writing code and deploying it to production
Examples of CI/CD tools include Jenkins, Travis CI, and CircleCI
Jenkinsfile is a text file that defines the entire build process for a Jenkins pipeline.
Jenkinsfile is written in Groovy syntax
It can be stored in a version control system like Git
It allows for defining stages, steps, and conditions for a pipeline
Jenkinsfile can be executed on any Jenkins instance
Example: pipeline { agent { docker 'maven:3-alpine' } stages { stage('Build') { steps { sh 'mvn -B -DskipTests clean package...
To connect a machine in a private subnet, use a bastion host or VPN.
Set up a bastion host in the public subnet to act as a gateway.
Use SSH tunneling or RDP to connect to the bastion host.
From the bastion host, connect to the machine in the private subnet.
Alternatively, set up a VPN to securely connect to the private subnet.
Configure the security group and network ACLs to allow the necessary traffic.
Ansible playbooks can be verified/validated using various tools and techniques.
Use Ansible's built-in syntax checker 'ansible-playbook --syntax-check'
Use Ansible's 'ansible-lint' tool to check for best practices and potential issues
Use 'ansible-playbook --check' to simulate playbook execution without making changes
Use 'ansible-playbook --diff' to show the differences between the current and desired state
Use 'ansible-pl...
Inventory is a list of hosts where Ansible runs tasks. Roles are reusable collections of tasks, files, and templates. Variables are used to store data.
Inventory is a file or directory containing a list of hosts or groups of hosts
Roles are used to organize tasks, files, and templates into reusable collections
Variables are used to store data that can be used across multiple tasks and roles
Example: inventory file can cont...
Adding a user in Jenkins
Go to Jenkins dashboard and click on 'Manage Jenkins'
Click on 'Manage Users' and then 'Create User'
Fill in the user details and click 'Create User'
Assign the necessary permissions to the user
Maven is a build automation tool used for Java projects. Install is for local repository, deploy is for remote repository.
Maven is used to manage dependencies and build Java projects
Install command installs the project's artifact (jar, war, etc.) to the local repository
Deploy command uploads the artifact to a remote repository
Install is used during development, deploy is used for distribution
Example: 'mvn install' inst...
I applied via Recruitment Consultant and was interviewed before Oct 2020. There was 1 interview round.
I applied via Campus Placement and was interviewed before Oct 2021. There were 4 interview rounds.
If you were to consult an automobile firm to upgrade their in-vehicle, what changes would you suggest? Note that the firm primarily manufactures lowe end cars
Ice cream cart owner wants to increase profitability with an increase in the price of milk. How would you suggest that the owner maintain/ increase his profitability
I applied via LinkedIn and was interviewed in Mar 2021. There was 1 interview round.
I applied via Naukri.com and was interviewed before Aug 2021. There were 2 interview rounds.
Standard Coding questing
based on 2 interview experiences
Difficulty level
Duration
based on 1 review
Rating in categories
Software Engineer
24.9k
salaries
| ₹2.7 L/yr - ₹8.1 L/yr |
Technical Lead
22.9k
salaries
| ₹10.9 L/yr - ₹21 L/yr |
Senior Software Engineer
16.8k
salaries
| ₹5.4 L/yr - ₹15.8 L/yr |
Lead Engineer
16.4k
salaries
| ₹5.3 L/yr - ₹12.4 L/yr |
Analyst
15.9k
salaries
| ₹2.3 L/yr - ₹6.5 L/yr |
TCS
Wipro
Accenture
Cognizant