ZOHO Advanced Programming Round Questions and Answers | ZOHO Round 1, 2, 3 Interview Questions

ZOHO Advanced Programming Round Questions and Answers | Zoho C Output Questions | Zoho C programming questions with answers PDF | Zoho Advanced Coding Round Solution | Zoho Interview Questions for  Freshers PDF

ZOHO Advanced Programming Round Questions and Answers | Zoho Interview Questions for Freshers: The interview process at Zoho typically consists of five rounds, with questions getting tougher as you progress through each. The sections below detail what questions to expect in each round. Here’s everything you need to know about the rounds to land an interview with Ace.  The first round is usually a written exam, but the pandemic has made it an online exam. For experienced people, this round is not mandatory and can be skipped. It is usually a 90-minute long round in which the candidate has to answer multiple-choice questions (MCQs). The number of questions varies depending on the level of difficulty of the questions, ie if the questions are difficult you will have around 20 questions. Well, if you are around or above 40 questions, don’t panic, understand that the questions are easy. In Zoho Advanced Coding Test, students have to design small projects. Zoho Advanced Coding Circuit They only focus on your design programming project. To get the latest Private Jobs, click here

ZOHO PREPARATION LINKS
Zoho Aptitude Questions with Answers Zoho Previous Year Question Papers with Answers
ZOHO Coding Questions and Answers Zoho Interview Questions With Answers 2023
Zoho Computer Programming Questions and Answers ZOHO Advanced Programming Round Questions and Answers 
Zoho Salary Structure in Chennai Area Zoho Aptitude Questions with Answers 2023
Zoho On-Campus Coding Questions and Answers 2023

This round consists of around 20 to 30 questions from both General Aptitude and Programming Aptitude. Generally, 30% to 50% of General Aptitude questions, rest of the questions are from C programming. It doesn’t take much to crack a Joho interview. You only need to have a basic understanding of concepts like loops, recursions, pointers, and problem-solving skills. Also, consider these tips which are given below. Zoho Advanced Coding Questions and Answers are very important sections for new aspirants. ZOHO Advanced coding round is the most difficult round of the recruitment process. ZOHO Advanced Coding exam requires students to design modules for a given project. To avail of exclusive job offers, join our Telegram Channel page now!


Zoho Summary

Zoho is a comprehensive suite of productivity and collaboration tools that helps businesses of all sizes achieve their goals. Founded in 1996, Zoho has a long history of innovation and a solid commitment to customer success. Today, Zoho serves millions of customers worldwide.

With Zoho, businesses can operate entirely in the cloud or integrate Zoho with their existing on-premise applications. Zoho also offers a variety of mobile applications, so businesses can stay productive even when they’re on the go.

Zoho prides itself on being easy to use yet powerful enough to meet the needs of even the most demanding businesses. And because Zoho is offered as a cloud-based service, businesses can sign up and get started using Zoho without any upfront costs or long-term commitments.

Selection Process

  1. Written test (freshers)
  2. Basic programming
  3. Advanced Programming
  4. Technical HR
  5. General HR

Advanced Programming Round

Questions: Ratan is a crazy rich person. And he is blessed with luck, so he always made the best profit possible with the shares he bought. That means he bought a share at a low price and sold it at a high price to maximize his profit. Now you are an income tax officer and you need to calculate the profit he made with the given values of stock prices each day. You have to calculate only the maximum profit Ratan earned.

Example 1

Price=[1,6,2]

Ratan buys it on the first day and sells it on the second.

Example 2

Price=[9,8,6]

The Price always went down, Ratan never bought it.

Input Format:

First line with an integer n, denoting the number days with the value of the stack

Next n days, telling the price of the stock on that very day.

Output Format:

Maximum profit done by Ratan in a single line.

Constraints:
Number of days <=10^8

Sample Input for Custom Testing

STDIN

———–

7

1

9

2

11

1

9

2

Sample Output

10

Explanation

The maximum profit possible is when Ratan buys it in 1 rupee and sells it in 11.

JAVA PROGRAM:

import java.util.Arrays;
import java.util.Comparator;
import java.util.Scanner;

class Main {
    public static void main(String[] args) {
        String s1="geeksforgeeks";
        String s2="forgeeksgeeks";
       boolean answer=rotateString(s1,s2);
       System.out.println(answer);
    }
    
     public static boolean rotateString(String s1, String s2) {
       
        for(int j=1;j < s1.length();j++){
         StringBuilder sb = new StringBuilder();
            for(int i=j;i < s1.length();i++){
              sb.append(s1.charAt(i));
            }
            for(int i=0;i < j;i++){
              sb.append(s1.charAt(i));
           }
            if(s2.equals(sb.toString())){
                return true;
            }
        }
        return false;
    }
}

