Filter interviews by
posted on 30 Aug 2016
I was interviewed in Jan 2016.
Delete nodes in linkedlist with greater value on right side
Traverse the linked list from right to left
Compare each node with the maximum value seen so far
If the current node has a greater value, delete it
Update the maximum value seen so far
Check if given tree is BST or not
A binary tree is a BST if the value of each node is greater than all the values in its left subtree and less than all the values in its right subtree
Perform an in-order traversal of the tree and check if the values are in ascending order
Alternatively, for each node, check if its value is within the range defined by its left and right subtrees
OOP is a programming paradigm that organizes code into objects with properties and behaviors.
OOP stands for Object-Oriented Programming.
It focuses on creating reusable code by organizing it into objects.
Objects have properties (attributes) and behaviors (methods).
Encapsulation, inheritance, and polymorphism are key principles of OOP.
Example: In Java, a class represents an object with its properties and methods.
Runtime polymorphism is when the method to be executed is determined at runtime, while compile-time polymorphism is determined at compile-time.
Runtime polymorphism is achieved through method overriding.
Compile-time polymorphism is achieved through method overloading.
Runtime polymorphism is also known as dynamic polymorphism.
Compile-time polymorphism is also known as static polymorphism.
Runtime polymorphism is associate...
Virtual functions are functions in a base class that can be overridden by derived classes to provide different implementations.
Virtual functions are declared in a base class and can be overridden in derived classes.
They allow polymorphism, where a pointer to a base class can invoke different derived class implementations.
Virtual functions are resolved at runtime based on the actual object type.
They are used to achieve
An abstract class is a class that cannot be instantiated and is meant to be subclassed.
An abstract class can have both abstract and non-abstract methods.
It can provide a common interface for its subclasses.
Subclasses of an abstract class must implement all the abstract methods.
Abstract classes can have constructors.
An abstract class cannot be instantiated directly, but its subclasses can be.
Inheritance is a mechanism 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, hierarchical inheritance, and hybrid inheritance.
Single inheritance involves a class inheriting from a single base class.
Multipl...
Print Fibonacci series less than or equal to 1000.
Start with two variables, a and b, initialized to 0 and 1 respectively.
Print a and update a to the value of b, and b to the sum of the previous a and b.
Repeat until a exceeds 1000.
The sum of even numbers in the Fibonacci series is calculated.
Generate the Fibonacci series up to a given limit
Iterate through the series and check if each number is even
If the number is even, add it to the sum
Return the sum of the even numbers
Stacks are a data structure that follows the Last-In-First-Out (LIFO) principle.
Stacks have two main operations: push (adds an element to the top) and pop (removes the top element).
Stacks can be implemented using arrays or linked lists.
Common applications of stacks include function call stack, undo/redo operations, and expression evaluation.
Example: A stack of books, where the last book placed is the first one to be re
Implement max() function to find the maximum element in a stack with optimized time and space complexity.
Use an additional stack to keep track of the maximum element at each step.
When pushing an element onto the stack, compare it with the top element of the maximum stack and push the larger one.
When popping an element from the stack, also pop the top element from the maximum stack if they are equal.
The top element of t...
Top trending discussions
Some of the top questions asked at the Carwale interview -
The duration of Carwale interview process can vary, but typically it takes about less than 2 weeks to complete.
based on 27 interviews
Interview experience
based on 158 reviews
Rating in categories
3-6 Yrs
Not Disclosed
4-5 Yrs
Not Disclosed
2-8 Yrs
Not Disclosed
Accounts Manager
134
salaries
| ₹0 L/yr - ₹0 L/yr |
Key Account Manager
91
salaries
| ₹0 L/yr - ₹0 L/yr |
Product Manager
28
salaries
| ₹0 L/yr - ₹0 L/yr |
Regional Manager
28
salaries
| ₹0 L/yr - ₹0 L/yr |
Software Developer
23
salaries
| ₹0 L/yr - ₹0 L/yr |
MagicBricks
Impact Guru
Netmeds.com
Tracxn