Tip 1 : Prepare for DS & Algorithms seriously
Tip 2 : Do atleast 2 good projects
Tip 1 : Put only things which you can justify
Tip 2 : One Page resume
Initially started with introduction, then questions related to python were asked followed by two DSA problems



String 'S' is NOT case sensitive.
Let S = “c1 O$d@eeD o1c”.
If we ignore the special characters, whitespaces and convert all uppercase letters to lowercase, we get S = “c1odeedo1c”, which is a palindrome. Hence, the given string is also a palindrome.
I first converted the number to string. then using two pointer approach I checked if it is palindrome or not.
If it is not palindrome or not I count the even and odd occurrences of numbers to check whether it can be made converted into palindrome.



You can use swap operation over any two indices i,e you can choose two indices 'i' and 'j' and swap the digits present at S[i] and S[j]. But this operation can be used only once.
Your final even number should be the largest out of all other possible even numbers.
If it isn’t possible to make an even number print -1
Started with my introduction. Then the interviewer asked to explain OOPS concept. He asked me about solid principles which I was not familiar with. Then he asked to me write a program which implement all the OOPS concepts like encapsulation, abstraction, inheritance, and polymorphism. I could not code it correctly. Hence, was rejected.
Implement all the OOPS concepts
I did code the problem using smartphone as an example but my code did not run at that time. Here is the running code. Hope it helps-
#include
#include
#include
using namespace std;
//Reusability
class AbstractClass{
virtual void isworthbuy() = 0;
};
//Encapsulation
class smartphone : AbstractClass{
int price;
public:
string brand;
int manf_year;
bool is5g;
void isworthbuy(){
if(is5g){
cout<<"YES"<<'\n';
}
else{
cout<<"NO"<<'\n';
}
}
//Constructor
smartphone(string brand, int manf_year, bool is5g){
this->brand = brand;
this->manf_year = manf_year;
this->is5g = is5g;
}
//Getter
int getprice(){
return price;
}
//Polymorphism
//Setter
void setprice(int number){
if(number < 0){
cout<<"Enter valid price";
return;
}
price = number;
}
void setprice(int number, bool is5g){
if(number < 0){
cout<<"Enter valid price";
return;
}
if(is5g){
price = number + 1000;
}
else{
price = number;
}
}
void print(){
cout }
void print(){
cout< }
};
int main() {
smartphone s1("Apple", 2021, true);
smartphone s2("Samsung", 2021, true);
Apple a1("Apple", 2021, true, "X13");
s1.isworthbuy();
a1.print();
cout<<'\n';
s1.setprice(10000);
s2.setprice(10000, 1);
cout< s1.print();
}

Here's your problem of the day
Solving this problem will increase your chance to get selected in this company
What is recursion?