Questions: 

Solutions:

Questions: Here they asked us to create a “Railway reservation system” and gave us 4 modules. The modules were:
1. Booking
2. Availability checking
3. Cancellation
4. Prepare chart
We were asked to create the modules for representing each data first and to continue with the implementation phase.

Solutions:

#include<stdio.h>
#include<conio.h>
#include<stdlib.h>
#include<string.h>
#include<iostream.h>
#include<time.h>
#include<iomanip.h>
#include<fstream.h>
char f[10]="f";
char s[10]="s";
int addr,ad,flag,f1,d,m,i,amt;
float tamt;
class login
{
public:
    char id[100];
    char pass[100];
    char *password;
    void getid()
    {
        cout<<"Enter your id:";
        gets(id);
        password=getpass("Enter the password:");
        strcpy(pass,password);
    }
    void displayid()
    {
        cout<<"Id:";
        puts(id);
        cout<<"Password:";
        puts(pass);
    }
};
class detail
{
public:
    int tno;
    char tname[100];

    char bp[100];
    char dest[100];
    int c1,c1fare;
    int c2,c2fare;
    int d,m,y;
    void getdetail()
    {
        cout<<"Enter the details as follows\n";
        cout<<"Train no:";
        cin>>tno;
        cout<<"Train name:";
        gets(tname);
        cout<<"Boarding point:";
        gets(bp);
        cout<<"Destination pt:";
        gets(dest);
        cout<<"No of seats in first class & fare per ticket:";
        cin>>c1>>c1fare;
        cout<<"No of seats in second class & fare per ticket:";
        cin>>c2>>c2fare;
        cout<<"Date of travel:";
        cin>>d>>m>>y;
    }
    void displaydetail()
    {
        cout<<tno<<"\t"<<tname<<"\t"<<bp<<"\t"<<dest<<"\t";
        cout<<c1<<"\t"<<c1fare<<"\t"<<c2<<"\t"<<c2fare<<"\t";
        cout<<d<<"-"<<m<<"-"<<y<<"\t"<<endl;
    }
};
class reser
{
public:
    int pnr;
    int tno;
    char tname[100];
    char bp[10];
    char dest[100];
    char pname[10][100];
    int age[20];
    char clas[10];
    int nosr;
    int i;
    int d,m,y;
    int con;


