IBS Software Services Technical Interview Questions. Q1. What is the difference between declaration and definition?

Similar documents
IBS Technical Interview Questions

CS201 - Introduction to Programming Glossary By

TCS Technical interview Questions

Short Notes of CS201

TCS Technical Interview Questions

Introduction to Programming Using Java (98-388)

OBJECT ORIENTED PROGRAMMING USING C++ CSCI Object Oriented Analysis and Design By Manali Torpe

Final exam. Final exam will be 12 problems, drop any 2. Cumulative up to and including week 14 (emphasis on weeks 9-14: classes & pointers)

Interview Q And Answer Shwetank K. Gupta 2011

C++ Important Questions with Answers

Interview Questions of C++

Documentation. Programming / Documentation Slide 42

Introduction to Visual Basic and Visual C++ Introduction to Java. JDK Editions. Overview. Lesson 13. Overview

Java for Programmers Course (equivalent to SL 275) 36 Contact Hours

I BCS-031 BACHELOR OF COMPUTER APPLICATIONS (BCA) (Revised) Term-End Examination. June, 2015 BCS-031 : PROGRAMMING IN C ++

CS 162, Lecture 25: Exam II Review. 30 May 2018

C++_ MARKS 40 MIN


Class, Variable, Constructor, Object, Method Questions

Page. No. 1/15 CS201 Introduction to Programmming Solved Subjective Questions From spring 2010 Final Term Papers By vuzs Team

Week. Lecture Topic day (including assignment/test) 1 st 1 st Introduction to Module 1 st. Practical

CS201 Latest Solved MCQs

Midterm Review. PIC 10B Spring 2018

VIRTUAL FUNCTIONS Chapter 10

Object Oriented Programming. Solved MCQs - Part 2

Absolute C++ Walter Savitch

EL2310 Scientific Programming

1. Describe History of C++? 2. What is Dev. C++? 3. Why Use Dev. C++ instead of C++ DOS IDE?

C++ (Non for C Programmer) (BT307) 40 Hours

CS32 - Week 2. Umut Oztok. July 1, Umut Oztok CS32 - Week 2

For Teacher's Use Only Q No Total Q No Q No

What are the characteristics of Object Oriented programming language?

CS304 Object Oriented Programming Final Term

OOPS Viva Questions. Object is termed as an instance of a class, and it has its own state, behavior and identity.

Highlights. - Making threads. - Waiting for threads. - Review (classes, pointers, inheritance)

CS201- Introduction to Programming Current Quizzes

Object-Oriented Principles and Practice / C++

Object-Oriented Programming

Learning Objectives. C++ For Artists 2003 Rick Miller All Rights Reserved xli

Chapter 6 Introduction to Defining Classes

COP 3330 Final Exam Review

Graphical Interface and Application (I3305) Semester: 1 Academic Year: 2017/2018 Dr Antoun Yaacoub

What does it mean by information hiding? What are the advantages of it? {5 Marks}

1 Shyam sir JAVA Notes

KOM3191 Object Oriented Programming Dr Muharrem Mercimek OPERATOR OVERLOADING. KOM3191 Object-Oriented Programming

CS201 Some Important Definitions

Lecture 18 Tao Wang 1

Dynamic Data Structures

CHAPTER 1 Introduction to Computers and Programming CHAPTER 2 Introduction to C++ ( Hexadecimal 0xF4 and Octal literals 031) cout Object

Java Classes, Inheritance, and Interfaces

Instantiation of Template class

Inheritance. Transitivity

C++ PROGRAMMING LANGUAGE: DYNAMIC MEMORY ALLOCATION AND EXCEPTION IN C++. CAAM 519, CHAPTER 15

C++ PROGRAMMING LANGUAGE: CLASSES. CAAM 519, CHAPTER 13

STRUCTURING OF PROGRAM

INHERITANCE. Spring 2019

CS 6456 OBJCET ORIENTED PROGRAMMING IV SEMESTER/EEE

OOP THROUGH C++(R16) int *x; float *f; char *c;

Module 10 Inheritance, Virtual Functions, and Polymorphism

Declaring Pointers. Declaration of pointers <type> *variable <type> *variable = initial-value Examples:

