Skip to main content

Zoho Written Test new pattern and Questions

Today I attended the zoho written test in chennai. They have changed the written test pattern. Usually I expect a booklet of questions from them. But today I got a single question paper. It has 5 simple programming questions. We asked to write a program for those questions.

They are very simple questions.
We can choose whatever language we want.
We are not allowed to use any collections. like ArrayList, Hashmap, string functions.
Inputs can be hard coded.
We can use print statements.
We have to cover most of the use cases.

These are the questions asked today.

1. Print the sum all the numbers in a given array
example:    2  4   output: 8
                  -1 3
2. Print the count of non-continuous vowels in a given string:
example: 1) Welcome - output - 3
                2) wood - output - 0

3. Count the number of 0's in the 8-bit representation of the given number:
example: 1) 3 - 0000 0011 - output - 2
                2) 23 - 0001 0111 - output - 4

4. Print the value in a array if it is a odd number and if it is in a odd index position.
example: 1) [2,5,3,7] - output 5,7

5. Given two unsorted arrays. Merge those two arrays in a single sorted array.
example:) [5,2] [6,1,3] - output [1,2,3,5,6]

Comments

Popular posts from this blog

ARP/RARP full simulation program

server.c #include "stdio.h" #include "stdlib.h" #include "string.h" #include "sys/types.h" #include "sys/socket.h" #include "arpa/inet.h" #include "netinet/in.h" #define SA struct sockaddr struct IPmac { char ip[100]; char mac[100]; }; int main() { int sockfd,len,i; struct sockaddr_in servaddr; char buff[30],temp[30],ip[30],mac[30];

Given a string, reverse only vowels in it; leaving rest of the string as it is

/* Given a string, reverse only vowels in it; leaving rest of the string as it is. Input : abcdef Output : ebcdaf */ import java.io.*; import java.util.*; public class VowelReverse { public static void main(String[] args) { Scanner sc = new Scanner(System.in); String str = sc.next(); String vowels = ""; String ans = ""; int arr[] = new int[str.length()]; for(int i=0;i<str.length();i++) { if(str.charAt(i)=='a' || str.charAt(i)=='e' || str.charAt(i)=='i' || str.charAt(i)=='o' || str.charAt(i)=='u') { vowels+=str.charAt(i); arr[i]=1; } } String revVowels = new StringBuffer(vowels).reverse().toString(); int j=0; for(int i=0;i<str.length();i++) { if(arr[i]!=1) { ans+=str.charAt(i); } else { ans+=revVowels.charAt(j); j++; } } System.out.println(ans); } }

Configure opendns in ubuntu 12.04

Today i have changed my dns server name to opendns. which is alternative to default dns and it provide more secure, faster browsing experience. What is opendns? OpenDNS is the leading provider of Internet security and DNS services Industry leading malware and botnet protection Award winning Web filtering Faster, reliable, more secure DNS Ultra-reliable, globally distributed cloud network Simple, Smart, Easy How to configure opendns in ubuntu 12.04: open terminal and type sudo nano /etc/resolv.conf enter your password and change these lines   nameserver 208.67.222.222  nameserver 208.67.220.220 to use google public dns use 8.8.8.8, 8.8.4.4 instead of 208.67.222.222, 208.67.220.220 simple isn't..! now see your facebook load faster than before. opendns comes with parental control, so never worry about unwanted websites, and your childrens are safe now. to check your dns changed successfully goto welcome.opendns.com