Skip to main content

Posts

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) W e lc o m e - 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. Pr
Recent posts

Determine whether a given number can be expressed as sum of two prime numbers or not

/* Write a program to determine whether a given number can be expressed as sum of two prime numbers or not. For example 34 can be expressed as sum of two prime numbers but 23 cannot be. */ import java.util.*; import java.io.*; public class SumOfTwoPrime { public static void Primer(int num) { ArrayList<Integer> ar = new ArrayList<Integer>(); boolean flag=false; int prevPrime = 1; for(int i=1;i<=num;i++) { for(int j=2;j<i;j++) { if(i%j==0) { flag=false; break; } else flag=true; } if(flag==true) { ar.add(i); } } for(int i=0;i<ar.size();i++) { for(int j=0;j<ar.size();j++) { if( (ar.get(i))+(ar.get(j)) == num ) System.out.println(num+" is sum of two primes "+ar.get(i)+" and "+ar.get(j)); } } }   public static void main(String args[]) {   Scanner sc = new Scanner(System.in);   int n = sc.nextInt();   Primer(n);   } }

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

Making android apps easily within minutes

Hiii, I haven't been here for a while, after a long time i'm visiting my own blog 😀. Scan this QR code to download the app It has been changed a lot. Peoples are moving towards video blogs. Some peoples really don't have time to read a blogs. But I was really enjoyed writing since I started to blog. And I would like to share a lot with you friends. I will try to post at least one post per week 😂. I changed my blog name from mani-g to techfuu . And let's hope the numerology will help us to post frequently. 😇 Today we are going to see one amazing site that can help us to make our site content into an Android app. Interesting isn't. Within a few minutes we can get our android app ready to be published in google playstore. visit:  appsgeyser.com link to the app: http://app.appsgeyser.com/5083322/Tech%20fu register there and give your site url. Within few minutes it will send the apk with source code to our mail. To publish our app to google pla

speeding up and saving data in chrome browser

Here in India we don't afford an unlimited internet plan or high speed internet(mostly). I came through some awesome chrome extensions to the rescue. I checked most of the extension they work seamlessly in my chrome browser in ubuntu 14.04. If you're using windows you can consider an awesome ucbrowser that forked from chromium web browser. that support all the extensions of google chrome browser. we can grab it from  pc.ucweb.com . It as its own cloud compression technology known as speedmode that can reduce the data transmitted over internet. Check it yourself. So, here are the chrome extensions used to reduce internet data. 1. Google data saver extension: You may seen this on your android devices, and now it's available for pc version of chrome. It uses the google's own server to optimize the pages that we request. It will not work with SSL or HTTPS sites. and it works damn nice with ordinary sites. grab it here:  data-saver-beta  and it's currently a bet

First Graphic program in C

Current semester i have a Computer Graphics as a subject. Here is my first program that implements the bresenham's circle drawing algorithm to draw a circle and with some lines i created a smiley : ) #include "stdio.h" #include "graphics.h" void brecircle(xc,yc,r) { int x,y,p; x=0; y=r; putpixel(xc+x,yc-y,1); p=3-(2*r); for(x=0;x<=y;x++) { if (p<0) { y=y; p=(p+(4*x)+6); } else { y=y-1; p=p+((4*(x-y)+10)); } putpixel(xc+x,yc-y,15); putpixel(xc-x,yc-y,15); putpixel(xc+x,yc+y,15); putpixel(xc-x,yc+y,15); putpixel(xc+y,yc-x,15); putpixel(xc-y,yc-x,15); putpixel(xc+y,yc+x,15); putpixel(xc-y,yc+x,15); } } int main() { int x,y; int gd = DETECT, gm=0; initgraph(&gd,&gm,""); x=getmaxx()/2; y=getmaxy()/2; brecircle(x,y,150); brecircle(x-50,y-50,19); brecircle(x+50,y-50,19); line(x,y,x+20,y+20); line(x,y,x-20,y+20); line(x-20,y+20,x+20,y+20); line(x-40,y+50,x+40,y+50); getch(); closegraph(); return 0; }

wordpuzzle solver

Most of the *nix systems contains the wordlist. This script will use that wordlist to search the words for the given pattern. #!/usr/bin/python import re import sys if len(sys.argv[:]) != 2: print "usage: ./puzzle.py 'pattern'" exit(0) pattern = sys.argv[1] length = len(pattern) pattern = pattern.replace('?','\w') words = open('/usr/share/dict/words','r') print '' for word in words: if len(word)== int(length)+1 and re.search(pattern,word): print word.strip() Also made a gui for that application You can get the full source code for this app in  https://github.com/manimaran990/wordpuzzle