Topic 5 Polymorphism. " Inheritance is new code that reuses old code. Polymorphism is old code that reuses new code.

Object Oriented Programming is a programming method that combines: Advantage of Object Oriented Programming

Inheritance and Interfaces

Outline. Dynamic Memory Classes Dynamic Memory Errors In-class Work. 1 Chapter 10: C++ Dynamic Memory

Quiz Start Time: 09:34 PM Time Left 82 sec(s)

Programming II (CS300)

DOWNLOAD PDF CORE JAVA APTITUDE QUESTIONS AND ANSWERS

WA1278 Introduction to Java Using Eclipse

Saikat Banerjee Page 1

Introduction to Inheritance

CMSC 202 Section 010x Spring Justin Martineau, Tuesday 11:30am

Kapil Sehgal PGT Computer. Science Ankleshwar Gujarat Chapter 6 Inheritance Extending a Class

Inheritance and Polymorphism

DESIGN PATTERN - INTERVIEW QUESTIONS

Collected By Anonymous

Software Design COSC 4353/6353 D R. R A J S I N G H

OBJECT ORIENTED PROGRAMMING. Ms. Ajeta Nandal C.R.Polytechnic,Rohtak

Inheritance. Lecture 11 COP 3252 Summer May 25, 2017

C++ 8. Constructors and Destructors

Written by John Bell for CS 342, Spring 2018

20 Most Important Java Programming Interview Questions. Powered by

Inheritance. OOP: Inheritance 1

Core Java SYLLABUS COVERAGE SYLLABUS IN DETAILS

Initializing and Finalizing Objects

Come and join us at WebLyceum

Computer Programming Inheritance 10 th Lecture

Example: Count of Points

Lecture Notes on Programming Languages

Ch. 12: Operator Overloading

Object Oriented Programming: In this course we began an introduction to programming from an object-oriented approach.

The Java Programming Language

Chapter 4 Defining Classes I

Get Unique study materials from

Design Pattern. CMPSC 487 Lecture 10 Topics: Design Patterns: Elements of Reusable Object-Oriented Software (Gamma, et al.)

Cpt S 122 Data Structures. Introduction to C++ Part II

Motivation was to facilitate development of systems software, especially OS development.

AP Computer Science Chapter 10 Implementing and Using Classes Study Guide

Course Text. Course Description. Course Objectives. StraighterLine Introduction to Programming in C++

STUDY NOTES UNIT 1 - INTRODUCTION TO OBJECT ORIENTED PROGRAMMING

Sudoku-4: Logical Structure

Transcription:

IBS Software Services Technical Interview Questions Q1. What is the difference between declaration and definition? The declaration tells the compiler that at some later point we plan to present the definition of this declaration. E.g.: void stars () //function declaration The definition contains the actual implementation. E.g.: void stars () // declarator for(int j=10; j > =0; j--) //function body cout << *; cout <<> Q2. What do you mean by inline function? The idea behind inline functions is to insert the code of a called function at the point where the function is called. If done carefully, this can improve the applications performance in exchange for increased compile time and possibly (but not always) an increase in the size of the generated binary executables. Q3. What is the final keyword denotes? Final keyword denotes that it is the final implementation for that method or variable or class. You can not override that method/variable/class any more. Q4. What is composition?

Holding the reference of the other class within some other class is known as composition. Q5. What are the methods in Object? Clone, equals, wait, finalize, getclass, hashcode, notify, notifyall, tostring. Q6. What are the advantages of inheritance? It permits code reusability. Reusability saves time in program development. It encourages the reuse of proven and debugged high-quality software, thus reducing problem after a system becomes functional. Q7. What is public, protected, private? 1. Public, protected and private are three access specifiers in C++. 2. Public data members and member functions are accessible outside the class. 3. Protected data members and member functions are only available to derived classes. 4. Private data members and member functions can not be accessed outside the class. However there is an exception can be using friend classes. Q8. What is Boyce Codd Normal form?

