{"id":9442,"date":"2021-07-15T19:16:40","date_gmt":"2021-07-15T19:16:40","guid":{"rendered":"https:\/\/www.monsterindia.com\/career-advice\/top-50-coding-and-programming-interview-questions-9442\/"},"modified":"2023-03-16T16:14:07","modified_gmt":"2023-03-16T10:44:07","slug":"top-50-coding-and-programming-interview-questions","status":"publish","type":"post","link":"https:\/\/www.foundit.sg\/career-advice\/top-50-coding-and-programming-interview-questions\/","title":{"rendered":"Advance Coding and Programming Interview Questions"},"content":{"rendered":"\n<p><span style=\"font-family: verdana, geneva, sans-serif;font-size: 12pt\"><span style=\"font-weight: 400\">With abundant developments in the field of software, the need for programming employees is also increasing rapidly. Every year hundreds of graduating students are attending programming interviews and coding interviews to get into the field of software. It is not just practical coding, but it is also important to quickly answer basic <\/span><strong><a href=\"https:\/\/www.monsterindia.com\/career-advice\/python-oops-interview-questions\/\" title=\"https:\/\/www.monsterindia.com\/career-advice\/python-oops-interview-questions\/\">coding interview questions<\/a>.&nbsp;<\/strong><\/span><\/p>\n\n\n\n<p><span style=\"font-family: verdana, geneva, sans-serif;font-size: 12pt\">Coding interview questions<span style=\"font-weight: 400\"> are not just permitted to C <a title=\"https:\/\/en.wikipedia.org\/wiki\/Programming_language#:~:text=A%20programming%20language%20is%20any,computer%20programming%20to%20implement%20algorithms.\" href=\"https:\/\/en.wikipedia.org\/wiki\/Programming_language#:~:text=A%20programming%20language%20is%20any,computer%20programming%20to%20implement%20algorithms.\" rel=\"nofollow\">programming language<\/a> anymore. Hence, it is important to know the most frequently asked programming interview questions and also interview questions on basic coding. Further, it is important to know the frequently asked coding questions on some other technical topics like <a title=\"https:\/\/www.monsterindia.com\/career-advice\/java-technical-architect-interview-questions\/\" href=\"https:\/\/www.monsterindia.com\/career-advice\/java-technical-architect-interview-questions\/\">java programming interview questions<\/a> and interview questions of data structures and database management.<\/span><\/span><\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Programming Interview Questions<\/strong><\/h2>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>1. What is computer programming?<\/strong><\/h3>\n\n\n\n<p><span style=\"font-family: verdana, geneva, sans-serif;font-size: 12pt\"><span style=\"font-weight: 400\">Being asked about computer programming is one of the basic <\/span>coding interview questions a<span style=\"font-weight: 400\"> candidate gets asked during an interview. Computer programming is the concept of writing instructions to a computer to make it perform a certain task. It involves designing specific algorithms for every instruction using <a title=\"https:\/\/www.monsterindia.com\/search\/programming-languages-jobs\" href=\"https:\/\/www.monsterindia.com\/search\/programming-languages-jobs\">programming languages<\/a>. A set of these instructions that can make the computer accomplish a certain task is known as a \u2018program\u2019.<\/span><\/span><\/p>\n\n\n\n<p><span style=\"font-weight: 400;font-family: verdana, geneva, sans-serif;font-size: 12pt\">The \u2018programmer\u2019 who does the computer programming will have to write the instructions in any language that the computer is capable of changing to machine-understandable instructions.<\/span><\/p>\n\n\n\n<p><strong>Also Read:<\/strong> <a href=\"https:\/\/www.monsterindia.com\/career-advice\/8-advanced-sql-server-questions-you-should-know-to-crack-your-next-interview\/\">8 advanced SQL Server Questions you should know to crack your next interview<\/a><\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>2. What is the basic classification of Programming Languages?<\/strong><\/h3>\n\n\n\n<p><span style=\"font-weight: 400;font-family: verdana, geneva, sans-serif;font-size: 12pt\">Programming Languages are classified based on whether they are easily understood by programmers (i.e., humans) or easily interpreted by the machine (i.e., computer). The basic classification is low-level languages and high-level languages.<\/span><\/p>\n\n\n\n<p><span style=\"font-weight: 400;font-family: verdana, geneva, sans-serif;font-size: 12pt\">High-Level Languages: Human-friendly programming languages where the major portion of the instructions consists of basic English words. Examples \u2013 C, <a href=\"https:\/\/www.monsterindia.com\/search\/c++-jobs\" title=\"https:\/\/www.monsterindia.com\/search\/c++-jobs\">C++<\/a>, <a href=\"https:\/\/www.monsterindia.com\/search\/java-jobs\" title=\"https:\/\/www.monsterindia.com\/search\/java-jobs\">Java<\/a>, <a href=\"https:\/\/www.monsterindia.com\/search\/python-jobs\" title=\"https:\/\/www.monsterindia.com\/search\/python-jobs\">Python<\/a>.<\/span><\/p>\n\n\n\n<p><span style=\"font-weight: 400;font-family: verdana, geneva, sans-serif;font-size: 12pt\">Low-Level Languages: Programming Languages consist of very few human-understandable words and the major portion of the code in the machine-understandable language, i.e., 0s and 1s. Examples \u2013 Assembly Language and Machine-Level Language.<\/span><\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>3. What is Compiling in Computer Programming?<\/strong><\/h3>\n\n\n\n<p><span style=\"font-weight: 400;font-family: verdana, geneva, sans-serif;font-size: 12pt\">Compiling is the process of converting high-level languages (like C, Java, Python) into machine understandable language, i.e., the binary code (0s and 1s). The software of every high-level programming language has a compiler.&nbsp;<\/span><\/p>\n\n\n\n<p><span style=\"font-weight: 400;font-family: verdana, geneva, sans-serif;font-size: 12pt\">Whenever the programmer writes a code and runs it, the compiler performs the conversion of code into 0s and 1s so that the machine can understand the instruction that the programmer is trying to give.<\/span><\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>4. What is Debugging in Computer Programming?<\/strong><\/h3>\n\n\n\n<p><span style=\"font-weight: 400;font-family: verdana, geneva, sans-serif;font-size: 12pt\">Debugging is the process of finding bugs in the code written by the programmer. A debugger is a software that finds errors in the logic of the code. A debugger can run the entire code at once or run sections of code if requested, or line-by-line debugging can also be done. Debugging is the best way for a programmer to know where he\/her logic has gone wrong.<\/span><\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>5.&nbsp;What is Software Testing?<\/strong><\/h3>\n\n\n\n<p><span style=\"font-weight: 400;font-family: verdana, geneva, sans-serif;font-size: 12pt\"><a title=\"Software Testing jobs\" href=\"https:\/\/www.monsterindia.com\/search\/software-testing-jobs\" target=\"_blank\" rel=\"noopener\">Software Testing<\/a> is the process of verifying whether the final software output satisfies all the expected requirements. It is an in-depth testing process where every possible expected output is compared with the generated software output produced by the software code. After the software passes all the various levels of testing, only then will the software be given for use to the consumers.<\/span><\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Interview Questions on Basic Coding<\/strong><\/h2>\n\n\n\n<p><span style=\"font-family: verdana, geneva, sans-serif;font-size: 12pt\"><span style=\"font-weight: 400\">Given below are some of the basic <\/span>coding interview questions<span style=\"font-weight: 400\">;<\/span><\/span><\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>1. What are Variables?<\/strong><\/h3>\n\n\n\n<p><span style=\"font-family: verdana, geneva, sans-serif;font-size: 12pt\"><span style=\"font-weight: 400\">Questions on variables are one of the most important <\/span>coding interview questions <span style=\"font-weight: 400\">that an interviewer can ask. Variables are the names assigned to the data used in a program to store that data inside a memory location. Variables used in a program could be a word or a letter, or a set of words without space in between.<\/span><\/span><\/p>\n\n\n\n<p><span style=\"font-weight: 400;font-family: verdana, geneva, sans-serif;font-size: 12pt\">Underscore (_) is the only character that can be used in variables other than letters. All other special characters are invalid as variables. The letters in a variable could be a combination of capitals and small letters however the programmer desires.&nbsp;<\/span><\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>2.&nbsp;What are local variables and global variables?<\/strong><\/h3>\n\n\n\n<p><span style=\"font-weight: 400;font-family: verdana, geneva, sans-serif;font-size: 12pt\">Variables that are declared outside of all functional blocks of a program are known as global variables. They can be accessed all through the program in all the different functional blocks used. The same global variable can be assigned different values in different functional blocks of the program.<\/span><\/p>\n\n\n\n<p><span style=\"font-weight: 400;font-family: verdana, geneva, sans-serif;font-size: 12pt\">Variables that are declared inside a functional block are known as local variables. Access to such variables is restricted only to that particular functional block.<\/span><\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>3.&nbsp;Tell me briefly about data types used in coding.<\/strong><\/h3>\n\n\n\n<p><span style=\"font-family: verdana, geneva, sans-serif;font-size: 12pt\">Types of data are one of the most asked coding interview questions. Every variable used in a program is assigned a particular data type depending on the type of data assigned to that variable. If the data is a number, then it would come under \u2018int\u2019 datatype. Similarly, we have \u2018string\u2019 for letters, \u2018char\u2019 for words, \u2018bool\u2019 for Boolean true and false, \u2018float\u2019 for decimals, etc.<\/span><\/p>\n\n\n\n<p><span style=\"font-weight: 400;font-family: verdana, geneva, sans-serif;font-size: 12pt\">In some programming languages like C, the data type should be mentioned during variable declaration. In other programming languages like Python, the data type is internally decided, depending on the type of data assigned to the variable.<\/span><\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>4.&nbsp;What are operators?<\/strong><\/h3>\n\n\n\n<p><span style=\"font-weight: 400;font-family: verdana, geneva, sans-serif;font-size: 12pt\">Operators are characters that determine the type of operation taking place between 2 or more variables or plain numbers. Operators are of many types like mathematical operators, logical operators, conditional operators, relational operators, Boolean operators, etc.<\/span><\/p>\n\n\n\n<p><span style=\"font-weight: 400;font-family: verdana, geneva, sans-serif;font-size: 12pt\">Mathematical calculations like addition, subtraction, multiplication, etc., are performed using mathematical operators (+. -. *, etc.).<\/span><\/p>\n\n\n\n<p><span style=\"font-weight: 400;font-family: verdana, geneva, sans-serif;font-size: 12pt\">Logical operators are used for performing logical operations like AND, OR, etc.&nbsp;<\/span><\/p>\n\n\n\n<p><span style=\"font-weight: 400;font-family: verdana, geneva, sans-serif;font-size: 12pt\">Conditional or relational operators (==, &gt;, &lt;, &gt;=, &lt;=, etc.) are used for tasks like comparing 2 variables, whether they are equal to or greater than or lesser than one another.<\/span><\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>5.&nbsp;What are the various types of Loops?<\/strong><\/h3>\n\n\n\n<p><span style=\"font-weight: 400;font-family: verdana, geneva, sans-serif;font-size: 12pt\">A loop is a sequence of instructions that keeps repeating as long as a given condition is satisfied. Loops are classified into 3 types based on the position of the condition statement, they are \u2018for loop\u2019, \u2018while loop\u2019, \u2018do-while loop\u2019.<\/span><\/p>\n\n\n\n<p><span style=\"font-weight: 400;font-family: verdana, geneva, sans-serif;font-size: 12pt\">For and while loops are entry-controlled loops. Hence, if the condition is not true for the first time, then the control can never enter the loop. The do-while loop on the other side is exit-controlled. Hence, the control would enter the loop for the first time, and then the control repeats in the loop for the second time only if the given condition is satisfied.&nbsp;&nbsp;&nbsp;<\/span><\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Advanced Coding Interview Questions<\/strong><\/h2>\n\n\n\n<p><span style=\"font-family: verdana, geneva, sans-serif;font-size: 12pt\"><span style=\"font-weight: 400\">Given below are some of the most asked advanced <\/span>coding interview questions<span style=\"font-weight: 400\">:<\/span><\/span><\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>1.&nbsp;Have you heard anything about program documentation?<\/strong><\/h3>\n\n\n\n<p><span style=\"font-weight: 400;font-family: verdana, geneva, sans-serif;font-size: 12pt\">Documentation of software is making a record of the flowchart, algorithm, code, testing, and the complete usage of a program or all the software programs. Maintaining documentation is a very healthy and necessary habit that every programmer should practice.&nbsp;<\/span><\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>2.&nbsp;What is the difference between a compilation error and a runtime error?<\/strong><\/h3>\n\n\n\n<p><span style=\"font-weight: 400;font-family: verdana, geneva, sans-serif;font-size: 12pt\">Errors that occur while the compiler checks the program before actually running it are known as compilation errors or compile-time errors. These errors are mostly caused due to a fault in the standard syntax or semantics of that program.<\/span><\/p>\n\n\n\n<p><span style=\"font-weight: 400;font-family: verdana, geneva, sans-serif;font-size: 12pt\">Run-Time errors occur post the compilation when the program is getting executed. These are the errors that cannot be detected during line-by-line checking by the compiler and are instead found when the code starts running.<\/span><\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>3.&nbsp;Can you name some of the commonly occurring runtime errors?<\/strong><\/h3>\n\n\n\n<p><span style=\"font-weight: 400;font-family: verdana, geneva, sans-serif;font-size: 12pt\">Memory leaks, referencing missing files, dividing by zero, array index out of range, calling invalid functions, etc., are common runtime errors.&nbsp;<\/span><\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>4. What are logical errors?<\/strong><\/h3>\n\n\n\n<p><span style=\"font-weight: 400;font-family: verdana, geneva, sans-serif;font-size: 12pt\">Logical errors are a type of runtime error that are caused due miscalculations in the logic code. These miscalculations would mostly occur due to using the wrong formula in the program or calling the wrong variables. These logical errors result in some or all incorrect outputs from the program.<\/span><\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>5. What are arrays?<\/strong><\/h3>\n\n\n\n<p><span style=\"font-weight: 400;font-family: verdana, geneva, sans-serif;font-size: 12pt\">An array is a type of data structure where multiple memory locations can be assigned to a single variable. Several data elements of the same data type can be assigned under this variable, where each element is stored in a separate memory location.&nbsp;<\/span><\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>6. Can you explain the memory allocation of a dynamic array?<\/strong><\/h3>\n\n\n\n<p><span style=\"font-weight: 400;font-family: verdana, geneva, sans-serif;font-size: 12pt\">Memory allocation for a dynamic array takes place during the runtime of the program. Hence, the size of the dynamic array need not be declared while writing the program itself. Depending on how many elements are added and deleted all through the program, the size of the dynamic array is also continuously adjusted during the runtime of the program.&nbsp;<\/span><\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>7.&nbsp;Is there any difference between a function and a subroutine?<\/strong><\/h3>\n\n\n\n<p><span style=\"font-weight: 400;font-family: verdana, geneva, sans-serif;font-size: 12pt\">In functions, a value is returned to the routine calling the function. Sub-routine is more like executing a set of statements; whenever that sub-routine is called, no value is returned.<\/span><\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>8. What do you know about pointers?<\/strong><\/h3>\n\n\n\n<p><span style=\"font-weight: 400;font-family: verdana, geneva, sans-serif;font-size: 12pt\">Pointers in programming are variables or structures that hold the address of other variables. These pointers are of great advantage as a reference of elements in dynamic memory allocation.<\/span><\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>9.&nbsp;What is the target language of Binary form?<\/strong><\/h3>\n\n\n\n<p><span style=\"font-weight: 400;font-family: verdana, geneva, sans-serif;font-size: 12pt\">The target language of binary form is known as \u201cBinary Code.\u201d<\/span><\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>10. What is a machine code?<\/strong><\/h3>\n\n\n\n<p><span style=\"font-weight: 400;font-family: verdana, geneva, sans-serif;font-size: 12pt\">A machine code can be processed by a microprocessor. There is no need for any previous transformation. Programs are never written directly in machine code.<\/span><\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>11. What Is Object-Oriented Programming?<\/strong><\/h3>\n\n\n\n<p><span style=\"font-weight: 400;font-family: verdana, geneva, sans-serif;font-size: 12pt\">Object-Oriented Programming is a pragmatic approach to software programming where anything that exists physically is considered as an object in the program. Every object can be given its respective attributes through which that object is accessed.&nbsp;<\/span><\/p>\n\n\n\n<p><span style=\"font-weight: 400;font-family: verdana, geneva, sans-serif;font-size: 12pt\">OOPs, based languages can hence break down any software into objects so that the programmer can design and deal with one object at a time.<\/span><\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>12. Name some OOPs based programming languages?<\/strong><\/h3>\n\n\n\n<p><span style=\"font-weight: 400;font-family: verdana, geneva, sans-serif;font-size: 12pt\">C++, Java, JavaScript, .NET, Ruby, Scala, PHP.<\/span><\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>13. Java Programming Interview Questions<\/strong><\/h3>\n\n\n\n<p><span style=\"font-family: verdana, geneva, sans-serif;font-size: 12pt\"><span style=\"font-weight: 400\">Given below are some questions based on java programming that are asked in <\/span>coding <a title=\"https:\/\/www.monsterindia.com\/career-advice\/dot-net-interview-questions-and-answers\/\" href=\"https:\/\/www.monsterindia.com\/career-advice\/dot-net-interview-questions-and-answers\/\">interview questions<\/a><span style=\"font-weight: 400\">;\u00a0<\/span><\/span><\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>14.&nbsp;What are the advantages of Java Programming?<\/strong><\/h3>\n\n\n\n<p><span style=\"font-weight: 400;font-family: verdana, geneva, sans-serif;font-size: 12pt\">Java is less complex in understanding than other programming languages like C++. It is based on object-oriented programming, which simplifies software development. It also permits the formation of standard programs and reusable code. Java is robust, secure, and platform-independent.<\/span><\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>15.&nbsp;What is Java Virtual Machine?<\/strong><\/h3>\n\n\n\n<p><span style=\"font-weight: 400;font-family: verdana, geneva, sans-serif;font-size: 12pt\">Java is platform-independent. Hence, we do not need any external software to run the \u2018.Java\u2019 programming files. Instead, the Java Virtual Machine (JVM) has to be installed. JVM is a standard that works as a virtual machine to enable any computer of any operating system to run Java programs.<\/span><\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>16.&nbsp;What are the major fields where Java programming is used?<\/strong><\/h3>\n\n\n\n<p><span style=\"font-weight: 400;font-family: verdana, geneva, sans-serif;font-size: 12pt\">Java has popular usage in game designing. It has applications where huge backend data on the server side has to be managed. Hence it is used in Android Apps development, creating banking servers, development of web applications, etc.<\/span><\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>17. Do you know anything about Multithreading in Java?<\/strong><\/h3>\n\n\n\n<p><span style=\"font-weight: 400;font-family: verdana, geneva, sans-serif;font-size: 12pt\">Multithreading is a concept in Java where 2 or more parts or routines or tasks of a particular type can be executed simultaneously (i.e., parallelly) instead of the line after line. All the parts of the program or tasks that are parallelly being executed are known as threads.<\/span><\/p>\n\n\n\n<p><span style=\"font-weight: 400;font-family: verdana, geneva, sans-serif;font-size: 12pt\">These threads can be created by manually extending the thread class in Java.<\/span><\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>18. Briefly explain Access Modifiers in Java.<\/strong><\/h3>\n\n\n\n<p><span style=\"font-weight: 400;font-family: verdana, geneva, sans-serif;font-size: 12pt\">There are 4 different types of Access Modifiers in Java.&nbsp;<\/span><\/p>\n\n\n\n<p><span style=\"font-weight: 400;font-family: verdana, geneva, sans-serif;font-size: 12pt\">(1) Private \u2013 The methods or data members declared \u2018private\u2019 can only be accessed within the class in which they are declared. It cannot be accessed outside the class.&nbsp;<\/span><\/p>\n\n\n\n<p><span style=\"font-weight: 400;font-family: verdana, geneva, sans-serif;font-size: 12pt\">(2) Protected \u2013 Here, access is granted within the package. The methods with a &#8216;protected&#8217; access modifier cannot be accessed outside the package, with the exception of access through child class.<\/span><\/p>\n\n\n\n<p><span style=\"font-weight: 400;font-family: verdana, geneva, sans-serif;font-size: 12pt\">(3) Default \u2013 When no access modifier is specified, then it is considered as default. The access level is only within the package; there are no other exceptions.<\/span><\/p>\n\n\n\n<p><span style=\"font-weight: 400;font-family: verdana, geneva, sans-serif;font-size: 12pt\">(4) Public \u2013 The public methods or data elements are universal. They can be accessed within the class, outside the class, within the package, and outside the package.<\/span><\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>19. Do we have pointers in Java?<\/strong><\/h3>\n\n\n\n<p><span style=\"font-weight: 400;font-family: verdana, geneva, sans-serif;font-size: 12pt\">No, we do not have pointers as Java doesn\u2019t support pointers directly. But pointers are used internally in the form of references that point to objects in the Java program.<\/span><\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>20. What is Garbage Collection in Java?<\/strong><\/h3>\n\n\n\n<p><span style=\"font-weight: 400;font-family: verdana, geneva, sans-serif;font-size: 12pt\">While running a Java program, there may be many objects created which are of no use in running the program. All such programs are automatically destroyed during the runtime, and this process is known as garbage collection. This is an internal process; the programmer need not play any role in this.<\/span><\/p>\n\n\n\n<p><span style=\"font-weight: 400;font-family: verdana, geneva, sans-serif;font-size: 12pt\">The garbage collection process is done by the garbage collector software of Java, a part of the Java Virtual Machine (JVM).&nbsp;&nbsp;<\/span><\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>21. What is an exception? How is exception handling done in Java?<\/strong><\/h3>\n\n\n\n<p><span style=\"font-weight: 400;font-family: verdana, geneva, sans-serif;font-size: 12pt\">An exception is an unexpected event that occurs during the execution of a Java program, spoiling the entire logical flow of the program. The easiest way for Exception Handling in Java is the try-catch method. The block of code in which exceptions may occur is placed in a try block, followed by a series of catch blocks. Java exceptions thrown by the code can then be caught by one or more of those catch blocks.<\/span><\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>22. What is the significance of throws and throw keywords in exception handling?<\/strong><\/h3>\n\n\n\n<p><span style=\"font-weight: 400;font-family: verdana, geneva, sans-serif;font-size: 12pt\">Using the throws keyword in a method indicates that this particular method may raise an exception during its execution.<\/span><\/p>\n\n\n\n<p><span style=\"font-weight: 400;font-family: verdana, geneva, sans-serif;font-size: 12pt\">On the other hand, the throw keyword is used to interrupt the flow of the program or a particular block of code by throwing an exception object.<\/span><\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>23. What is JavaScript?<\/strong><\/h3>\n\n\n\n<p><span style=\"font-weight: 400;font-family: verdana, geneva, sans-serif;font-size: 12pt\">JavaScript is an OOPs based programming language that is designed to primarily be used in web development. It is a lightweight, interpreted language consisting of many in-built functions that simplify the programmer&#8217;s work during creating and managing dynamic website content.<\/span><\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>24. Interview Questions on Data Structures<\/strong><\/h3>\n\n\n\n<p><span style=\"font-family: verdana, geneva, sans-serif;font-size: 12pt\"><span style=\"font-weight: 400\">A candidate can be expected to answer questions based on Data Structures while answering <\/span>coding interview questions<span style=\"font-weight: 400\">.<\/span><\/span><\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>25. What are data structures?<\/strong><\/h3>\n\n\n\n<p><span style=\"font-weight: 400;font-family: verdana, geneva, sans-serif;font-size: 12pt\">Data structures are the various ways in which data can be organized and stored inside the memory so that operations on the data can be performed most effectively. Every type of data structure has a particular style that suits a specific purpose. The style differs depending on how data inside the data structures can be inserted, deleted, or sorted.&nbsp;<\/span><\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>26. Name the 4 basic forms of data structures.<\/strong><\/h3>\n\n\n\n<p><span style=\"font-weight: 400;font-family: verdana, geneva, sans-serif;font-size: 12pt\">Linear: Lists, Arrays<\/span><\/p>\n\n\n\n<p><span style=\"font-weight: 400;font-family: verdana, geneva, sans-serif;font-size: 12pt\">Tree: Binary, Space Partitioning, Heaps, etc.<\/span><\/p>\n\n\n\n<p><span style=\"font-weight: 400;font-family: verdana, geneva, sans-serif;font-size: 12pt\">Hash: Hash Tree, Distributed Hash Table, etc.<\/span><\/p>\n\n\n\n<p><span style=\"font-weight: 400;font-family: verdana, geneva, sans-serif;font-size: 12pt\">Graphs: Directed, Decision, Acyclic, etc.<\/span><\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>27.&nbsp;What are the commonly used data structures?<\/strong><\/h3>\n\n\n\n<p><span style=\"font-weight: 400;font-family: verdana, geneva, sans-serif;font-size: 12pt\">Arrays, Queues, Linked Lists, Priority Queues, Trees,&nbsp; Stacks, Binary Trees, and Hash Tables.<\/span><\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>28. What is a LIFO Structure?<\/strong><\/h3>\n\n\n\n<p><span style=\"font-weight: 400;font-family: verdana, geneva, sans-serif;font-size: 12pt\">LIFO means last-in-first-out. The stack-type data structures are based on the LIFO concept. One element at a time can be pushed into the stack data structure, and they are placed on one top of the other in such a way that the last element pushed inside is the first element to come out of the stack. Hence, this is called LIFO structure, as the element last entered into the stack is the first one to come out of the stack.&nbsp;<\/span><\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>29. How is a binary search tree implemented?<\/strong><\/h3>\n\n\n\n<p><span style=\"font-weight: 400;font-family: verdana, geneva, sans-serif;font-size: 12pt\">Implementation of binary search is done by following 4 rules:&nbsp;<\/span><\/p>\n\n\n\n<p><span style=\"font-weight: 400;font-family: verdana, geneva, sans-serif;font-size: 12pt\">(1) The nodes of a left subtree should contain keys that are lesser than its parent node\u2019s key.&nbsp;<\/span><\/p>\n\n\n\n<p><span style=\"font-weight: 400;font-family: verdana, geneva, sans-serif;font-size: 12pt\">(2) The nodes of a right subtree should contain keys that are greater than its parent node\u2019s key.&nbsp;<\/span><\/p>\n\n\n\n<p><span style=\"font-weight: 400;font-family: verdana, geneva, sans-serif;font-size: 12pt\">(3) The left and right subtrees should also be binary search trees.&nbsp;<\/span><\/p>\n\n\n\n<p><span style=\"font-weight: 400;font-family: verdana, geneva, sans-serif;font-size: 12pt\">(4) There must be no duplicated nodes.<\/span><\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>30. What are Singly Linked Lists?<\/strong><\/h3>\n\n\n\n<p><span style=\"font-weight: 400;font-family: verdana, geneva, sans-serif;font-size: 12pt\">Singly Linked Lists are unidirectional linked lists, i.e., they can also be traversed in one direction, from the first node (head) to the last node (tail). The traversing from tail to head is not possible in Singly Linked Lists.&nbsp;<\/span><\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>31.&nbsp;What is the difference between the implementation of pre-order, postorder, and in-order traversals?<\/strong><\/h3>\n\n\n\n<p><span style=\"font-weight: 400;font-family: verdana, geneva, sans-serif;font-size: 12pt\">Pre-order, postorder and in-order traversal are various ways of traversing in non-linear data structures like trees. Every tree has a root node and 2 child nodes (left node and right nodes). Each of these left and right nodes would again have one or 2 child nodes, and the process continues. The classification on traversal is made based on the path in which the root node, the left node, and the right node are traversed.<\/span><\/p>\n\n\n\n<p><span style=\"font-weight: 400;font-family: verdana, geneva, sans-serif;font-size: 12pt\">In Order Traversal \u2013 Left node, the root node, and right node.<\/span><\/p>\n\n\n\n<p><span style=\"font-weight: 400;font-family: verdana, geneva, sans-serif;font-size: 12pt\">Pre-Order Traversal \u2013 Root node, left node, and right node.<\/span><\/p>\n\n\n\n<p><span style=\"font-weight: 400;font-family: verdana, geneva, sans-serif;font-size: 12pt\">Post-Order Traversal \u2013 Left node, Right node, and the root node.<\/span><\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>32. Give 3 real-life applications of stacks, queues, and trees.<\/strong><\/h3>\n\n\n\n<p><span style=\"font-weight: 400;font-family: verdana, geneva, sans-serif;font-size: 12pt\">Stacks Data Structure \u2013 Undo operation, forward and backward surfing in a browser, history of visited websites.<\/span><\/p>\n\n\n\n<p><span style=\"font-weight: 400;font-family: verdana, geneva, sans-serif;font-size: 12pt\">Queues Data Structure \u2013 Job Scheduling inside an operating system, arrangement of data packets in any communication protocol, downloading a series of photos or videos.<\/span><\/p>\n\n\n\n<p><span style=\"font-weight: 400;font-family: verdana, geneva, sans-serif;font-size: 12pt\">Trees Data Structure \u2013 XML Parser, BST used in computer graphics, the domain name server (DNS).&nbsp;<\/span><\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Interview Questions on Sorting Algorithms<\/strong><\/h2>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>1. List the various types of Sorting algorithms.<\/strong><\/h3>\n\n\n\n<p><span style=\"font-weight: 400;font-family: verdana, geneva, sans-serif;font-size: 12pt\">Merge Sort, Bubble Sort, Quick Sort, Insertion Sort, Heap Sort, Selection Sort, Radix Sort, and Bucket Sort.<\/span><\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>2. What is a Bubble Sort Algorithm?<\/strong><\/h3>\n\n\n\n<p><span style=\"font-weight: 400;font-family: verdana, geneva, sans-serif;font-size: 12pt\">It&nbsp; is an easy to use sorting algorithm used on linear data structures like linked lists or queues. This sorting algorithm compares two adjacent elements and swaps them (sorts them) if they are not in order. This is hence time taking as only two elements at a time can be compared.<\/span><\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>3. How to implement an Insertion Sort Algorithm?&nbsp;<\/strong><\/h3>\n\n\n\n<p><span style=\"font-weight: 400;font-family: verdana, geneva, sans-serif;font-size: 12pt\">Initially, the first element is compared with its adjacent element. If the comparison reveals that the first element has to be placed after the second element, then space is created after the second element, and the first element is now inserted in that space. The element in this new space is now compared with the third element, and the process continues until all the elements are sorted into correct places.<\/span><\/p>\n\n\n\n<p><span style=\"font-weight: 400;font-family: verdana, geneva, sans-serif;font-size: 12pt\">Insertion sort algorithm is similar to sorting a deck of cards to arrange them from Ace to King.<\/span><\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>4. What is the difference between a bubble sort and a merge sort algorithm?<\/strong><\/h3>\n\n\n\n<p><span style=\"font-weight: 400;font-family: verdana, geneva, sans-serif;font-size: 12pt\">A major difference between the bubble sort and merge sort algorithms is their time complexity. Bubble sort is an iterative procedure where the process of comparing two adjacent elements at a time goes on until all the elements are completed. Merge sort on the other side is a recursive procedure where the input array is divided into 2 halves, each of those halves are further divided into 2 halves, and so on goes on until all the elements are sorted, after which they are again merged.<\/span><\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>5.&nbsp;When is a bucket sort algorithm used?<\/strong><\/h3>\n\n\n\n<p><span style=\"font-weight: 400;font-family: verdana, geneva, sans-serif;font-size: 12pt\">The bucket sort algorithm is mainly used when the inputs in the data structure are uniformly distributed over a range or when some inputs have floating-point values.<\/span><\/p>\n\n\n\n<p> <strong>Also Read:<\/strong> <a href=\"https:\/\/www.monsterindia.com\/career-advice\/sql-query-interview-questions-and-answers\/\">SQL Query Interview Questions and Answers<\/a><\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Interview Questions on Basics of Database Management<\/strong><\/h2>\n\n\n\n<p><span style=\"font-family: verdana, geneva, sans-serif;font-size: 12pt\"><span style=\"font-weight: 400\">While attempting to answer <\/span>coding interview questions,<span style=\"font-weight: 400\"> a candidate will come across several Database Management questions, some of which are;<\/span><\/span><\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>1. What is a database?<\/strong><\/h3>\n\n\n\n<p><span style=\"font-weight: 400;font-family: verdana, geneva, sans-serif;font-size: 12pt\">A database is an organized collection of structured information or data which is virtually stored in a computer or a cloud server.&nbsp;<\/span><\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>2. What is a Database Management System?<\/strong><\/h3>\n\n\n\n<p><span style=\"font-weight: 400;font-family: verdana, geneva, sans-serif;font-size: 12pt\">Database Management System (DBMS) is software that works as an interface between the user and the database stored in the computer or cloud. It also manages and sorts the huge amounts of data that is being constantly uploaded into the server.<\/span><\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>3. What are the various types of databases?<\/strong><\/h3>\n\n\n\n<p><span style=\"font-weight: 400;font-family: verdana, geneva, sans-serif;font-size: 12pt\">A centralized database, distributed database, personal database, end-user database, commercial database, operational database, relational database, cloud database, etc.<\/span><\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>4.&nbsp;What is RDBMS?<\/strong><\/h3>\n\n\n\n<p><span style=\"font-weight: 400;font-family: verdana, geneva, sans-serif;font-size: 12pt\">Relational Database Management System is a type of DBMS where data records and indices are maintained in tables. Storing data in tables is advantageous as many operations, like update, insert, delete, manipulate, can be performed very easily on the data.<\/span><\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>5.&nbsp;What is SQL?<\/strong><\/h3>\n\n\n\n<p><span style=\"font-weight: 400;font-family: verdana, geneva, sans-serif;font-size: 12pt\"><a href=\"https:\/\/www.monsterindia.com\/career-advice\/sql-interview-questions-for-data-analyst-fresher\/\" title=\"https:\/\/www.monsterindia.com\/career-advice\/sql-interview-questions-for-data-analyst-fresher\/\">Structured Query Language (SQL)<\/a> is a domain-specific programming language. It is designed as a user-friendly language for managing data inside the database management systems.<\/span><\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Conclusion:&nbsp;<\/strong><\/h2>\n\n\n\n<p><span style=\"font-family: verdana, geneva, sans-serif;font-size: 12pt\"><span style=\"font-weight: 400\">A key point to always remember during the preparation of <\/span>coding interview questions<span style=\"font-weight: 400\"> is that learning a little of all topics in coding is more useful than learning one particular programming language in-depth. Hence, every graduate student should put an equal amount of concentration on all the various topics like C, Java, Python, DBMS, data structures, etc.<\/span><\/span><\/p>\n\n\n\n<p><span style=\"font-family: verdana, geneva, sans-serif;font-size: 12pt\"><span style=\"font-weight: 400\">More Resources : <a title=\"Part time job openings in Indore\" href=\"https:\/\/www.monsterindia.com\/search\/part-time-jobs-in-indore\" target=\"_blank\" rel=\"noopener\">Part time job openings in Indore<\/a> | <a title=\"Part time job openings in Surat\" href=\"https:\/\/www.monsterindia.com\/search\/part-time-jobs-in-surat\" target=\"_blank\" rel=\"noopener\">Part time job openings in Surat<\/a>&nbsp;| <a href=\"https:\/\/www.monsterindia.com\/career-advice\/40-sales-interview-questions-and-answers\/\" target=\"_blank\" data-type=\"URL\" data-id=\"https:\/\/www.monsterindia.com\/career-advice\/40-sales-interview-questions-and-answers\/\" rel=\"noreferrer noopener\">Sales Interview questions<\/a> | <a href=\"https:\/\/www.monsterindia.com\/career-advice\/bpo-interview-questions-and-answers-for-freshers\/\" target=\"_blank\" data-type=\"URL\" data-id=\"https:\/\/www.monsterindia.com\/career-advice\/bpo-interview-questions-and-answers-for-freshers\/\" rel=\"noreferrer noopener\">BPO interview questions&nbsp;<\/a><\/span><\/span><\/p>\n","protected":false},"excerpt":{"rendered":"<p>With abundant developments in the field of software, the need for programming employees is also increasing rapidly. Every year hundreds of graduating students are attending programming interviews and coding interviews to get into the field of software. It is not just practical coding, but it is also important to quickly answer basic coding interview questions.&nbsp; [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":9842,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"footnotes":""},"categories":[147],"tags":[],"class_list":{"0":"post-9442","1":"post","2":"type-post","3":"status-publish","4":"format-standard","5":"has-post-thumbnail","7":"category-interview-questions"},"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/www.foundit.sg\/career-advice\/wp-json\/wp\/v2\/posts\/9442","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.foundit.sg\/career-advice\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.foundit.sg\/career-advice\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.foundit.sg\/career-advice\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.foundit.sg\/career-advice\/wp-json\/wp\/v2\/comments?post=9442"}],"version-history":[{"count":5,"href":"https:\/\/www.foundit.sg\/career-advice\/wp-json\/wp\/v2\/posts\/9442\/revisions"}],"predecessor-version":[{"id":15494,"href":"https:\/\/www.foundit.sg\/career-advice\/wp-json\/wp\/v2\/posts\/9442\/revisions\/15494"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.foundit.sg\/career-advice\/wp-json\/wp\/v2\/media\/9842"}],"wp:attachment":[{"href":"https:\/\/www.foundit.sg\/career-advice\/wp-json\/wp\/v2\/media?parent=9442"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.foundit.sg\/career-advice\/wp-json\/wp\/v2\/categories?post=9442"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.foundit.sg\/career-advice\/wp-json\/wp\/v2\/tags?post=9442"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}