Zoho Advanced Coding

Zoho Advanced Coding Round Solution

Zoho Advanced Coding Questions and Answers is very important sections for the freshers candidate. ZOHO Advanced Coding Round is the difficult round of the Recruitment Process. In the ZOHO  Advanced Coding Test students are required to design the modules for the Program given.

In Zoho Advanced Coding Test, students are expected to design small projects. Zoho Advanced Coding Round  they are focused only on your design programming project.

 

Zoho Advanced Programming Question and Answer
Total Number of Questions 2 Questions
Total Time 60 mins
Difficulty Hard

Zoho Advanced Coding :-

Zoho Advanced Coding Round is very important Round to go ahead for the Interview. It is little difficult to crack .The Questions asked in this round are mainly designed based and of Advanced level. 

There will be total 5 questions and time alloted is 75 minutes.

Zoho Advanced Coding Questions and answers

To know more about zoho computer programming sections please visit zoho computer programming dashboard. There you will get detailed information about Zoho Computer Programming Questions and Answers

Student Interview Experience

                                                                                                                                     Student Details

Name: Satyam
College: IIT, Bombay
Branch: Information Technology
Type of interview: On-Campus Interview

                                                                                                                                   Student Interview

Zoho visited our campus for a recruitment drive. Their eligibility criteria was very flexible. All departments were eligible and even students with backlogs were allowed to apply. They conducted 5 rounds.

Round 1- Written Test 

The first round was an Online exam. There were aptitude and programming questions. All the questions were MCQs. Students who cleared this round were invited for the programming round.

Round 2- Programming Round

We had 3 hours to solve 5 programming questions. We could code in C/C++/JAVA. After solving this round, there was an advanced programming round.

Round 3- Advanced Programming Round

In this round, we had to develop a system, which would meet all the requirements that are specified in the problem statement, and also provide the desired output. I had to design a Railway Reservation System. The programming language which could be used was limited to C, C++, Java. I used C to work on this system. After this there was a week waiting for the result. Luckily I was shortlisted for the interview round.

Round 4 – Technical Interview Round   

This was the Technical Interview Round. My round lasted pretty long for almost an hour. The interviewer had clearly gone through my resume and had prepared questions accordingly because he asked about each and everything that I had mentioned there. There were also questions on programming concepts and data structures.

Questions:-

  • Please introduce yourself.
  • What is an object oriented programming language?
  • What are the Object Oriented Programming Concepts?
  • He asked some database queries.
  • What is the difference between DDL and DML?
  • Explain your project.
  • What technologies did you use?
  • How many members were there in your team? What was your role in creating this project?
  • In this internship that you did, what was your biggest takeaway?
  • Which technology do you enjoy the most working with?
  • He asked me some puzzles.
  • He asked me about the various paper presentations I had done. What was the experience of that?
  • He asked me about a research paper that I had published.

I answered all the questions to my best ability and I think the interviewer was also satisfied with them. In a couple of days I got the email for the  HR round.

Round 5 – HR Interview

The HR round lasted around 30 minutes. My interviewer was a senior member of the company. He introduced himself and asked for my introduction. Then he spoke a bit about the company and the profile. He also asked me about my experience so far. Questions:-

  • How has your experience been so far? Which of the rounds did you enjoy the most?
  • What is your expectation from this job?
  • Do you think you are overqualified for this position?
  • What salary are you looking for?
  • Will you be willing to work nights and weekends?
  • Do you have any questions for me?

I asked the interviewer about his experience in the company and in the corporate world itself. He answered my question. He wished me luck and disconnected the call. After about a week, I got the selection email.

Question 1

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.

Note that:

Ratan never goes into loss.

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

11

2

Sample Output

  10

 Explanation

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

Run
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;
    }
}

Run
#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;
}

Question 2

Problem Statement:

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 

 

Run
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"); 

}
}

Run
#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;
}

Question 3

Problem Statement:

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 the quotation marks.

 

Constraints:

Number of character 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

 

Run
#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";
}

Run
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")
 

Question 4

Raman was playing a game,  he starts with x coins. Now in every step, he wins and loses and he has to get the money or pay the money as needed. He came in contact with a psychic who can see the future and the Psychic predicted the outcomes after each step. Now Raman wants to start the game with the minimum wage where he doesn’t run out of money.  Help Raman to find what money he should start with. The only rule to keep playing is not going in a credit situation.

 

Input Format:

First line with n, number of steps in the game

Next n lines, n integers denoting outcomes of every game. Positive means winning and negative means losing that money.

Output Format:

One single integer denoting the minimum amount to start with

Constraints:

Number of steps<=10^9

-1000<=Money needed in each step<=1000

Sample Input:

4

2

-9

15

2

Sample Output:

7

Explanation:

If he starts with 7 rupees, then after steps : 7 ->9 -> 0-> 15 -> 17.

Run
#include <iostream>
using namespace std;
 
int main() {
    int n; cin>>n;
    int a[n];
    for(int i=0;i>a[i];
    int sum=0,ans=0;
    for(int i=0;i < n;i++)
    {
        sum+=a[i];
        if(sum < 1 )
        {
            sum=-sum;
            ans+=sum;
            sum=0;
        }
    }
    cout << ans << endl;
}

Run
n=int(input())
arr=[]
for i in range(n):
    arr.append(int(input()))
s,a=0,0
for i in arr:
    s=s+i   
    if(s<1):
        a=a+(-1*s) 
        s=0 
print(a)
Run
import java.util.*;
public class MinimumStart
{
  public static void main(String[] args)
{
   Scanner sc=new Scanner(System.in);
   int n=sc.nextInt();
  int arr[]=new int[n];
  
  for(int i=0;i < n;i++) 
   arr[i]=sc.nextInt();
    int sum=0,ans=0;
    for(int i=0;i < n;i++)
    {
        sum+=arr[i];
        if(sum<1)
        {
            sum=-sum;
            ans+=sum+1;
            sum=1;
        }
    }
  System.out.println(ans);
}
}

 Question 5

Problem Statement :

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]

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

Run
#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>q;arr.push_back(q);}
    for(int i=0;i < n;i++)
    {
       ans=max(ans,func(i,i+x-1));
    }
    cout << ans;
}



Run
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)

Run
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);
}
}

Get over 150+ course One Subscription

Courses like AI/ML, Cloud Computing, Ethical Hacking, C, C++, Java, Python, DSA (All Languages), Competitive Coding (All Languages), TCS, Infosys, Wipro, Amazon, DBMS, SQL and others

Checkout list of all the video courses in PrepInsta Prime Subscription

Checkout list of all the video courses in PrepInsta Prime Subscription

ZOHO ADVANCED CODING BASED FAQ's​

Question : Why ZOHO prefers Round for Advanced Coding?

Answer- ZOHO Prefers this Advanced Coding Round to check students ability to programmes as they hire students for the post of software developer.

Question : What is the difficulty of Advanced Coding Round?

Answer-Advance Coding Round is quite tough so you need to prepare well.

Question :Are students with backlogs eligible for Zoho placement drive?

Answer : Yes students with backlogs are eligible.

Question: Which is the major topic I need to focus for Zoho placement drive?

Answer : The important topic you need to focus is programming. Most of the questions asked in Zoho drive are from programming.