getjar.com/todotasklist my android app
BAN USER
I am a person with balanced personality, hard working, positive attitude, optimist.
KAMLESH KUMAR YADAV Contact Details:
Mo Nawagarhi, Bahraich
Uttar Pradesh -271801
E-Mail:kamleshlu2009@gmail.com
Contact No: +91 9718202184
Career Objective :
To attain a position in the Industry by excelling Analytical, Technical, Managerial and
Interpersonal skills.
Educational Qualification
• MCA (Master of Computer Application) Department of Computer Science
University of Delhi 72.2% Year 2009-12
• BCA(Bachelor of Computer Application) Department of Computer Science
University of Lucknow 66.2% Year : 2006-09
• 10+2 CBSE 76.8% Year 2006
• 10th CBSE 87.4% Year 2004 (Topped in School)
Software Proficiency:
• Languages : C, C++, Java ( Core) with Data Structures
• Software Packages : Netbeans, Eclipse, Dev C++
• DBMS Packages : Oracle 10 g
• Operating Systems : Windows(XP,Vista,7), Linux
Academic Projects :
• Design and Analysis of a new technique for Searching on Encrypted data :
Designed a new technique using Bloom Filter for Searching on Encrypted data and reduced the complexity from O(N) to constant order.(Individual project)
(Language Used : Java Encryption Technique : AES with 128 bit key )
• Simulation of the Unix Shell in C : (Individual Project)
• Implementation of Chat Server in JAVA. (Group project)
• Implementation of a two pass assembler in C: (Group Project)
• Implementation of UNIX File System in C++. (Group project)
Independent Projects:
• Implementation of Malloc, Calloc and Free functions in C.
• Implementation of Producer Consumer Problem in C++.
Technical Papers/Posters :
• Presented poster on “Social Network Analysis” at IBM Research Center New Delhi
on 26 October 2009 .
• Technical Research Paper entitled “Searching on Encrypted Data Using Bloom Filter ”
accepted by IBM Research India and also presented poster at IBM Research
Center Banglore on 22 October 2010 .
Awards and Achievements :
Special Achievement : Awarded by “Best C++ Programmer” by Bharti Vidyapeeth University Delhi.
• Figured in the top ten in Long Term Programming(LTP) contest organized by
IIT Roorkee.
• 1st prize : JAVA programming in TECHNOPHILIA 2011, the Annual Technical Fest at Jawahar Lal Nehru University Delhi.
• 1st Prize : Blind Coding(C/C++ Programming) in TECHNOPHILIA 2011, the Annual Technical Fest at Jawahar Lal Nehru University Delhi.
• 1st prize: On The spot Programming in NERDZ 2011, the Annual Technical Fest of Jamia Humderd University Delhi .
• 1st prize: Dark Coding(C/C++) in NERDZ 2011, the Annual Technical Fest of Jamia Humderd University Delhi .
• 1st prize : C/C++ programming in TATVA 2011 the annual IT Fest of Lal Bahadur Shastri Institute of Technology, IP University ,Delhi.
• 1st prize : C/C++ programming in ASC 2011 the IT Fest of Bharti Vidyapeeth.
• 1st prize : C/C++ programming in ASC 2010 the IT Fest of Bharti Vidyapeeth.
• 2nd Prize : JAVA Programming in NERDZ 2009, at Jamia Humderd University.
.
Leadership Skills And Extra Curricular Activities:
• Placement Coordinator, currently taking charge as “Placement Coordinator” of
Department of Computer Science, University of Delhi.
• School Captain , Jawahar Navodaya Vidyalaya Bahraich ,while in Class 12th and also
awarded by “Next Generation Leader” award for excellent work as School captain.
• Head Coordinator , Technical Activities of Department of Computer Science,University
of Lucknow during 3rd year of graduation.
• Team Leader of a team of 7 people who won 1st Rank during 2 days of Technical Fest
at Jawahar Lal Nehru University and 2nd RANK at Jamia Humderd University.
• Team Leader of the team who Coordinated “JAVA Programming” and “C/C++
Programming” event in Sankalan 2011, the Annual Technical Fest of Delhi University.
- 0of 0 votes
Answersgiven a NxM matrix , where each array entry is a character, we need to find all the valid words that can be formed using elements in a row, column and diagonal. like crosswords puzzle.
- getjar.com/todotasklist my android app in India
We are given a dictionary and a function
boolean isValid(String word)
which returns whether the word passes to this function is valid dictionary word or not.| Report Duplicate | Flag | PURGE
Amazon Software Engineer / Developer - 0of 0 votes
Answersgiven an integer find the next(smallest number greater than given number) integer which is palendrom
- getjar.com/todotasklist my android app in India
for ex 111 next palendrom 121
301 next palendrom 313| Report Duplicate | Flag | PURGE
Amazon Software Engineer / Developer Algorithm - 0of 0 votes
Answersgiven a village with demons and a sleeping man, The man is always sleeping ,never wakes up. Now a demon can eat the sleeping man , but after that
- getjar.com/todotasklist my android app in -
he will fall asleep , any demon can eat another sleeping demon.
If demons are very smart and would always choose to stay alive than to eat the man and risk their lives.
so if initially there are 65 demons and 1 sleeping man ,, what would happen in the village ???| Report Duplicate | Flag | PURGE
Brain Teasers - 0of 0 votes
AnswersGiven a sorted array of Infinite size, find an element ‘K’ in the array without using extra memory in O (lgn) time. (Remember the array size is infinite that is no upper bound
- getjar.com/todotasklist my android app in India| Report Duplicate | Flag | PURGE
Amazon Software Engineer / Developer Algorithm - 0of 0 votes
AnswersA person can climb stairs in 3 ways: Either a single stair at a time or 2 steps together or 3 steps at a time. So, if you have total N stairs give a recurrence relation to solve the above proble
- getjar.com/todotasklist my android app in -| Report Duplicate | Flag | PURGE
Amazon Software Engineer / Developer Algorithm - 0of 0 votes
Answershow compiler generates unique names for overloaded functions, if two functions have same name and same parameters but differnt return type , can it be possible i said no he asked why . i explained about the name mangling and showed that return type does not play any role in name mangling.
- getjar.com/todotasklist my android app in -| Report Duplicate | Flag | PURGE
Samsung Software Engineer / Developer C++ - 0of 0 votes
Answersgiven a expresion
- getjar.com/todotasklist my android app in India
2*3+5-3 it consisitof 3 opertors(+,-,*),but they can occur more than time.
we have to maximise the vlaue of expression by adding parathesis
like 2*3+5-3=8 no paranthesis
2*(3+5)-3=13
2*(3+5-3)=10
and so on maximise it with differnt possible parathesis| Report Duplicate | Flag | PURGE
Microsoft Software Engineer / Developer - 0of 0 votes
Answersan interseting problem
- getjar.com/todotasklist my android app in -
for a fibonacci series
the recurrence relation is
t(n)=t(n-1)+t(n-2)+O(1)
on solving it gives upper bound of O(n^2)
but when draw tree for the recurcsion we see that it is growing exponentially giving a complexity of O(2^n).
so what is the complexity for fibonaacci series n^2 or 2^n| Report Duplicate | Flag | PURGE
Amazon Software Engineer / Developer Algorithm - 0of 0 votes
Answersgiven a set of integers [6,8,41,36,58,69]
- getjar.com/todotasklist my android app in -
is there any way with time complexity better than 2^n to find 1 subset whose sum is equal to a given sum.
for eg:sum 49 ans 8,41
sum 105 ans 6 ,41 58| Report Duplicate | Flag | PURGE
Amazon Software Engineer / Developer - 0of 0 votes
Answersgiven two arrays [5 6 2 8 1] or [4 7 9 2 4]...such arrays are given, you have to find
- getjar.com/todotasklist my android app in -
possible pairs where sum of numbers in both arrays of a pair is equal....eg
for the first case it will be [5 6] and [2 8 1]
write a program to implement this| Report Duplicate | Flag | PURGE
Amazon Software Engineer / Developer Algorithm - 0of 0 votes
Answersgiven a matrix with all 1,s or 0,s. find the square sunmatrix with all 1's at border.
- getjar.com/todotasklist my android app
ex:
0 1 0 1 0 1 1 1
0 1 1 1 1 1 1 0
1 1 0 1 1 0 1 1
0 1 0 0 1 0 1 0
0 1 1 1 1 1 1 1
so the submatrix from (1,1)to (4,6) is the answer
see it is not square but i have just wriiten to make it clear the ques .
given matrix will bee square matrix and we have find square submatrix as well| Report Duplicate | Flag | PURGE
Software Engineer / Developer - 0of 0 votes
AnswersThere is an array and the distance between any two consequent elements is one(+1 or -1) and given a number. You have to check whether the number is in array or not with minimum complexity.
- getjar.com/todotasklist my android app| Report Duplicate | Flag | PURGE
Software Engineer / Developer - 0of 0 votes
Answersgiven an infinite array containing only 0's and 1's in sorted manner. Give algo to find the position where first 1 appeared with minimum complexity (Interviewer gave hint to use random number generator algo, don't know why).
- getjar.com/todotasklist my android app| Report Duplicate | Flag | PURGE
Software Engineer / Developer Algorithm
1 Answer need advice i am a fresher. ...
need advice
- getjar.com/todotasklist my android app September 15, 2011
i am a fresher.
in interview if we get a question which i already know what should i do.
should i tell that i know the question or i have already solved.
the problem is the person who is regularly visting careercup may get many questions that r reapeated so to do there.
experinced people pls answer pls answer| Flag | PURGE
void arrange(int a[],int n)
{
int i=n-1,zero=n-1;
for(;i>=0;)
{
if(a[i]==0)
{
i--;
}
else
{
int t=a[i];
a[i]=0;
a[zero]=t;
zero--;
i--;
}
}
}
void arrange(int a[],int n)
{
int i=n-1,zero=n-1;
for(;i>=0;)
{
if(a[i]==0)
{
i--;
}
else
{
int t=a[i];
a[i]=0;
a[zero]=t;
zero--;
i--;
}
}
}
try for 5
5
4 3
3 2 2 1
2 1
there are 5 leaf nodes
but the answer will be 8
here is the sanpshot of my output for 5
1 1 1 1 1
1 1 1 2
1 1 2 1
1 2 1 1
1 2 2
2 1 1 1
2 1 2
2 2 1
Number of Paths :8Press any key to continue . . .
if i m missing something
array given in the question is wrong
correct one is
4 5 10 7 12 13
o/p:
1 3 4 9
here is the recursive code
#include <cstdlib>
#include <iostream>
using namespace std;
/* Function to swap values at two pointers */
void swap (char *x, char *y)
{
char temp;
temp = *x;
*x = *y;
*y = temp;
}
void permute(char *a, int i, int n)
{
int j;
if (i == n)
printf("%s\n", a);
else
{
for (j = i; j <= n; j++)
{
if (a[i] == a[j] && i != j)
continue;
swap((a+i), (a+j));
permute(a, i+1, n);
swap((a+i), (a+j)); //backtrack
}
}
}
int main(int argc, char *argv[])
{
char a[] = "ABC";
permute(a, 0, 2);
system("PAUSE");
return EXIT_SUCCESS;
}
node CA(Node root,int key[])
{
if(root==null)
return null;
int i ;
for(i=0;i<key.length;i++)
{
if(!contain(root.left,key[i])
break;
}
if(i==key.length)
return CA(root.left,key);
int j ;
for(j=0;j<key.length;j++)
{
if(!contain(root.right,key[j])
break;
}
if(j==key.length)
return CA(root.right,key);
return node;
}
boolean contain(Node root,int key)
{
if(root==null)
return false;
if(root.data==key)
return true;
return (contain(root.left,key)||contain(root.right,key));
}
suppose the tree is
1
2 4
3 5
5 is the right child of 2
now keys are 3 , 4 ,5
a/c to ur solution min is 3 and max is 5 so the CA should be 2
but CA should be 1
m i missing something
void mirror(TreeNode root)
{
if(root==null)
return;
TreeNode temp=root.left;
root.left=root.right;
root.right=temp;
mirror(root.left);
mirror(root.right);
}
here is the solution which prints number of paths as well as each path.
at every step we have to choices either take 1 step or take 2 step.
#include <cstdlib>
#include <iostream>
using namespace std;
int path(int a[],int index,int sum,int n)
{
static int count=0;
if(sum==n)
{
cout<<"\n";
for(int i=0;i<index;i++)
cout<<a[i]<<" ";
count++;
return 0;
}
if(sum>n)
return 0;
for(int i=1;i<=2;i++)
{
a[index]=i;
path(a,index+1,sum+i,n);
}
return count;
}
int main(int argc, char *argv[])
{
int n=8;
int *a=new int[n];
cout<<"\nNumber of Paths :"<<path(a,0,0,n);
free(a);
system("PAUSE");
return EXIT_SUCCESS;
}
I write this in java
public class Main {
static int sets [][]={{1,2},{3,4},{5,6,7}};
static int count=0;
public static void main(String[] args)
{
// TODO code application logic here
int a[]=new int[sets.length];
crossProduct(a,0, sets.length);
System.out.print("\n\nTotal Products "+count);
}
static void crossProduct(int[]a,int index,int n)
{
if(index==n)
{
System.out.print("\n");
count++;
for(int i=0;i<a.length;i++)
System.out.print(a[i]+" ");
return;
}
for(int j=0;j<sets[index].length;j++)
{
a[index]=sets[index][j];
crossProduct(a,index+1,n);
}
}
}
we can modify the binary search
int find(int a[],int n)
{
int low=0,up=n;
int mid;
while(low<=up)
{
mid=(up+low)/2;
if(a[mid]>a[mid-1]&&a[mid]>a[mid+1])
return a[mid];
else if(a[mid]>a[mid-1]&&a[mid]<a[mid+1])
low=mid+1;
else if(a[mid]<a[mid-1]&&a[mid]>a[mid+1])
up=mid-1;
}
}
what about the following input.
51 ,517 answer should be 51751 (517+51)
56,563 answer should be 56563 (56+563)
how the radix will work here .
void encrypt(char str[])
{
char h=find(str);
cout<<"highst occuring character is "<<h<<"\n";
int dif='e'-h;
for(int i=0;i<strlen(str);i++)
{
int d=str[i]-97+dif;
if(d<=0)
str[i]=(d+26)%26+97;
if(d>0)
str[i]=d%26+97;
cout<<d;
}
}
char find(char str[])
{
int a[26]={0};
for(int i=0;i<strlen(str);i++)
a[str[i]-97]++;
int max=a[0];
int maxi=0;
for(int i=1;i<26;i++)
if(max<a[i])
{
max=a[i];
maxi=i;
}
return maxi+97;
}
in this questions i would like to ask the interviewer about the type of keys and values and what operations are required.
then i will suggest the data structure.
in this questions i would like to ask the interviewer about the type of keys and values and what operations are required.
then i will suggest the data structure.
here is the code
logic is
1: traverse the array
2:if found 1 do nothing
2: if found 0 , swap it with 1 ( on left side)
3: if found 2 swap it with last. decrement last.
void swap(int a[],int first,int second)
{
int temp;
temp=a[first];
a[first]=a[second];
a[second]=temp;
}
void arrange(int a[],int size)
{
int zero=0,one=0,two=size-1;
while(one<=two)
{
switch(a[one])
{
case 0:
swap(a,zero,one);
zero++;
one++;
break;
case 1:
one++;
break;
case 2:
swap(a,one,two);
two--;
break;
}
}
}
here is the solution using backtracking
1: fix the 1st character and swap the others
and so on
/* Function to swap values at two pointers */
void swap (char *x, char *y)
{
char temp;
temp = *x;
*x = *y;
*y = temp;
}
void permute(char *a, int i, int n)
{
int j;
if (i == n)
printf("%s\n", a);
else
{
for (j = i; j <= n; j++)
{
if (a[i] == a[j] && i != j)// take care of duplicate characters
continue;
swap((a+i), (a+j));
permute(a, i+1, n);
swap((a+i), (a+j)); //backtrack
}
}
}
see the code carefully , it is easy to understand.
- getjar.com/todotasklist my android app December 07, 2011B++ tree is best data structure for range queries , since values are stored in leaves only in sorted fashion.And each leave has pointer to next leaf node(with higher value). so accessing is also efficient.
- getjar.com/todotasklist my android app December 07, 2011here is the correct code , i just forget to include the print statemnt
printNodes(Node root,int m,int n)
{
if(root==null)
return;
if(root.data>=m&&root.data<=n)
print(root.data);
if(m<root.data)
printNode(root.left,m,n);
if(n>root.data)
printNode(root.right,m,n);
}
code for permutation using backtracking
void permute(char *a, int i, int n)
{
int j;
if (i == n)
printf("%s\n", a);
else
{
for (j = i; j <= n; j++)
{
if (a[i] == a[j] && i != j)
continue;
swap((a+i), (a+j));
permute(a, i+1, n);
swap((a+i), (a+j)); //backtrack
}
}
}
here is the code
printNodes(Node root,int m,int n)
{
if(root==null)
return;
if(n<root.data)
printNode(root.left,m,n);
if(m>root.data)
printNode(root.right,m,n);
}
we cant do this because of main memory constraint
- getjar.com/todotasklist my android app December 06, 2011we have to just count the number of 1's (set bits) at even position and number of 1's (set bits) at odd position .
if((number of 1's at even position - number of 1's at odd position)%3==0)
then number is divisible by 3.
make a prefix tree
each leaf will have the corresponding character
for 2 =a
22 =b
222 =c
make a trie of 2, 22 ,222
and so on make trie of 3,33,333 .... 9,99,999
onc we made trie , we can easily decode the given sequence.
your approach is correct . but i dont think that interviewer want this approach, i mean it straight forward.
- getjar.com/todotasklist my android app November 22, 2011the program will definitely compile, but the behaviour is undefined. why here is the reason.
declaration int a[10] // it allocates 40 bytes and suppose 1000 is the starting address.
a[-1]=10 // access memory location 996 and put 10 at this location.
but we are not sure whether 996 memory location is read only ,part of stack, part of code segment.
if it is read only,part of stack or part of code segment, then surely we will get error like segmentation fault or access violation.
there is no memory leak, we will get memory access violation and sometime segmentation fault. so overall result will e unpredicatble.
- getjar.com/todotasklist my android app November 22, 2011nice approach
- getjar.com/todotasklist my android app November 19, 2011take three pointers one, two and three.
first of all search for a 1 and move( delete from current) it to head (if 1 is already at head then omit this step)
now traverse the list starting from 2nd node
if found 1 delete it and move it to the head (update the head also)
if found 2 dont do anything just move to nect node.
if found 3 move it to last .
dude
you should read the pointers first and then try with linkedlist because they require knowledge of pointers.
this approach will give a palendrom but not the next palendrom
for Ex 103 when we increment left till it become equal to right. it becomes 303
bot ans should be 111
yes trie will cost a lot of space I just given an approach.
- getjar.com/todotasklist my android app November 18, 2011we can use trie
make a trie of the strings of 1st array
now traverse the 2nd array and check whether string is present it trie or not.
but i think hashing will be better option.
oh sorry right
for 301, next palindrome is 303, not 313.
thanks anon
use a set
put the product ids starting with b
set doesnt allows duplicate elements
we have to fine the time interval in which all members are free
for ex 1 M1 - 8-11
m2 - 12-15
m3 - 15-18 office time is 8 to 18
have an array consisting elements 8 9 10 11 12 13 14 15 16 17 (not 18)
and now cross the hours in which any of the member is busy
here m1 8 - 11 so cross out 8 9 10 (not 11 bcoz he is free from 11)
m2 12 -15 so cross out 12 13 14 (not 15)
m3 15 - 18 so cross out 15 16 17
now find n consecutive hours which are not crossed here 11 is not crossed so we can schedule the meeting from 11 to 12
i have not done exhausted testing please check it out.
this is similar rat in maze problem . the only difference is that we have to find all the paths and find cast of the path . choose the path having minimum cast .
@ eugene.yarovoi
yeh your approach is similar to rat in maze .
in both approaches we have have to traverse recursively something like
path(i,j+1)
path(i-1,j-1)
path(i-1,j)
the reason is explained above
- getjar.com/todotasklist my android app November 08, 2011@ eugene.yarovoi
that is the side effects of macros we must take care of side effects of macros
any way it is correct
it should be char* sorry for mistake
@anonymous char* is necessary
becoz see here
int *p; // suppose p points to 100th memory location
when we do something like
(p+1)-(p)//(104-100)
but this expression will not give 4 but it give 1
becoz p is a pointer to an integer and such expressions tells how many elements are there in between (p+1) and p
when we typecast
char*(p+1)-(char*)p pointer p is converted in char*
(104)-(100) which is equals to 4 which is the size of int
hope that it is now clear to you dear.
use back tracking
for ex string ABC
first
keep A (first letter constant) and chane others
ABC cange 2n letter
ACB
change the first letter
BAC
BCA
and so on
here is the code
/* Function to swap values at two pointers */
void swap (char *x, char *y)
{
char temp;
temp = *x;
*x = *y;
*y = temp;
}
void permute(char *a, int i, int n)
{
int j;
if (i == n)
printf("%s\n", a);
else
{
for (j = i; j <= n; j++)
{
if (a[i] == a[j] && i != j)
continue;
swap((a+i), (a+j));
permute(a, i+1, n);
swap((a+i), (a+j)); //backtrack
}
}
@ Anonymous
at least check your approach with 1 or 2 examples before posting here.
Totally absurd and wrong.
@ varun
i think it is wrong it will always give 1.
it should be
#define sizeof(data)
{data *p=0; size = (char)(p+1) - (char)p }
although the solution posted by puneet (nicely explained by olnrao) is correct.
but getting unique elements requires extra space if using hashing or O(nlogn) if sort and then find unique elemnts.
solution with O(N) time complexity with constant space seems not possible any thoughts
I dont think the solution is correct
consider the matrix
1 5 9 12
6 12 16 18
7 16 17 20
8 18 20 25
answer should be 16
but with this approach it is 17
for hexadecimals need special care
- getjar.com/todotasklist my android app November 06, 2011do like this
have a loop
int sum=0
iterate
sum=sum*base+str[i]-'0';
where base is the given base
wrong solution , it is correct for only ur input
consider this
{1,2,4,3,4,3,3,5}
unique elements are 1,2,3,4,5
answer should be 4
but with ur solution it is 1 (the XOR of 1,2,3,4,5 is 1)
Reprichardcstrong, Accountant at AppPerfect
I am a modern magician, except I transform complicated technical ideas into user-friendly images before the eyes of your company ...
RepMarryJohan, Consultant at ASAPInfosystemsPvtLtd
I am successfully manage and coordinate graphic design projects from concept through completion. Create and conduct highly persuasive sales and ...
Repkalerkant98, abc at ADP
I am DennisRue, seeking an entry level position where my strong work ethics and ability to learn quickly will contribute ...
Repmariacbrister, Graphics Programmer at Graphic Systems
Hey, I am Maria and I am from Bluefield. Currently, I work as a freelancer graphic artist. From an early ...
RepMariaHobbs, Consultant at Adobe
Hi, I am Maria Hobbs from NewYork.Teach career development courses for designated areas. Develop, evaluate and revise course materials ...
Repashleymbosse, Associate at Accenture
I am an enthusiastic, hard-working and disciplined Catering Assistant with excellent track-record in working in the food industry. I am ...
I also thought the same O(NlogN)
- getjar.com/todotasklist my android app April 19, 2012