i
HCLTech
Filter interviews by
Clear (1)
I was interviewed 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'
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...
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
I applied via Naukri.com and was interviewed in Jul 2021. There were 3 interview rounds.
What people are saying about HCLTech
Reverse the order of strings in an array
Iterate through the array and swap the elements from start to end
Use two pointers, one at the beginning and one at the end, to swap elements
Example: Input array ['apple', 'banana', 'cherry'] becomes ['cherry', 'banana', 'apple'] after reversing
The design pattern used in my project is the Observer pattern.
Implemented to establish a one-to-many dependency between objects.
Allows multiple objects to listen and react to changes in a subject.
Promotes loose coupling between objects.
Example: Used to notify multiple UI components when a data model changes.
I applied via Naukri.com and was interviewed in Jul 2022. There was 1 interview round.
I applied via Naukri.com and was interviewed in Oct 2022. There were 3 interview rounds.
Java is a popular programming language used for developing various applications. A variable is a named memory location used to store data.
Java is an object-oriented language
It is platform-independent
Variables in Java have a specific data type
Variables can be assigned values and their values can be changed
Example: int age = 25; String name = "John";
Inheritance is a concept in object-oriented programming where a class inherits properties and behaviors from another class.
Inheritance allows code reuse and promotes code organization.
There are different types of inheritance: single inheritance, multiple inheritance, multilevel inheritance, and hierarchical inheritance.
Single inheritance involves a class inheriting from a single base class.
Multiple inheritance involves...
Inheritance is acquiring properties of parent class to child class without changing parent class properties. It is classified into 5 types.
Inheritance is a way to reuse code and establish a relationship between classes
The 'extends' keyword is used to implement inheritance in Java
Examples of inheritance include a 'Car' class inheriting properties from a 'Vehicle' class
Single level inheritance involves one parent class a...
May I about you ? Which your qualification and which stream
I applied via Naukri.com and was interviewed in Feb 2022. There were 2 interview rounds.
React virtual DOM is a lightweight copy of the actual DOM, which allows React to efficiently update and render components.
React creates a virtual DOM tree that mirrors the actual DOM.
When changes occur, React compares the virtual DOM with the previous version to identify the minimal updates needed.
React then updates the virtual DOM and efficiently applies the changes to the actual DOM.
This process helps in optimizing p...
Redux is a predictable state container for JavaScript apps. Flow is a static type checker for JavaScript.
Redux is a state management library for JavaScript applications.
It helps in managing the state of an application in a predictable way.
It follows a unidirectional data flow pattern.
Flow is a static type checker for JavaScript that helps in catching errors before runtime.
It helps in improving the quality of code and r
Unit testing is a software testing technique where individual units or components of a software application are tested in isolation from the rest of the application.
Unit testing is done to ensure that each unit of the software application is working as expected.
It helps in identifying and fixing bugs early in the development cycle.
Unit tests are automated and can be run frequently to ensure that changes made to the cod...
Routing in React is the process of navigating between different components or pages based on the URL.
React Router is a popular library for handling routing in React
It allows for declarative routing with components and URLs
Routes can be defined with parameters and nested routes
Navigation can be done with Link and NavLink components
Programmatic navigation can be done with the useHistory hook
5 questions ( 3 coding ).. and 2 objective MCQ
I applied via Job boards and was interviewed in Sep 2021. There were 4 interview rounds.
Use a physical medium like a USB drive or a portable storage device to transfer the file.
Physically carry the file on a USB drive or portable storage device.
Use a local network connection to transfer the file between the two floors.
Utilize Bluetooth or other wireless technologies to transfer the file.
If the distance is short, use a physical method like printing the file and physically handing it over.
JVM stands for Java Virtual Machine. It is an abstract machine that enables a computer to run Java programs.
JVM is responsible for interpreting the compiled Java code and executing it on the computer.
It provides a platform-independent environment for Java programs to run on different operating systems.
JVM has various components like Class Loader, Bytecode Verifier, Just-In-Time Compiler, and Garbage Collector.
Examples ...
JDK memories are areas of memory used by Java programs to store data and code.
JDK memories include heap memory, stack memory, and non-heap memory.
Heap memory is used to store objects and is managed by the garbage collector.
Stack memory is used to store method calls and local variables.
Non-heap memory is used to store class definitions and other data.
Examples of non-heap memory include the method area and the permanent ...
I applied via Company Website and was interviewed in Apr 2022. There were 2 interview rounds.
Exam test
based on 2 interviews
Interview experience
based on 1 review
Rating in categories
Software Engineer
23k
salaries
| ₹1.7 L/yr - ₹8 L/yr |
Technical Lead
21.2k
salaries
| ₹7 L/yr - ₹28 L/yr |
Senior Software Engineer
15.8k
salaries
| ₹4 L/yr - ₹16.5 L/yr |
Lead Engineer
14.9k
salaries
| ₹4.2 L/yr - ₹14 L/yr |
Analyst
14.4k
salaries
| ₹0.8 L/yr - ₹6.5 L/yr |
TCS
Wipro
Accenture
Cognizant