Filter interviews by
Clear (1)
Loop through numbers and print the even ones.
Use a loop to iterate through numbers
Check if each number is even using a modulo operation
Print the even numbers
For loop is used for iterating over a collection of items or executing a block of code a specific number of times.
For loop syntax: for(initialization; condition; increment/decrement) { // code to be executed }
Can be used with arrays to iterate over each element: for(int i=0; i
Can be used to repeat a block of code a specific number of times: for(int i=0; i<5; i++) { // code to b
Inheritance is a mechanism in object-oriented programming where a class inherits properties and behaviors from another class.
Allows a class to inherit properties and behaviors from another class
Promotes code reusability and reduces redundancy
Creates a parent-child relationship between classes
Derived class can access members of the base class
Example: Class B inherits from Class A, B can use methods and variables of A
A class is a blueprint for creating objects, while an object is an instance of a class.
A class defines the properties and behaviors of objects.
An object is a specific instance of a class.
Classes are used to create objects in object-oriented programming.
Objects can interact with each other by calling methods defined in their class.
Example: Class 'Car' defines properties like 'color' and 'model', while object 'myCar' is ...
Implement a program to find the second largest element in an array of integers.
Iterate through the array and keep track of the largest and second largest elements.
Handle edge cases like when the array has less than 2 elements.
Consider sorting the array and returning the second last element for a simpler solution.
Top trending discussions
I applied via Naukri.com and was interviewed in Jul 2020. There were 4 interview rounds.
I applied via Campus Placement and was interviewed before Jun 2020. There were 3 interview rounds.
I applied via Naukri.com and was interviewed before Oct 2019. There were 3 interview rounds.
I applied via LinkedIn and was interviewed before Dec 2020. There was 1 interview round.
C++ is an extension of C with object-oriented programming features.
C++ supports object-oriented programming while C does not.
C++ has classes and templates while C does not.
C++ has better support for function overloading and default arguments.
C++ has a standard library that includes many useful functions.
C++ allows for both procedural and object-oriented programming.
C++ is generally considered to be a more complex langu
I applied via Naukri.com and was interviewed before Dec 2020. There were 3 interview rounds.
I applied via Company Website and was interviewed before May 2020. There were 4 interview rounds.
based on 2 interviews
Interview experience
based on 4 reviews
Rating in categories
Software Developer
417
salaries
| ₹0 L/yr - ₹0 L/yr |
Software Engineer
151
salaries
| ₹0 L/yr - ₹0 L/yr |
QA Engineer
128
salaries
| ₹0 L/yr - ₹0 L/yr |
Senior Software Developer
54
salaries
| ₹0 L/yr - ₹0 L/yr |
Senior Software Engineer
38
salaries
| ₹0 L/yr - ₹0 L/yr |
TCS
Infosys
Wipro
HCLTech