    float amc;
    void getresdet()
    {
        cout<<"Enter the details as follows\n";
        cout<<"Train no:";
        cin>>tno;
        cout<<"Train name:";
        gets(tname);
        cout<<"Boarding point:";
        gets(bp);
        cout<<"Destination pt:";
        gets(dest);
        cout<<"No of seats required:";
        cin>>nosr;
        for(i=0; i<nosr ; i++)
        {
            cout<<"Passenger name:";
            gets(pname[i]);
            cout<<"Passenger age:";
            cin>>age[i];
        }
        cout<<"Enter the class f-first class s-second class:";
        gets(clas);
        cout<<"Date of travel:";
        cin>>d>>m>>y;
        cout<<"Enter the concession category\n";
        cout<<"1.Military\n2.Senior citizen\n";
        cout<<"3.Children below 5 yrs\n4.None\n";
        cin>>con;
        cout<<"............END OF GETTING DETAILS............\n";
    }
    void displayresdet()
    {
        cout<<"...............................................\n";
        cout<<"...............................................\n";
        cout<<"Pnr no:"<<pnr;
        cout<<"\nTrain no:"<<tno;
        cout<<"\nTrain name:";
        puts(tname);
        cout<<"Boarding point:";
        puts(bp);
        cout<<"Destination pt:";
        puts(dest);
        cout<<"No of seats reserved:"<<nosr;
        for(i=0; i<nosr; i++)
        {
            cout<<"Passenger name:";
            puts(pname[i]);
            cout<<"Passenger age:"<<age[i];
        }

        cout<<"\nYour class:";
        puts(clas);
        cout<<"\nDate of reservation:"<<d<<"-"<<m<<"-"<<y;
        cout<<"\nYour concession category:"<<con;
        cout<<"\nYou must pay:"<<amc<<endl;
        cout<<"***********************************************\n";
        cout<<".........END OF RESERVATION.................\n";
        cout<<"***********************************************\n";
    }
};
class canc
{
public:
    int pnr;
    int tno;
    char tname[100];
    char bp[10];
    char dest[100];
    char pname[10][100];
    int age[20];
    int i;
    char clas[10];
    int nosc;
    int d,m,y;
    float amr;
    void getcancdet()
    {
        cout<<"Enter the details as follows\n";
        cout<<"Pnr no:";
        cin>>pnr;
        cout<<"Date of cancellation:";
        cin>>d>>m>>y;
        cout<<"...........END OF GETTING DETAILS...........\n";
    }
    void displaycancdet()
    {
        cout<<"...........................................\n";
        cout<<"...........................................\n";
        cout<<"Pnr no:"<<pnr;
        cout<<"\nTrain no:"<<tno;
        cout<<"\nTrain name:";
        puts(tname);
        cout<<"Boarding point:";
        puts(bp);

        cout<<"Destination pt:";
        puts(dest);
        cout<<"\nYour class:";
        puts(clas);
        cout<<"no of seats to be cancelled:"<<nosc;
        for(i=0; i<nosc; i++)
        {
            cout<<"Passenger name:";
            puts(pname[i]);
            cout<<"passenger age:"<<age[i];
        }
        cout<<"\nDate of cancellation:"<<d<<"-"<<m<<"-"<<y;
        cout<<"\nYou can collect:"<<amr<<"rs"<<endl;
        cout<<"*****************************************\n";
        cout<<".........END OF CANCELLATION.............\n";
        cout<<"*****************************************\n";
    }
};
void manage();
void can();
void user();
void database();
void res();
void reserve();
void displaypassdetail();
void cancell();
void enquiry();
void main()
{
    clrscr();
    int ch;
    cout<<"~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n";
    cout<<".......WELCOME TO RAILWAY RESERVATION SYSTEM..........\n";
    cout<<"~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n";
    do
    {
        cout<<"^^^^^^^^^^^^^^^^^^^^^^MAIN MENU^^^^^^^^^^^^^^^^^^^^\n";
        cout<<"1.Admin mode\n2.User mode\n3.Exit\n";
        cout<<"Enter your choice:";
        cin>>ch;
        cout<<endl;
        switch(ch)

        {
        case 1:
            database();
            break;
        case 2:
            user();
            break;
        case 3:
            exit(0);
        }
    }
    while(ch<=3);
    getch();
}
void database()
{
    char *password;
    char *pass="codewithc";
    password=getpass("Enter the admininistrator password:");
    detail a;
    fstream f;
    int ch;
    char c;
    if(strcmp(pass,password)!=0)
    {
        cout<<"Enter the password correctly \n";
        cout<<"You are not permitted to logon this mode\n";
        goto h;
    }
    if(strcmp(pass,password)==0)
    {
        char c;
        do
        {
            cout<<"...........ADMINISTRATOR MENU...........\n";
            cout<<"1.Create detail data base\n2.Add details\n";
            cout<<"3.Display details\n4.User management\n";
            cout<<"5.Display passenger details\n6.Return to main menu\n";
            cout<<"Enter your choice:";
            cin>>ch;


            cout<<endl;
            switch(ch)
            {
            case 1:
                f.open("t.txt",ios::out|ios::binary);
                do
                {
                    a.getdetail();
                    f.write((char *) & a,sizeof(a));
                    cout<<"Do you want to add one more record?\n";
                    cout<<"y-for Yes\nn-for No\n";
                    cin>>c;
                }
                while(c=='y');
                f.close();
                break;
            case 2:
                f.open("t.txt",ios::in|ios::out|ios::binary|ios::app);
                a.getdetail();
                f.write((char *) & a,sizeof(a));
                f.close();
                break;
            case 3:
                f.open("t.txt",ios::in|ios::out|ios::binary|ios::app);
                f.seekg(0);
                while(f.read((char *) & a,sizeof(a)))
                {
                    a.displaydetail();
                }
                f.close();
                break;
            case 4:
                manage();
                break;
            case 5:
                displaypassdetail();
                break;
            }
        }
        while(ch<=5);

        f.close();
    }
h:
}
void reserve()
{
    int ch;
    do
    {
        cout<<"1.Reserve\n2.Return to the main menu\n";
        cout<<"Enter your choice:";
        cin>>ch;
        cout<<endl;
        switch(ch)
        {
        case 1:
            res();
            break;
        }
    }
    while(ch==1);
    getch();
}
void res()
{
    detail a;
    reser b;
    fstream f1,f2;
    time_t t;
    f1.open("t.txt",ios::in|ios::out|ios::binary);
    f2.open("p.txt",ios::in|ios::out|ios::binary|ios::app);
    int ch;
    b.getresdet();
    while(f1.read((char *) &a,sizeof(a)))
    {
        if(a.tno==b.tno)
        {
            if(strcmp(b.clas,f)==0)
            {
                if(a.c1>=b.nosr)

                {
                    amt=a.c1fare;
                    addr=f1.tellg();
                    ad=sizeof(a.c1);
                    f1.seekp(addr-(7*ad));
                    a.c1=a.c1-b.nosr;
                    f1.write((char *) & a.c1,sizeof(a.c1));
                    if(b.con==1)
                    {
                        cout<<"Concession category:MILITARY PERSONNEL\n";

                        b.amc=b.nosr*((amt*50)/100);
                    }
                    else if(b.con==2)
                    {
                        cout<<"Concession category:SENIOR CITIZEN\n";
                        b.amc=b.nosr*((amt*60)/100);
                    }
                    else if(b.con==3)
                    {
                        cout<<"Concession category:CHILDERN BELOW FIVE\n";
                        b.amc=0.0;
                    }
                    else if(b.con==4)
                    {
                        cout<<"You cannot get any concession\n";
                        b.amc=b.nosr*amt;
                    }
                    srand((unsigned) time(&t));
                    b.pnr=rand();
                    f2.write((char *) & b,sizeof(b));
                    b.displayresdet();
                    cout<<"------------------------------------------------------\n";
                    cout<<"--------------Your ticket is reserved-----------\n";
                    cout<<"-----------------End of reservation menu-------\n";
                }
                else
                {
                    cout<<"**********Sorry req seats not available********\n";

                }
            }
            else if(strcmp(b.clas,s)==0)
            {
                if(a.c2>=b.nosr)
                {
                    amt=a.c2fare;
                    addr=f1.tellg();
                    ad=sizeof(a.c2);
                    f1.seekp(addr-(5*ad));
                    a.c2=a.c2-b.nosr;
                    f1.write((char *) & a.c2,sizeof(a.c2));
                    if(b.con==1)
                    {
                        cout<<"Concession category:MILITARY PRESONNEL\n";
                        b.amc=b.nosr*((amt*50)/100);
                    }
                    else if(b.con==2)
                    {
                        cout<<"Concession category:SENIOR CITIZEN\n";
                        b.amc=b.nosr*((amt*60)/100);
                    }
                    else if(b.con==3)
                    {
                        cout<<"Concession category:CHILDERN BELOW FIVE\n";
                        b.amc=0.0;
                    }
                    else if(b.con==4)
                    {
                        cout<<"You cannot get any concession\n";
                        b.amc=b.nosr*amt;
                    }
                    f2.write((char *) & b,sizeof(b));
                    b.displayresdet();
                    cout<<"---------------------------------------\n";
                    cout<<"--------Your ticket is reserved--------\n";
                    cout<<"------------End of reservation---------\n";
                }
                else


                {
                    cout<<"********Sorry req no of seats not available*******\n";
                }
            }
            getch();

            goto h;
        }
        else
        {
            flag=0;
        }
    }
    if(flag==0)
    {
        cout<<"............Wrong train no......................\n";
        cout<<"......Enter the train no from the data base.....\n";
    }
    f1.close();
    f2.close();
    getch();
h:
}
void displaypassdetail()
{
    fstream f;
    reser b;
    f.open("p.txt",ios::in|ios::out|ios::binary);
    f.seekg(0);
    while(f.read((char *) & b,sizeof(b)))
    {
        b.displayresdet();
    }
    f.close();
    getch();
}
void enquiry()
{

    fstream f;
    f.open("t.txt",ios::in|ios::out|ios::binary);
    detail a;
    while(f.read((char *) & a,sizeof(a)))
    {
        a.displaydetail();
    }
    getch();
}
void cancell()
{
    detail a;
    reser b;
    canc c;
    fstream f1,f2,f3;
    f1.open("t.txt",ios::in|ios::out|ios::binary);
    f2.open("p.txt",ios::in|ios::out|ios::binary);
    f3.open("cn.txt",ios::in|ios::out|ios::binary);
    cout<<"**********CANCELLATION MENU*********\n";
    c.getcancdet();
    while(f2.read((char *) & b,sizeof(b)))
    {
        if(b.pnr==c.pnr)
        {
            c.tno=b.tno;
            strcpy(c.tname,b.tname);
            strcpy(c.bp,b.bp);
            strcpy(c.dest,b.dest);
            c.nosc=b.nosr;
            for(int j=0; j<c.nosc; j++)
            {
                strcpy(c.pname[j],b.pname[j]);
                c.age[j]=b.age[j];
            }
            strcpy(c.clas,b.clas);
            if(strcmp(c.clas,f)==0)
            {
                while(f1.read((char *) & a,sizeof(a)))
                {

                    if(a.tno==c.tno)
                    {
                        a.c1=a.c1+c.nosc;
                        d=a.d;
                        m=a.m;
                        addr=f1.tellg();
                        ad=sizeof(a.c1);
                        f1.seekp(addr-(7*ad));
                        f1.write((char *) & a.c1,sizeof(a.c1));
                        tamt=b.amc;
                        if((c.d==d)&&(c.m==m))
                        {
                            cout<<"You are cancelling at the date of departure\n";
                            c.amr=tamt-((tamt*60)/100);
                        }
                        else if(c.m==m)
                        {
                            cout<<"You are cancelling at the month of departure\n";
                            c.amr=tamt-((tamt*50)/100);
                        }
                        else if(m>c.m)
                        {
                            cout<<"You are cancelling one month before the date of departure\n";
                            c.amr=tamt-((tamt*20)/100);
                        }
                        else
                        {
                            cout<<"Cancelling after the departure\n";
                            cout<<"Your request cannot be completed\n";
                        }
                        goto h;
                        c.displaycancdet();
                    }
                }
            }
            else if(strcmp(c.clas,s)==0)
            {
                while(f1.read((char *) & a,sizeof(a)))
                {

                    if(a.tno==c.tno)
                    {
                        a.c2=a.c2+c.nosc;
                        d=a.d;
                        m=a.m;
                        addr=f1.tellg();
                        ad=sizeof(a.c2);
                        f1.seekp(addr-(5*ad));
                        f1.write((char *) & a.c2,sizeof(a.c2));
                        tamt=b.amc;
                        if((c.d==d)&&(c.m==m))
                        {
                            cout<<"You are cancelling at the date of departure\n";
                            c.amr=tamt-((tamt*60)/100);
                        }
                        else if(c.m==m)
                        {
                            cout<<"You are cancelling at the month of departure\n";
                            c.amr=tamt-((tamt*50)/100);
                        }
                        else if(m>c.m)
                        {
                            cout<<"You are cancelling one month before the date of departure\n";
                            c.amr=tamt-((tamt*20)/100);
                        }
                        else
                        {
                            cout<<"Cancelling after the departure\n";
                            cout<<"Your request cannot be completed\n";
                        }
                        goto h;
                        c.displaycancdet();
                    }
                }
            }
        }
        else
        {
            flag=0;

        }
    }
h:
    if(flag==0)
    {
        cout<<"Enter the correct pnr no\n";
    }
    f1.close();
    f2.close();
    f3.close();
    getch();
}
void can()
{
    int ch;
    do
    {
        cout<<".................CANCELLATION MENU.........\n";
        cout<<"1.Cancell\n2.Return to the main menu\n";
        cout<<"Enter your choice:";
        cin>>ch;
        cout<<endl;
        switch(ch)
        {
        case 1:
            cancell();
            break;
        }
    }
    while(ch==1);
    getch();
}
void user()
{
    login a;
    int ch;
    cout<<"*****************************************************\n";
    cout<<"***********WELCOME TO THE USER MENU**\n";
    cout<<"****************************************************\n";
    char *password;

    fstream f;
    f.open("id.txt",ios::in|ios::out|ios::binary);
    char id[100];
    puts("Enter your id:");
    gets(id);
    password=getpass("Enter your password:");
    while(f.read((char *) & a,sizeof(a)))
    {
        if((strcmp(a.id,id)==0)&&(strcmp(a.pass,password)==0))
        {
            do
            {
                cout<<"1.Reserve\n2.Cancell\n3.Enquiry\n4.Return to the main menu\n";
                cout<<"Enter your choice:";
                cin>>ch;
                cout<<endl;
                switch(ch)
                {
                case 1:
                    reserve();
                    break;
                case 2:
                    cancell();
                    break;
                case 3:
                    enquiry();
                    break;
                }
            }
            while(ch<=3);
            goto j;
        }
        else
        {
            d=1;
        }
    }
    if(d==1)
    {
        cout<<"Enter your user id and password correctly\n";
    }

    getch();
j:
}
void manage()
{
    int ch;
    fstream f;
    char c;
    login a;
    cout<<".........WELCOME TO THE USER MANAGEMENT MENU........\n";
    do
    {
        cout<<"1.Create id data base\n2.Add details\n";
        cout<<"3.Display details\n4.Return to the main menu\n";
        cout<<"Enter your choice:";
        cin>>ch;
        cout<<endl;
        switch(ch)
        {
        case 1:
            f.open("id.txt",ios::out|ios::binary);
            do
            {
                a.getid();
                f.write((char *) & a,sizeof(a));
                cout<<"Do you want to add one more record\n";
                cout<<"y-Yes\nn-No\n";
                cin>>c;
            }
            while(c=='y');
            f.close();
            break;
        case 2:
            f.open("id.txt",ios::in|ios::out|ios::binary|ios::app);
            a.getid();
            f.write((char *) & a,sizeof(a));
            f.close();
            break;
        case 3:
            f.open("id.txt",ios::in|ios::out|ios::binary);

            f.seekg(0);
            while(f.read((char *) & a,sizeof(a)))
            {
                a.displayid();
            }
            f.close();
            break;
        }
    }
    while(ch<=3);
    getch();
}

