EDUCBA

EDUCBA

MENUMENU
  • Free Tutorials
  • Free Courses
  • Certification Courses
  • 600+ Courses All in One Bundle
  • Login

Computer Science Interview Questions

By Priya PedamkarPriya Pedamkar

Home » Software Development » Software Development Tutorials » Top Interview Question » Computer Science Interview Questions

Computer Science Interview questions

Introduction to Computer Science Interview Questions and Answers

So you have finally found your dream job in Computer Science but are wondering how to crack the 2020 Computer Science interview and what could be the probable Computer Science interview Questions. Every Computer Science interview is different and the scope of a job is different too. Keeping this in mind we have designed the most common  Computer Science interview Questions and answers to help you get success in your interview.

Below is the 25 most common 2020 Computer Science interview Questions that are asked mostly:

Start Your Free Software Development Course

Web development, programming languages, Software testing & others

1. What is a file?

Answer:
A file is a named location which stores data or information permanently. A file is always stored inside a storage device using file name (e.g. STUDENT.MARKS). A file name normally has primary and secondary name separated by a “.”(DOT).

2. What is a class?

Answer:
A class is a blueprint from which objects are created. A class contains methods and variables associated with an instance of a class.

3.What is an object?

Answer:
An object is an instance of a class. For example
class Abc{ —– This is a class
int a; —— This is a variable
public Abc(); —- This is contractor
public static void main (String args[]) ——- This is a method
{
Abc a= new Abc(); —— This is object creation where ‘a’ is the reference variable or object name
}
}

4. What is a constructor?

Answer:
A constructor is methods which are used to create an Object of class. There are two types of constructor Default & Parameterized constructor.

Popular Course in this category
All in One Software Development Bundle (600+ Courses, 50+ projects)600+ Online Courses | 3000+ Hours | Verifiable Certificates | Lifetime Access
4.6 (3,144 ratings)
Course Price

View Course

Related Courses
Windows 10 Training (4 Courses, 4+ Projects)JWS Java Web Services Training (4 Courses, 11 Projects)Java Training (40 Courses, 29 Projects, 4 Quizzes)

5. What is the different OOPS principle?

Answer:
The basic OOPS principle are as follows,

  • Encapsulation
  • Abstraction
  • Inheritance
  • Polymorphism

6. What is inheritance?

Answer:
Inheritance is property in which the property of a parent class(Superclass) is passed on to child class(Subclass). For example
class Abc{ —– This is a class
int a; —— This is a variable
public void abc(){} — Methods
}
class Xyz extends Abc —–(Extend is the keyword, Xyz is the subclass which inherits the properties of ABC parent class.)
{
public static void main (String args[]) ——- This is a method
{
Abc a= new Abc(); —— This is object creation where ‘a’ is the reference variable or object name
}
}

7. What is polymorphism?

Answer:
Polymorphism is the ability of an object to take on multiple forms. Most commonly polymorphism is used in OOP when a parent class reference is used to refer to a child class object.

8. What are the instance and class variables?

Answer:
Instance variable belongs to a particular instance of that class whereas Class variable. A class variable is also known as static variables. For example
public class Abc{
public int a; …….. This is an instance variable
public static int a1;…….. This is a static or class variable
……………………..
……………..
}

9.Compare method and constructor?

Answer:
Constructor: Used to initialize the instance of a class.
Method: Used to perform some function or operation.

Constructor: Doesn’t have a return type.
Method: Has a return type.

10. What is a singleton class?

Answer:
Singleton class limits the number of objects created for a class to one but gives the flexibility of creating more objects if the situation changes.

11. What are the steps for creating the object?

Answer:
An object is first declared then instantiated and at last declared. For example
Abc a= new Abc();

12. What is the different type of access modifiers?

Answer:
There are four type of access modifiers as given below:-
• Visible to the overall package. No modifier needed.
• Private – Visible to class only.
• Public – Visible to the world.
• Protected – Visible to package and subclass.

13.Which is the highest operator precedence in Java

Answer:
The operator with the highest preference is Postfix operators i.e () [].

14.What is an array?

Answer:
The array is a container which holds the fixed number of similar data types.

15. What is the difference between equals() and method and == operator?

