Courses
Sale
Tutorials
Practice
Jobs
DSA
Practice Problems
C
C++
Java
Python
JavaScript
Data Science
Machine Learning
Courses
Linux
DevOps
Output of C++ Program | Set 7
Predict the output of following C++ programs. Question 1CPP class Test1 { int y;};class Test2 { int x; Test1 t1;public: operator Test1() { return t1...
Read More
C++
CPP-Output
Check if a number is multiple of 5 without using / and % operators
Given a positive number n, write a function isMultipleof5(int n) that returns true if n is multiple of 5, otherwise false. You are not allowed to use % and / operators.Met...
Read More
Mathematical
DSA
Object Oriented Programming | Set 1
Following questions have been asked in GATE CS exam. 1. It is desired to design an object-oriented employee record system for a company. Each employee has a name, unique i...
Read More
GATE
Default Constructors in C++
A default constructor is a special constructor in C++ that is used for object initialization when no arguments are provided during creation. It ensures that objects are pr...
Read More
C++
Print a given matrix in spiral form
You are given a rectangular matrix mat[][] of size n x m, and your task is to return an array while traversing the matrix in spiral form.Examples: Input: mat[][] = [[1, ...
Read More
Matrix
DSA
Arrays
Basic Coding Problems
Microsoft
Amazon
Morgan Stanley
Oracle
D-E-Shaw
Snapdeal
Paytm
Accolite
Zoho
Nagarro
MAQ Software
BrowserStack
MakeMyTrip
nearbuy
Amazon-Question
Snapdeal-Question
spiral
pattern-printing
Arrays
Missing and Repeating in an Array
Given an unsorted array arr[] of size n, containing elements from the range 1 to n, it is known that one number in this range is missing, and another number occurs twice i...
Read More
Searching
DSA
Arrays
Amazon
Samsung
MAQ Software
Bitwise-XOR
Arrays
limited-range-elements
Check if a Binary Tree is subtree of another Binary Tree
Given the roots of two binary trees, root1 and root2, determine whether the tree rooted at root2 is a subtree of the tree rooted at root1. Return true if there exists a no...
Read More
Tree
DSA
Microsoft
Amazon
Adobe
Morgan Stanley
SAP Labs
MakeMyTrip
OYO
Cavisson System
Are Array Members Deeply Copied?
In C++, we can assign a struct (or class) variable to another variable of same type. All members of one variable are copied to the other variable. But what happens when th...
Read More
C Language
pointer
C Array and String
When do we use Initializer List in C++?
Initializer List is used in initializing the data members of a class. The list of members to be initialized is indicated with constructor as a comma-separated list followe...
Read More
C++
Output of C++ Program | Set 6
Predict the output of below C++ programs.Question 1C #includeiostreamusing namespace std;class Test { int value;public: Test (int v = 0) {value = v;} i...
Read More
C++
CPP-Output
Output of C++ Program | Set 5
Difficulty Level: RookiePredict the output of below C++ programs.Question 1C++ #includeiostreamusing namespace std;class Test { int value;public: Test(int...
Read More
C++
CPP-Output
When are Constructors Called?
When are the constructors called for different types of objects like global, local, static local, dynamic?1) Global objects: For a global object, constructor is called bef...
Read More
C++
Decision Trees - Fake (Counterfeit) Coin Puzzle (12 Coin Puzzle)
Let us solve the classic "fake coin" puzzle using decision trees. There are the two different variants of the puzzle given below. I am providing description of both the pu...
Read More
Advanced Data Structure
DSA
Output of C++ Program | Set 4
Difficulty Level: RookiePredict the output of below C++ programs.Question 1C #includeiostreamusing namespace std;int x = 10;void fun(){ int x = 2; { ...
Read More
C++
CPP-Output
Naive Pattern Searching for Distinct Characters
Question: We have discussed the Naive String matching algorithm. Consider a situation where all characters of a pattern are different. Can we modify the original Naive Str...
Read More
Pattern Searching
DSA
1
...
12124
12125
12126
12127