C++ PROGRAM:

#include <bits/stdc++.h>
using namespace std;
int solve(vector v)
{
    int n = v.size();
    if (n == 0)
        return 0;
    int mx = v[0];
    for (int i = 1; i < n; i++)
        mx = max(mx, v[i]);
    if (mx <= 0)
        return 0;
    int mxSum = 0;
    int cSum = 0;
    for (int i = 0; i < n; i++)
    {
        cSum += v[i];
        if (cSum < 0)
            cSum = 0;
        mxSum = max(mxSum, cSum);
    }
    return mxSum;
}
int main()
{
    int n;
    cin >> n;
    int price[n];
    for (int i = 0; i < n; i++) cin >> price[i];
    vector diff;
    for (int i = n-2; i >=0 ; i--) diff.push_back(price[i+1] - price[i]);
    int ans = solve(diff);
    if(ans<0) cout << 0<< endl;
    else cout << ans<< endl;
}

Questions: Mr. Robot is making a website, in which there is a tab to create a password. As other websites, there are rules so that the password gets complex and none can predict the password for another. So he gave some rules like:

– At least one numeric digit

– At Least one Small/Lowercase Letter

– At Least one Capital/Uppercase Letter

– Must not have space

– Must not have slash (/)

– At least 6 characters

If someone inputs an invalid password, the code prints: “Invalid password, try again”.