Answer:
The equals() is a method and it matches the content of the strings whereas == is an operator and matches object or reference of the strings.

16. Is string class final?

Answer:
Yes

17. What is a wrapper class?

Answer:
To access the primitive data type as an object we use wrapper class. They are following:-

Primitive Type Wrapper class
boolean Boolean
char Character
byte Byte
short Short
int Integer
long Long
float Float
double Double

18.Difference between overloading and overriding?

Answer:
Overloading is when two or more methods in the same class have the same method name but different parameters(i.e different method signatures).
Overriding is when two methods having the same method name and parameters (i.e., method signature) but one of the methods is in the parent class and the other is in the child class.

19. What are multiple inheritances in Java?

Answer:
Java supports multiple inheritances i.e the ability of a class to implement more than one interface. A class can implement multiple Interfaces but cannot extends multiple classes.

20. What is a stream?

Answer:
A stream can be defined as the sequence of data. There is two type of streams.
InputStream: Used to read data from a source.
OutPut Stream: Used to write data into a destination.

21. What is a Character stream?

Answer:
Java Character stream is basically used to perform input and output for 16 bit Unicode. The main classes users are FileReader and FileWriter which internally uses FileInputStream and FileOutputStream so the basic difference is that FileReader and FileWriter read and writes two bites at a time respectively.

22. What is a Byte stream?

Answer:
Java Byte stream is basically used to perform input and output for 8 bit Unicode.
The main classes related to byte streams are FileInputStream and FileOutputStream.

23. What is an Interface?

Answer:
The interface is a reference type in Java, similar to the class but its collection of abstract methods. A class can implement multiple interfaces.

24.Difference between class and interface?

Answer:
Below are the difference between Interface and class:-

  • The interface cannot be instantiated.
  • An interface doesn’t have any constructors.
  • Interface only have abstract methods.
  • A class implements an interface and extends a class.
  • An interface can extend multiple interfaces.

25. What is an abstract class?

Answer:
A class that contains the abstract keyword in a declaration is called abstract class. The properties of the abstract class are as follows:-

  • Abstract classes may or may not contain abstract methods but, if a class has at least one abstract method, then it must be declared abstract.
  • The abstract class cannot be instantiated.
  • To use an abstract class, we have to inherit it from another class.
  • If we inherit an abstract class, then we have to provide implementations to all the abstract methods in it.

Recommended Article

This has been a comprehensive guide to the Computer Science Interview Questions and answers so that the candidate can crackdown these Computer Science Interview Questions easily.This article consist of all top Computer Science Interview Questions and Answers. You may also look at the following articles to learn more –

  1. Pandas Interview Questions
  2. EIGRP Interview Questions
  3. Control System Interview Questions
  4. Xamarin Interview Questions

All in One Software Development Bundle (600+ Courses, 50+ projects)

600+ Online Courses

3000+ Hours

Verifiable Certificates

Lifetime Access

Learn More

