Basic Coding

The following are some exercises in basic coding. As mentioned in the github repo, don’t use an IDE and start from scratch.

reverse a string
check if an int is a bit palendrome
check if a string is an anagram of another string
write fibo sequence
convert 3 8 bit numbers (RGB) to hex
read file line by line (and char, by char)
print out a a multiplication table
render a maze given a n x m values
is a number a twos compliment (?)
capitalize the first letter of a sentence given a para of text
write code that will result in a deadlock. fix it
find duplicate numbers in an array
convert decimals to binary
rotate a multi-dimensional array
reverse a number
parse a String representation of a number into an int or float
pack an IPV4 address into an int (or long in Java)

print the sum of ints in a file one line at a time

check that the bit values of an int are a palindrome

compute nth fibonacci number
. recursion
static long fib(int n) {
return n <= 1 ? n : fib(n-1) + fib(n-2);
}

Sample code problems:

Top 10 Algorithms for Coding Interview

. In java:
. Output a series of numbers from one to n with a newline in between,
using only one println, without using the newline char and not it a loop:
. Recursion is the key to this one with only one printf

. Implement a merge sort
. Take a series of sentences, all lower case and capitalize the first character of each sentence
. Roman numeral parser
. Anagram checker
. Binary palindrome checker
. Reverse a string:
. iteratively
. recursively
. Determine if a String is a palindrome or not, using API and not using API
2) Write a method which will remove any given character from a String?
3) Print all permutation of String both iterative and Recursive way?
. http://chinmaylokesh.wordpress.com/2011/01/19/algorithm-to-find-all-permutations-of-a-string/
4) Write a function to find out longest palindrome in a given string?

. In an array 1-100 numbers are stored, one number is missing how do you find it?
. In an array 1-100 exactly one number is duplicate how do you find it?
. In an array 1-100 many numbers are duplicates, how do you find it?

. Given two arrays, 1,2,3,4,5 and 2,3,1,0,5 find which number is not present in
the second array.

. How do you find second highest number in an integer array?

Java Specific

file io

synchronization

    . Output a series of numbers from one to n with a newline in between,

In Java: Output a series of numbers from one to n with a newline in between, using only one println, without using the newline char and not it a loop:
. Recursion is the key to this one with only one printf