Visa Inc. Interview Question

1. Tell about your background education and work experience. 2. Data Structure (LinkedList). Given a pointer to the middle node of a single one way linked list, describe the steps to delete that middle node. (Eg. (1,2,3,4,5,6) to (1,2,4,5,6) pointer to node 3 is given. 3. Use both iteration and recursive function to sort the above linked list in "Reverse order". (i.e. 6,5,4,3,2,1) 4. There is two database tables : department and student. Department has department name and department id with three records (Computer Science, Electronics and Robotics). Student has student name and department id with two records (one student in Computer Science and one student in Electronics). Create a sql statment to display the name of each department and the number of students in that department.

Interview Answers

Anonymous

Mar 3, 2016

select a.DEPARTMENT_NAME as DepartmentName,count(a.DEPARTMENT_ID) as DepartmentCount from DEPARTMENT a join STUDENT b on a.DEPARTMENT_ID = b.DEPARTMENT_ID group by a.DEPARTMENT_ID,a.DEPARTMENT_NAME order by a.DEPARTMENT_NAME;

1

Anonymous

May 12, 2016

select dep.name, count(distinct stu.name) as 'total student' from department dep inner join student stu on dep.id = stu.dep_id group by dep.name