106 Shares
Share
Tweet
Share
Primary Sidebar
Computer Tutorial
  • Computer Basics
    • New Technologies of Computer
    • Application of Computer Graphics
    • Types of Computer Architecture
    • Types of Computer Software
    • Line Drawing Algorithm
    • SOAP Web Services Interview Questions
    • Web Services Interview Questions
    • Microservices Interview Questions
    • What is Windows 10?
    • Windows 10 Desktop Mode
    • Windows Commands  
    • Windows Interview Questions
    • Windows Networking Commands
    • Windows Operators
    • Windows Server Interview Questions
    • Introduction to Windows
    • Top Windows Phone Apps
    • Windows Monitoring Tool
    • Productivity tricks for Windows 10
    • Computer Network Advantages and Disadvantages
    • Computer Network Interview Questions
    • Introduction To Computer Network
    • What is Embedded Systems
    • Components of Embedded System
    • Embedded Systems Security
    • Types of Computer Network
    • Types of Computer Operating System
    • Evolution of Operating System
    • NAS Storage Device
    • Windows Administrator Interview
    • Types of Communication Network
    • What is Automata
    • Types of Mainframe Computers
    • Types of Computer Hardware
    • Types of Sensors
    • What is Server
    • What is RPC
    • What is Microservices
    • Types of Computer Virus
    • Types of Computer Keyboard
    • Types of Motherboard
    • Sensor Device
    • What is Computer Graphic Design
    • Computer Architecture Interview
    • What is Computer Science?
    • What is Bluetooth?
    • What is VLAN?
    • Types of VLAN
    • Types of LAN
    • How does LAN switches work
    • What is VLAN Network?
    • What is Native VLAN?
    • How does LAN Switches work?
    • Switching Modes
    • What is Storage?
    • What is Object Storage?
    • What is Block Storage?
    • Block Level Storage
    • Cordova Local Storage
    • Threads in Operating System
    • What is Gateway?
    • What is Ethernet?
    • What is Virtual Machine?
    • What is a Trunk Port?
    • VPN Applications for Android
    • What is a NAS Drive?
    • What is Ring Topology?
    • Point to Point Topology
    • What is Mesh Topology?
    • Extended Star Topology
    • Token Ring Topology
    • Physical Topology
    • What is a Hybrid Topology?
    • Hybrid Network Topology
    • Star Network Topology
    • Star Bus Topology
    • Zariski Topology
    • Ethernet Topology
    • Logical Topology
    • Partial Mesh Topology
    • Types of Computer Cables
    • Types of Computer Language
    • Features of Operating System
    • Functions of Operating System
    • Multithreading in Operating System
    • Ethernet Frame Format
    • Types of Memory in Computer
    • What is Heap Memory?
    • What is Register?
    • Types of Registers
    • What is Arduino?
    • Arduino Operators
    • What is iSCSI?
    • Computer Science Interview Questions
    • Types of USB Ports
    • What is Port
    • Daisy Chain Network
    • What is a Monitor?
    • What is Printer?
    • Types of Printers
    • What is WPS
    • What is Mouse?
    • Types of Socket
    • Transmission Modes
    • Computers Output Devices
    • Memory Units
    • Secondary Memory
    • What is Memory Card?
    • Types of Memory Cards
    • What is Intranet?
    • Central Processing Unit
    • Computer Ports
    • What is CPU Register
    • Types of CPU
    • Types of Compact Disc
    • Cache Memory Types
    • What is a Motherboard?
    • Types of LED
    • Types of Processor
    • Types of Primary Memory
    • Helpdesk Tool
    • What is Optical Fiber?

Related Courses

Windows 10 Training Course

Java Web Services Training Course

Java Training Course

Footer
About Us
  • Blog
  • Who is EDUCBA?
  • Sign Up
  • Corporate Training
  • Certificate from Top Institutions
  • Contact Us
  • Verifiable Certificate
  • Reviews
  • Terms and Conditions
  • Privacy Policy
  •  
Apps
  • iPhone & iPad
  • Android
Resources
  • Free Courses
  • Java Tutorials
  • Python Tutorials
  • All Tutorials
Certification Courses
  • All Courses
  • Software Development Course - All in One Bundle
  • Become a Python Developer
  • Java Course
  • Become a Selenium Automation Tester
  • Become an IoT Developer
  • ASP.NET Course
  • VB.NET Course
  • PHP Course

© 2020 - EDUCBA. ALL RIGHTS RESERVED. THE CERTIFICATION NAMES ARE THE TRADEMARKS OF THEIR RESPECTIVE OWNERS.

EDUCBA Login

Forgot Password?

EDUCBA
Free Software Development Course

Web development, programming languages, Software testing & others

*Please provide your correct email id. Login details for this Free course will be emailed to you
Book Your One Instructor : One Learner Free Class

Let’s Get Started

This website or its third-party tools use cookies, which are necessary to its functioning and required to achieve the purposes illustrated in the cookie policy. By closing this banner, scrolling this page, clicking a link or continuing to browse otherwise, you agree to our Privacy Policy

EDUCBA

*Please provide your correct email id. Login details for this Free course will be emailed to you
EDUCBA
Free Software Development Course

Web development, programming languages, Software testing & others

*Please provide your correct email id. Login details for this Free course will be emailed to you

Special Offer - All in One Software Development Bundle (600+ Courses, 50+ projects) Learn More