Filter interviews by
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
Adhoc string questions often test manipulation, searching, or pattern recognition skills in programming.
String reversal: Reverse a string using slicing. Example: 'hello' -> 'olleh'.
Palindrome check: Determine if a string reads the same forwards and backwards. Example: 'racecar' is a palindrome.
Substring search: Find if one string is a substring of another. Example: 'cat' in 'concatenation' returns True.
Characte...
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
Explore unconventional methods to achieve sub-linear time complexity for the given problem.
Use hashing to store previously computed results, allowing O(1) lookups.
Implement a divide-and-conquer strategy to reduce problem size recursively.
Consider using a probabilistic approach, like Bloom filters, for approximate results.
Utilize parallel processing to handle multiple data segments simultaneously.
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 ...
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
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 asso...
OOP (Object-Oriented Programming) is a programming paradigm based on objects and classes, promoting code reusability and modularity.
Encapsulation: Bundling data and methods that operate on the data within one unit (e.g., a class).
Inheritance: Mechanism to create a new class using properties and methods of an existing class (e.g., a 'Dog' class inheriting from an 'Animal' class).
Polymorphism: Ability to present the...
Virtual functions enable dynamic polymorphism in C++, allowing derived classes to override base class methods at runtime.
Virtual functions are declared using the 'virtual' keyword in the base class.
They allow derived classes to provide specific implementations of a method.
When a base class pointer/reference points to a derived class object, the derived class's overridden method is called.
Example: If 'Animal' has a...
An abstract class is a blueprint for other classes, allowing for incomplete implementations and enforcing method definitions.
An abstract class cannot be instantiated directly.
It can contain abstract methods (without implementation) and concrete methods (with implementation).
Example: In a shape hierarchy, 'Shape' can be an abstract class with an abstract method 'draw()'.
Subclasses like 'Circle' and 'Square' must im...
posted on 14 Oct 2015
Prims and Kruskal's algorithms are used to find the minimum spanning tree in a graph.
Prims algorithm starts with a single vertex and adds the minimum weight edge to the tree until all vertices are included.
Kruskal's algorithm starts with all vertices as separate trees and merges them by adding the minimum weight edge until all vertices are included.
Both algorithms have a time complexity of O(E log V) where E is the num...
Delete nodes in a linked list which have greater value on right side
Traverse the linked list and compare each node with its right side node
If the current node's value is less than its right side node, delete the current node
Repeat the process until the end of the linked list is reached
Methods are functions that perform a specific task, while constructors are special methods that initialize objects.
Constructors have the same name as the class they belong to.
Constructors are called automatically when an object is created.
Constructors can be overloaded with different parameters.
Methods can be called multiple times with different arguments.
Methods can have a return type, while constructors do not.
posted on 30 Sep 2015
Find all permutations of a given string.
Use recursion to swap each character with every other character in the string.
Repeat the process for each substring.
Add the permutation to an array.
Given an array of size 98 with natural numbers from 1-100 but 2 numbers are missing, find them.
Calculate the sum of all numbers from 1-100 using the formula n(n+1)/2
Calculate the sum of all numbers in the array
Subtract the sum of array from the sum of all numbers to get the sum of missing numbers
Find the missing numbers by iterating through the array and checking which numbers are not present
Check if a binary tree is a binary search tree or not.
Traverse the tree in-order and check if the elements are in sorted order.
Check if the left child is less than the parent and the right child is greater than the parent.
Use recursion to check if all the subtrees are BSTs.
Maintain a range for each node and check if the node value is within that range.
Detect and remove cycle in a linked list
Use two pointers, one slow and one fast, to detect a cycle
Once a cycle is detected, move one pointer to the head and iterate both pointers until they meet again
Set the next node of the last node in the cycle to null to remove the cycle
Convert a number to its hexadecimal form
Use the built-in function to convert the number to hexadecimal
Alternatively, use the algorithm to convert the number to hexadecimal manually
Ensure to handle negative numbers appropriately
Priority scheduling is a scheduling algorithm where processes are assigned priorities and executed based on their priority level.
Preemptive priority scheduling allows a higher priority process to interrupt a lower priority process that is currently running.
Non-preemptive priority scheduling allows a higher priority process to wait until the lower priority process finishes executing.
A low priority process can preempt a ...
Singleton class is a class that can only have one instance at a time.
Singleton pattern is used when we need to ensure that only one instance of a class is created and that instance can be accessed globally.
The constructor of a singleton class is always private to prevent direct instantiation.
A static method is used to access the singleton instance.
Example: public class Singleton { private static Singleton instance = ne...
Develop tic-tac-toe game using OOPS concepts in CPP.
Create a class for the game board
Create a class for the players
Create a class for the game logic
Use inheritance and polymorphism for game objects
Implement functions for checking win/lose/draw conditions
posted on 14 Oct 2015
posted on 30 Aug 2016
I appeared for an interview 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
Adhoc string questions often test manipulation, searching, or pattern recognition skills in programming.
String reversal: Reverse a string using slicing. Example: 'hello' -> 'olleh'.
Palindrome check: Determine if a string reads the same forwards and backwards. Example: 'racecar' is a palindrome.
Substring search: Find if one string is a substring of another. Example: 'cat' in 'concatenation' returns True.
Character fre...
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...
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...
I transitioned from a non-IT background to coding through self-learning and practical projects, driven by curiosity and problem-solving.
Started with online courses on platforms like Codecademy and Coursera to learn the basics of programming languages like Python and Java.
Worked on personal projects, such as developing a simple web application to track my fitness goals, which helped solidify my coding skills.
Participate...
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
Explore unconventional methods to achieve sub-linear time complexity for the given problem.
Use hashing to store previously computed results, allowing O(1) lookups.
Implement a divide-and-conquer strategy to reduce problem size recursively.
Consider using a probabilistic approach, like Bloom filters, for approximate results.
Utilize parallel processing to handle multiple data segments simultaneously.
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...
Top trending discussions
Left join returns all records from left table and matching records from right table. Full outer join returns all records from both tables.
Left join is used to combine two tables based on a common column.
In left join, all records from the left table are returned along with matching records from the right table.
If there is no match in the right table, NULL values are returned.
Example: SELECT * FROM table1 LEFT JOIN table...
Check if a number is a power of 2 or not.
A power of 2 has only one bit set in its binary representation.
Use bitwise AND operator to check if the number is a power of 2.
If n is a power of 2, then n & (n-1) will be 0.
I applied via Referral
I haven't contributed to open source due to time constraints and focusing on personal projects and learning new technologies.
Time Constraints: Balancing work, personal projects, and learning new technologies has limited my availability.
Focus on Personal Projects: I've been dedicated to developing my own applications, such as a task management tool.
Learning New Technologies: I prioritized mastering frameworks like React...
The Android app connects to Dropbox for file storage and retrieval, enhancing user experience with seamless cloud integration.
Utilizes Dropbox API for authentication and file management.
Implements OAuth 2.0 for secure user login and access.
Allows users to upload, download, and delete files from their Dropbox account.
Features a user-friendly interface for browsing files and folders.
Handles errors gracefully, providing f...
I appeared for an interview before Feb 2021.
Round duration - 60 minutes
Round difficulty - Easy
It comprised of general aptitude questions and two coding questions. It was an offline test.
Given an integer N
, find all possible placements of N
queens on an N x N
chessboard such that no two queens threaten each other.
A queen can attack another queen if they ar...
The N Queens Problem involves finding all possible placements of N queens on an N x N chessboard where no two queens threaten each other.
Use backtracking algorithm to explore all possible configurations.
Keep track of rows, columns, and diagonals to ensure queens do not attack each other.
Generate and print valid configurations where queens are placed safely.
Consider constraints and time limit for efficient solution.
Exam...
Given an integer array arr
of size 'N' containing only 0s, 1s, and 2s, write an algorithm to sort the array.
The first line contains an integer 'T' representing the n...
Sort an integer array containing only 0s, 1s, and 2s in linear time complexity.
Use three pointers to keep track of the positions of 0s, 1s, and 2s in the array.
Iterate through the array and swap elements based on the values encountered.
Achieve sorting in a single scan over the array without using any extra space.
Round duration - 60 minutes
Round difficulty - Easy
After having a technical discussion about my CV. He gave me two questions to code.
Ninja has to determine all the distinct substrings of size two that can be formed from a given string 'STR' comprising only lowercase alphabetic characters. These su...
Find all unique contiguous substrings of size two from a given string.
Iterate through the string and extract substrings of size two
Use a set to store unique substrings
Return the set as an array of strings
Determine if a given singly linked list of integers forms a cycle or not.
A cycle in a linked list occurs when a node's next
points back to a previous node in the ...
Detect if a singly linked list forms a cycle by checking if a node's next points back to a previous node.
Traverse the linked list using two pointers, one moving one step at a time and the other moving two steps at a time.
If the two pointers meet at any point, there is a cycle in the linked list.
If one of the pointers reaches the end of the list (null), there is no cycle.
Round duration - 30 minutes
Round difficulty - Easy
This was supposed to be the HR round but out of surprise the interviewer started by giving me a question to code.
After I approached this question with the right solution he just asked about my family. After that he said to wait. After half an hour the results were announced. A total of three students were hired and I was amongst one of them.
Given an integer N
representing the number of pairs of parentheses, find all the possible combinations of balanced parentheses using the given number of pairs.
Generate all possible combinations of balanced parentheses for a given number of pairs.
Use recursion to generate all possible combinations of balanced parentheses.
Keep track of the number of open and close parentheses used in each combination.
Return the valid combinations as an array of strings.
Tip 1 : Must do Previously asked Interview as well as Online Test Questions.
Tip 2 : Go through all the previous interview experiences from Codestudio and Leetcode.
Tip 3 : Do at-least 2 good projects and you must know every bit of them.
Tip 1 : Have at-least 2 good projects explained in short with all important points covered.
Tip 2 : Every skill must be mentioned.
Tip 3 : Focus on skills, projects and experiences more.
Event bubbling is a JavaScript event propagation mechanism where events propagate from child to parent elements.
In event bubbling, an event starts at the target element and moves up to the root of the DOM tree.
For example, clicking a button inside a div triggers the click event on the button first, then on the div.
This allows parent elements to listen for events triggered by their child elements.
Event bubbling can be s...
The .on() method is more versatile than .click() for event handling in jQuery, allowing for dynamic elements and multiple events.
.on('click', function() {...}) can attach event handlers to both existing and future elements.
.click(function() {...}) is a shorthand for .on('click', ...), but only works for existing elements.
Example of .on(): $('#myButton').on('click', function() { alert('Button clicked!'); });
Example of ....
A function to determine if two strings are anagrams by comparing character counts.
Anagrams are words formed by rearranging the letters of another (e.g., 'listen' and 'silent').
Convert both strings to lowercase to ensure case insensitivity.
Count the frequency of each character in both strings using a dictionary or array.
Compare the character counts; if they match, the strings are anagrams.
Example: 'evil' and 'vile' are ...
Identify the order of an integer array: increasing, decreasing, or mixed patterns.
1. Check if the array is strictly increasing: e.g., [1, 2, 3, 4].
2. Check if the array is strictly decreasing: e.g., [4, 3, 2, 1].
3. Check for decreasing then increasing: e.g., [4, 3, 2, 3, 4].
4. Check for increasing then decreasing: e.g., [1, 2, 3, 2, 1].
Enhancing frontend performance involves optimizing resources, reducing load times, and improving user experience.
Minimize HTTP requests by combining CSS and JavaScript files.
Use asynchronous loading for JavaScript to prevent blocking rendering.
Optimize images by compressing them and using appropriate formats (e.g., WebP).
Implement lazy loading for images and videos to load them only when they are in the viewport.
Utiliz...
Design a database schema for a movie site with user ratings and recommendations.
Create tables for movies, users, ratings, and recommendations
Use foreign keys to link tables
Include columns for movie genre and user watch history
Algorithm for recommendations can use user watch history and ratings to suggest similar movies
This query identifies and retrieves duplicate email addresses from a specified table in a database.
Use the SQL SELECT statement to fetch data.
Group the results by the email column to identify duplicates.
Use the HAVING clause to filter groups with a count greater than 1.
Example query: SELECT email, COUNT(*) as count FROM users GROUP BY email HAVING COUNT(*) > 1;
I applied via Campus Placement
Designing a data structure for a simple snake game on basic Nokia mobiles involves managing the snake's position and game state.
Use a 2D array to represent the game grid, e.g., char grid[10][10];
Maintain a list of coordinates for the snake's body, e.g., List<Point> snake;
Define a Point structure to hold x and y coordinates, e.g., struct Point { int x; int y; };
Track the direction of the snake using an enum, e.g.,...
Some of the top questions asked at the Carwale SDE (Software Development Engineer) interview -
based on 2 reviews
Rating in categories
Accounts Manager
139
salaries
| ₹3 L/yr - ₹5.5 L/yr |
Key Account Manager
100
salaries
| ₹3.3 L/yr - ₹7.8 L/yr |
Regional Manager
36
salaries
| ₹4.7 L/yr - ₹11 L/yr |
Product Manager
29
salaries
| ₹17.3 L/yr - ₹31 L/yr |
Software Development Engineer
21
salaries
| ₹7.9 L/yr - ₹14 L/yr |
MagicBricks
Netmeds.com
Practo
Tracxn