Otherwise, it prints: “password valid”.

Input Format:

A line with a given string as a password

Output Format:

If someone inputs an invalid password, the code prints: “Invalid password, try again”.

Otherwise, it prints “password valid”, without quotation marks.

Constraints:

Number of characters in the given string <=10^9

Sample input 1:

abjnlL09

Sample output 1:

password valid

Sample input 2:

jjnaskpk

Sample output 2:

Invalid password, try again

C++ PROGRAM

#include<bits/stdc++.h>
using namespace std;
 
int CheckPassword(char str[],int n)
{
   if(n<4) return 0;
   int a=0,cap=0,nu=0,low=0;
   while(a<n) { if(str[a]==' ' || str[a]=='/') return 0; if(str[a]>=65&&str[a]<=90) {cap++;} if(str[a]-32>=65&&str[a]-32<=90) {low++;} else if(str[a]-'0'>=0 && str[a]-'0'<=9) nu++; a++; } return cap>0 && nu>0 && low>0 ;
}
 
int main()
{
    string s;
    getline(cin,s);
    int len=s.size();
    char *c=&s[0];
    if(CheckPassword(c,len))
    cout<<"password valid";
    else cout<<"Invalid password, try again";
}

PYTHON PROGRAM:

def CheckPassword(s,n):
    if n<4:
        return 0
    cap=0
    nu=0
    lo=0
    for i in range(n):
        if s[i]==' ' or s[i]=='/':
            return 0
        if s[i]>='A' and s[i]<='Z':
            cap+=1
        if s[i]>='a' and s[i]<='z':
            lo+=1
        elif s[i].isdigit():
            nu+=1
            
    if cap>0 and nu>0 and lo>0:
        return 1
    else:
        return 0
    
 