A relation schema R is in BCNF with respect to a set F of functional dependencies if for all functional dependencies in F+ of the form a->, where a and b is a subset of R, at least one of the following holds: * a- > b is a trivial functional dependency (b is a subset of a) * a is a super key for schema R Q9. What is the difference between realloc() and free()? The free subroutine frees a block of memory previously allocated by the malloc subroutine. Undefined results occur if the Pointer parameter is not a valid pointer. If the Pointer parameter is a null value, no action will occur. The realloc subroutine changes the size of the block of memory pointed to by the Pointer parameter to the number of bytes specified by the Size parameter and returns a new pointer to the block. The pointer specified by the Pointer parameter must have been created with the malloc, calloc, or realloc subroutines and not been deallocated with the free or realloc subroutines. Undefined results occur if the Pointer parameter is not a valid pointer. Q10. What is singleton? It is one of the design pattern. This falls in the creational pattern of the design pattern. There will be only one instance for that entire JVM. You can achieve this by having the private constructor in the class. For eg., public class Singleton private static final Singleton s = new Singleton(); private Singleton() public static Singleton getinstance() return s; // all non static methods Q11. What is the major difference between Linked List and Array List?

Linked List is meant for sequential accessing. Array List is meant for random accessing. Q12. Can you instantiate the Math class? You can not instantiate the math class. All the methods in this class are static. And the constructor is not public. Q13. What is inner class? If the methods of the inner class can only be accessed via the instance of the inner class, then it is called inner class. Q14. What do you mean by inheritance? Inheritance is the process of creating new classes, called derived classes, from existing classes or base classes. The derived class inherits all the capabilities of the base class, but can add embellishments and refinements of its own. Q15. How do you find out if a linked-list has an end? (i.e. the list is not a cycle) You can find out by using 2 pointers. One of them goes 2 nodes each time. The second one goes at 1 nodes each time. If there is a cycle, the one that goes 2 nodes each time will eventually meet the one that goes slower. If that is the case, then you will know the linked-list is a cycle. Q16. What is aggregation?

It is a special type of composition. If you expose all the methods of a composite class and route the method call to the composite method through its reference, then it is called aggregation. Q17. What is skeleton and stub? What is the purpose of those? Stub is a client side representation of the server, which takes care of communicating with the remote server. Skeleton is the server side representation. But that is no more in use it is deprecated long before in JDK. Q18. What is an object? Object is a software bundle of variables and related methods. Objects have state and behavior. Q19. What is virtual class and friend class? Friend classes are used when two or more classes are designed to work together and need access to each others implementation in ways that the rest of the world should not be allowed to have. In other words, they help keep private things private. For instance, it may be desirable for class Database Cursor to have more privilege to the internals of class Database than main() has. Q20. What is function overloading? Function overloading: C++ enables several functions of the same name to be defined, as long as these functions have different sets of parameters (at least as far as their types are concerned). This capability is called function overloading.

When an overloaded function is called, the C++ compiler selects the proper function by examining the number, types and order of the arguments in the call. Function overloading is commonly used to create several functions of the same name that perform similar tasks but on different data types. Q21. What is the significance of List Iterator? You can iterate back and forth. Q22. What is nested class? If all the methods of a inner class is static then it is a nested class. Q23. Write a program that ask for user input from 5 to 9 then calculate the average #include iostream.h int main() int MAX = 4; int total = 0; int average; int numb; for (int i=0; icout << Please enter your input between 5 and 9: ; cin >> numb; while ( numb<5>9) cout << Invalid input, please re-enter: ; cin >> numb; total = total + numb; average = total/max; cout << The average number is: <<>return 0;

Q24. How do you write a function that can reverse a linked-list? void reverselist(void) if(head==0) return; if(head->next==0) return; if(head->next==tail) head->next = 0; tail->next = head; else node* pre = head; node* cur = head->next; node* curnext = cur->next; head->next = 0; cur-> next = head; for(; curnext!=0; ) cur->next = pre; pre = cur; cur = curnext; curnext = curnext->next; curnext->next = cur;

Q25. What is operator overloading? Operator overloading allows existing C++ operators to be redefined so that they work on objects of user-defined classes. Overloaded operators are syntactic sugar for equivalent function calls. They form a pleasant facade that doesnt add anything fundamental to the language (but they can improve understandability and reduce maintenance costs).