DATA STRUCTURE 1. Question of Binary search tree to find node when 43 will not be found Ans= Every data set was having 43 as its last element. 2 . To find complexity of Linked li st .Singly circular ordered list is there if m elements a re to be inserted what will be the complexity of time. i. O(m*n). ii. O(m*(m+n)). iii. O((m+n)*log(m+n)) 3. Adjacency matrix question to find shortest path Ans=7. ABCDE A0m Bm022m C05 D06 E0 Where m=infinity, Find shortest path from B to E. 4. Forest & Tree question to fin d total no of nodes 1 n-(p+2) ANS 2. n-p+2. 3. n-p. etc same question is in Sahni I think go thru it. 5. Infix to Postfix expression Of A+B*(C+D)/E+F {ANS=ABCD+*E/+F+ } question is not confirm but pattern is of same type DBMS 1. Query from Navathe Select fname,lname from employee where eno in (select eno from works-on where pno=(select * from project)); what is the output . 2. A query is given eg. Sel ect name from employee where salary=salary. They ask wh ether query runs or not so just check it. Ans=Query Invalid 3. What is the main use of B & B+ trees i n database Ans= For queries 4. question on Left outer Join & Full outer Join. For both Variables are given & in options relationship is given to find whichever have greater tuples. 5. To save space which option is better . Options are i. Write all j oin operation than select than project. ii. Write all join operation than project than select. iii. Write all j oin operation in between select & project. OS 1. Using LRU how many page faults ar e generated. 20 pages are there Ans=6 page faul t 2. match the column Options i. semaphore i ii. Monitor ii iii. Deadlock iii iv. Mutual Exclusion iv. Iv 3. One question on fil e locking. Scenario is given Ans 1. Provide indefinite locking 4. Prevent intermediate file Access. (Both 1 & 2) 5. If there are n processes & each process waits p time in waiting state then CPU utilization is (options are) 1. n(1-p)
2. 3. 4. 5.
(1-p to the power n) ANS (not sure) 1-np. n*p A critical section is Ans = a set of in struction which is shared by many process.
General 1. Probability to find digits which not contain 7 between 100 to 999 Ans=18/25 2. Packet switching & Ci rcuit Switching some diff are there Ans= CS take more time to established circuit. 3. A file have 3 bits for char such type of question Ans= 27000 or 24000(Confused) 4. Hash table question Ans=2. A hash table has size of 11 & data filled in its positions like {3,5,7,9,6} how many comparison s have made if data is not found in the list in worst case?. Options= i. 2 ii. 6 iii. 11 iv. 1 5. From the set {a,b,c,d,e,f} find no. of a rrangements for 3 alphabets with no data repeated. ANS=360. OR for 4 alpha ANS=720. C Programming 1. Array pointer is pass 2. String Buffer Question 3. String Concatenate(Char *s1,Char *s2) { Char buf[1000]; Buf[0]=null; Strcat(buf,s1); Strcat(buf,s2); Return buf; } i. should not return pointer to local variable. ii. Nothing Wrong in this function. iii. It don¶t work if l ength exceeds 1000 char. iv. Error in this code. 4. foo() call how many times Ans=5050. For(i=1;i< =100;i++) For (j=1;j<=100;j++) Foo(); Programming Section ( mainly ask 2 programs.) 1. Occurrence of letters in String. Get string from KB of an y length & print letters coming maximum time first than second largest«.. i.e in descending order. Their requirement: They want that u ma ke this program thru linked list if u do that than it i s well n good. Must allocate memory dynamically. Use proper assumptions & Comments everywhere this will a dd more advantage .use in all programs. Output look like if u enter string aababbbcba b 5 times a 4 times c 1 times just like that Hint: Make array of 256 chars. Now Scan the string pick each char a nd according to it¶s acsii value increment that index value at last u have an array which have counter for each alphabet. Sort this array & display. 2 . Sparse Matrix Addition. A structure of sparse matrix is given. You have to create a function sparseadd to add 2 sparse matrices Structure is some how like Struct Sparsematrix { int row ;
int col ; int val; SparseMatrix *next; } You have to made function to add two sparse matrices. Function signature like SparseMatrix SparseAdd(SparseMatrix s1,SparseMatrix s2) Interview
Questions
1. Prepare DS,DBMS,OS,TOC thoroughly may ask abt anyone everything . 2. Reversing a linked list. 3. How u make database for windows directory structure or any OS. Hint: using trees & field parent of which points to parent. 4. Make Program (Logic) to find word in Dictionary. Hint: using Hash Table. 5. Make logic of sorting which is n ot given in books. Make ur own. 6. win NT architecture given in galwin book in end. 7. File system FAT, NTFS etc. 8. Prepare your project & CV Thoroughly. 9.They ask to make a Joke. 10. Tcp/ip. 11. Whatever they presented in PPT watch i t carefully(Most Important)
omputer Algorithms 1. Time Complexity 2. Which of the following cannot be implemented efficiently in Linear Linked List 1. Quicksort 2. Radix Sort 3. Polynomials 4. Insertion Sort 5. Binary Search 3. In binary search tree , n=no des, h=height of tree. What's complexity? 1. o(h) 2. o(n*h) 3. o(nLogn) 4. o(n*n) 5. None C Programs 1. Printf("%d%d",i++,i++); 1. Compiler Dependent 2. 4 4 3. 4 3
4. 3 4 5. None of Above 2. void main() { printf("persistent"); main(); } 1. Till stack overflows 2. Infinite 3. 65535 4. 34423 5. None 3. what is Swapping? 4. what does it do? void f(int n) { if(n>0) { if(A[i]>A[j]) swap(); } else f(n-1); } 1. Swap 2. Sort in Ascending order 3. Sort in Descending order 4. Computes permutation 5. Given a Fibonacci function f1=1;f2=1 fn=f(n-1)+f(n-2) which of the following is true? 1. Every Second element is even 2. Every third element is odd 3. The series increases monotonally 4. For n>2, fn=ceiling(1.6 * f(n-1)) 5. None Operating System 1. Where the root dir should be located 1. Anywhere on System disk 2. Anywhere on Disk' 3. In Main memory 4. At a fixed location on Disk 5. At fixed location on System Disk 2. Problem on Concurrency 3. Problem on Round Robin Al gorithm
General 1. If x is odd, in whi ch of the following y must be even 1. X+Y=5 2. 2(X+Y)=7 3. 2X + Y =6 4. X+2Y=7 2. 1000! How many digits? What is the most significant and Least significant digit? DBMS 1. If table A has m ro ws and table B has n rows then how many rows will the following query return SELECT A.A1,B.B1
FROM A,B WHERE A.A3=B.B3 1. <=(m*n) 2. m*n 3. <=(m+n) 4. >=(m+n) and <=(m*n) 5. m+n 2. A Query optimizer optimizes according to which of Freshersworld.com the following criteria 1. Execution time 2. Disk access 3. CPU usage 4. Communication time 5. None 3. Which of the following is n ot a characteristic of a transaction 1. Atomicity 2. Consistency 3. Normalization 4. Isolation 5. Durability 4. The def. of Foreign key is there to support 1. Referential integrity 2. Constraint 3. None 5. Problem Process A Process B WRITELOCK(X) WRITELOCK(Y) READ(X) READ(Y) ... ... 1. The problem is serializable 2. The problem is not serializable 3. It can be run in parallel 4. None PROGRAMMING SECTI ON (This consisted of Two programs to be solved in 1 hour.) 1. A sparse matrix is a matrix i n which a node with val=0 is not represented. The whole mat rix is represented by a Linked list where node typedef struct Node { int row; int col; int value; sparsematrix next; } Element, *sparsematrix; The problem is, if there are two matrix given suppose m1 and m2, then a dd them and return the resultant sparsematrix. 2. If suppose there are N functions say from 0,1,2,... N-1 and it's given that A[i][j]=1 if the function i contains a call to func. j otherwise A[i][j]=0, then write a function that will form groups of related functions and print them line by line and at the end print the number of total groups
1. If there r n processes and each process waits p time in waiting state then cpu utilization is-: a) n(1-p) b) n*p 2. A string of pages were given and no of page faults have to be found in LRU algorithm 3. here is a file server which provides locking for mutual exclusion . if any process locks the file and abruptly terminated this will result in indefinitely locking .The solution they found is to implement a timer for locking of fil e i.e. if time outs then server assumes that file is indefinitely locked and terminate th e process ± a) this solution i s perfect for mutual exclusion b) this will solve indefinite locking c) this will result in interleaving of file between processes 4. A critical section is ± ans a set of instruction which i s shared by many processes 5. There was a question on automata ans ± the resultant string will have even no of c 6. CFG was given S -> 1 S 1 S-> 0 S 0 S -> 1 1 S -> 0 0 Find out the string 7. One singly circular ordered list is there if M elements are to be inserted what wi ll be the complexity of time a) O(M*N) b) O(M*(M+N)) c) O ((M+N) * log(M+N)) d)none of these 8. find postfix and prefix of A + B * ( C + D ) / E + F 9. Find out shortest path from A to B ABCDE A0m Bm022m C05 D06 E0 10. From the following when 43 will not be found by binary search (a series was given with last element 43 i n each) 11. From 100 ± 999 find the prob. Of getting 3 digit no with no 7 in any of its digit a) 18/25 b) 10/25 c) 729/1000 d) none 12. from the set {a,b,c,d,e,f} find no of arrangements for 3 alp habet with no data repeated 13. To save space which option is better a) write all join operation than select than project b) ---------,,------------------than project----select c) ----------,,-----------------in b/w select and project Employee = { e_no , sala ry, fname, lname} Works_On = {e_no, p_no, hrs} Project = {p_no, p_name}
14. select e_no from Employee where salary = sal ary a) query invalid b) query valid
15. Select fname ,lname from Employee where e_no in (select e_no from works_on where p_no =(select * from project)) 16. B tree is different from other a) has fixed index file size b) is better for queries like < <= > >= c) searching will be easy d) none 17. func(char *s1,char * s2) { char *t; t=s1; s1=s2; s2=t; } void main() { char *s1=´jack´, *s2=´jill´; func(s1,s2); printf(³%s %s ´,s1,s2); } OUTPUT jack jill 18. void main() { int a[5] ={1,2,3,4,5},i,j=2; for (i =0;i<5;i++ ) func(j,a[i]); for (i =0;i<5;i++ ) printf(³%d´,a[i]); } func(int j,int *a) { j=j+1; a=a+j; } 19. oid main() { for (a=1;a<=100;a++) for(b=a;b<=100;b++) foo(); } foo() {} how many times foo will be call ed. a) 5050 b) 1010 c) d) 20. A hash table has a sie of 11 and data filled in i ts position like{3,5,7,9,6}how many comparisons have to be made if data is not found in the list in worst case a) 2 b) 6 c) 11 d) 21. packet switching is better than circuit switching coz a) it takes less time b) it takes less bandwidth
c) it takes low frequency d) none 22. addition of two sparse matrix in 3 tupple notation ---time 30 min 24a tree has 1000000 nodes than how many search r required to search a node 23. A program to arrange a string in order of occurrence of the character
here APT Paper FIRST
SECT ION a) Quati Section 15 marks i) analytical ii) quanti b) C Section 10 marks c) DSA section 10 marks d) OS section 5 marks C section: 1 main() { printf("persistant"); main(); } ans:print the persistant till the stack overflow occur 2) f(0)=0; f(16)=? int f(int n) { if(n>100) n=n-10; else something } ans 91; 3) queston on seek() i.e. moving file pointer pointer has to point just before the last character of th e file os) what is thrashing? DSA 1) find number of nodes in complete binary tree of level 5 ans:-63 2) problem on queue. one queue was given and find the minimum number of insertion a nd deletion operation to get desired output. SECOND SECTI ON There were two programs on c 1) create doubly linked list 2)second question was on graph there is one undirectional connected graphand we have to find connected edges in a graph user input the adjecency list /mattrix Hint: first find out the path mattrix by warshal ls algorithm then from this mattrix u will get which are the connected nodes which not in mattrix 0 means u nconnected 1 for connected FIRST
TECHNICAL INTERVIEW The most important round in which u ask to write a program 1)i ahve asked to write a program on finding a position of number in fabonaci series. 2)finding a liked list whether it i s looping linked list or general l inked list 3)to write a program to create linked li st.
4)virtual function of c++. 5)calloc and malloc 6)operator overloding 7)static variable 8)how to allocatte dynamic memory. 9)what is big o nation 10) all sorting alogorithm and their complexity SECOND TECHNICAL INTERV IEW They can ask u tell the differenrt technical area of interst than c,c++,DSA. i f u have so. 1) Puzzle on cutting cake in 8 same parts using only three cuts. 2) multithreding, multitasking, multiprocessor system 3) wrte a program reverse the integer no. 4) write a program to draw square without u sing recatangle function in c++. 5) FAT, NTFS, windows NT, WINDOWS XP .6)warshalls alogorithm ,dijkstra algoriyhm 7)query on sql to find the names of the person who is having same name. 8)linux give the command which tells the process status 9)softare engg. 10) software development life cycle.