s=input()
a=len(s)
if CheckPassword(s,a):
    print("password valid")
else:
    print("Invalid password, try again")

Questions: Ajay has a flight to catch in an hour. So he has to reach the airport as fast at possible. He hires a taxi and promises the taxi driver that if he reaches the airport within k minutes he would pay the taxi driver double the amount.

The city description is as follows –

The taxi is at point 0,0  & airport is at (n-1,m-1) in a 2 – D grid of n rows and m columns. The grid has some blocked (represented as’#’) and some unblocked (represented as’.’) cells.

The starting position of the taxi is in the top – left corner of the grid. It is guaranteed that the starting position & ending positions are not blocked. Each cell of the grid is connected with its right ,left,top,bottom cells (if those cells exist ). It takes 1 second for a taxi to move from a cell to its adjacent cell.

If the taxi can reach the bottom-right (airport) corner of the grid within  k seconds, return the string ‘Yes’. Otherwise , return the string ‘No’.

Example 

rows =3

grid =[‘..##’,’#.##’,’#…’]

maxTime =5

..##

#.##

#…

It will take the taxi 5 seconds to reach the bottom right corner. As long as k>_5,return

‘Yes’.

Returns:

String;the final string; either ‘yes’ or ‘ No’

Constraints 

  • 1<_rows<_500
  • 0<_maxTime<_10^6

Input Format For Custom Testing

The first line contains an integer,rows that denotes the number of rows of the 2-D grid

In each of the next rows lines, the i^th line contains a string denoting the configuration of the i^th row of the grid.

The last line contains an integer, maxTime, that represents the maximum time in seconds the taxi has to reach the bottom right cell.

Sample Input 0

2 -> size of grid[] rows =2

.. -> grid = [‘..’,’..’]

..

3 -> maxTime = 3

Sample Output

Yes

Explanation

The grid has 2 rows and 2 columns and the time within which the taxi needs to reach the bottom-right cell in 3 seconds. Starting from the top-left cell, the taxi can either move to the top-right unblocked

JAVA PROGRAM:

import java.util.*;
public class Main
{
  public static void main(String[] args)
{
   Scanner sc=new Scanner(System.in);
   int n=sc.nextInt();
   char matrix[][]=new char[n][n];
      for (int i = 0; i < n; i++)
        for (int j = 0; j < n; j++)
           matrix[i][j]=sc.next().charAt(0);
    int dp[][]=new int[n][n];
    for (int i = 0; i < n; i++)
        for (int j = 0; j < n; j++)
            dp[i][j] = Integer.MAX_VALUE;

    long maxTime=sc.nextInt();
     dp[0][0] = 0;
     for (int i = 1; i < n; i++)
    {
        if (matrix[0][i] == '#')
            break;
        dp[0][i] = dp[0][i - 1] + 1;
    }
 
    for (int i = 1; i < n; i++)
    {
        if (matrix[i][0] == '#')
            break;
       dp[i][0] = dp[i-1][0] + 1;
    }
 
    for (int i = 1; i < n; i++)
    {
        for (int j = 1; j < n; j++)
        {
            if(matrix[i][j]=='#')
                continue;
            dp[i][j] = Math.min(dp[i-1][j],dp[i][j-1])+1;
        }
    }
    
    if(dp[n-1][n-1] < maxTime)
        System.out.println("Yes");
    else
      System.out.println("No"); 

}
}

C++ PROGRAM

#include<bits/stdc++.h>
#define INF 1000000000
#define ll long long
using namespace std;
 
char mat[505][505];
ll dp[505][505];
 
int main()
{
    int n;
    cin >> n;
 
    for (int i = 0; i < n; i++)
        for (int j = 0; j < n; j++)
            cin >> mat[i][j];
 
    for (int i = 0; i < n; i++)
        for (int j = 0; j < n; j++)
            dp[i][j] = INF;
 
    ll mxTime = 0;
    cin >> mxTime;
 
    dp[0][0] = 0;
    for (int i = 1; i < n; i++)
    {
        if (mat[0][i] == '#')
            break;
 
        dp[0][i] = dp[0][i - 1] + 1;
    }
 
    for (int i = 1; i < n; i++)
    {
        if (mat[i][0] == '#')
            break;
 
        dp[i][0] = dp[i-1][0] + 1;
    }
 
    for (int i = 1; i < n; i++)
    {
        for (int j = 1; j < n; j++)
        {
            if(mat[i][j]=='#')
                continue;
            dp[i][j] = min(dp[i-1][j],dp[i][j-1])+1;
        }
    }
    
    if(dp[n-1][n-1]>mxTime)
        cout << "No" << endl;
    else
        cout << "Yes" << endl;
    return 0;
}

Questions: You are given an array, You have to choose a contiguous subarray of length ‘k’, and find the minimum of that segment, return the maximum of those minimums.

Sample Input

1 →  Length of segment x =1

5 →  size of space n = 5

1 → space = [ 1,2,3,1,2]

2

3

1

2

Sample output

3

Explanation

The subarrays of size x = 1 are [1],[2],[3],[1], and [2],Because each subarray only contains 1 element, each value is minimal with respect to the subarray it is in. The maximum of these values is 3. Therefore, the answer is 3

C++ PROGRAM:

#include <bits/stdc++.h>
using namespace std;
vector arr;
int prevmin=-1;
int flag=0;
int x,n,q;

int sorting(int start,int end)
{
    if(start+1==n) {start=0;end=end-n;}
    if(start==end) return arr[start];
    return min(arr[start],sorting(start+1,end));
}

int func(int start,int end)
{
    if(flag==0) {flag++;return prevmin=sorting(start,end);}
    if(arr[start-1]==prevmin) return prevmin;
    return prevmin=(arr[end]<=prevmin)?prevmin:sorting(start,end);

}

int main()

{

    cin>>x>>n;
    int ans=0;
    for(int i=0;i<n;i++) {cin="">>q;arr.push_back(q);}
    for(int i=0;i < n;i++)
    {
       ans=max(ans,func(i,i+x-1));
    }
    cout << ans;
}
</n;i++)>

PYTHON PROGRAM:

s=int(input())
n=int(input())
a=[]
for i in range(n):
    a.append(int(input()))
   

def min_in_segment(start,end,prev,s,prev_min):
    if s==1:
        return a[start]
    else:
        if prev==-1 or prev_min==-2:
            return min(a[start:end+1])
        elif prev_min!=-2:
            if prev!=prev_min:
                if a[end] < prev_min:
                    return a[end]
                else:
                    return prev_min
            else:
                return min(a[start:end+1])
            

 
msf=-1
prev=-1
prev_min=-2
for i in range(n-s+1):
    new_min=min_in_segment(i,i+s-1,prev,s,prev_min)
    msf=max(msf,new_min)
    prev=a[i]
    prev_min=new_min
print(msf)

JAVA PROGRAM:

import java.util.*;
public class DiskSpace
{
  public static void main(String[] args)
{
  Scanner sc=new Scanner(System.in);
  int x=sc.nextInt();
  int n=sc.nextInt();
  int arr[]=new int[n];
  for(int i=0;i < n;i++)
   arr[i]=sc.nextInt();

  int min=Integer.MAX_VALUE;
  int max=Integer.MIN_VALUE;

  for(int i=0;i <= n-x;i++)
 {
    min=Integer.MAX_VALUE;
    for(int j=i;j<(i+x);j++)
     min=Math.min(min,arr[j]);
   max=Math.max(min,max);     
 }
 System.out.println(max);
}
}

Zoho Interview Preparation

Practice problem-solving regularly

Research Zoho and its products/services before your interview. This will give you a better understanding of the company.

Be interactive

Be prepared to talk about your past experiences, both professional and personal. It shows that you can communicate effectively and connect with others.

Dress for Success

First impressions are important, so make sure you dress appropriately for the interview. Business normal height is generally acceptable.

Be Positive and Confident

Show that you are excited about the opportunity to interview with Zoho. A positive attitude will make you a good candidate for the desired position.

Communication is key

While solving technical problems with data streams and algorithms, you need to monitor your interviewer.

Use the STAR method to answer behavioral questions:

The best way to answer any behavioral question is to structure your answer using the STAR system. STAR stands for Situation, Task, Action, Result. You should first describe the situation, explain the task you need to complete, then explain the necessary actions you took to complete the task, and finally explain the final results you achieved.

Write clean and readable code:

The code you write should be clean, uncluttered with comments, and free of line breaks and spaces. Remember that your job involves writing code that will be used for years. Writing crisp and clean code checks all the right boxes during the interview.

How to write clean and readable code?

This is an important but very underrated piece of advice. Applicants tend to think that all they need to do to get a job is to focus on solving problems and writing clean and readable code.

  • But understand that writing clean and readable code is very important for an interview in a product-oriented company.
  • Why is it important? Well, when you’re done interviewing and working, you’re going to be working with a team on a product that will be used for years.
  • At that point, you should write clean and readable code so that your teammates can understand it and work on it.
  • Therefore, you need to show the interviewer that you are capable of writing clean and readable code or at least care about writing them.

***BEST OFF LUCK***

Cracking upcoming exams is not that difficult if you work hard. Naukrimessenger.com will help you to do so. Join our Telegram channel page now with the direct link provided on our homepage to get guidance and stay on the right track of preparation. You will also get other features that will help you.