{"id":28849,"date":"2022-08-29T10:00:48","date_gmt":"2022-08-29T14:00:48","guid":{"rendered":"https:\/\/simpleprogrammer.com\/?p=28849"},"modified":"2026-03-11T01:50:43","modified_gmt":"2026-03-11T01:50:43","slug":"programming-interview-questions","status":"publish","type":"post","link":"https:\/\/simpleprogrammer.com\/programming-interview-questions\/","title":{"rendered":"Top 109 Scary Coding Interview Questions SOLVED with Answers"},"content":{"rendered":"<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-41707\" src=\"https:\/\/simpleprogrammer.com\/wp-content\/uploads\/2018\/04\/Programming-Interview-Questions.jpg\" alt=\"Programming Interview Questions\" width=\"1700\" height=\"1133\" srcset=\"https:\/\/simpleprogrammer.com\/wp-content\/uploads\/2018\/04\/Programming-Interview-Questions.jpg 1700w, https:\/\/simpleprogrammer.com\/wp-content\/uploads\/2018\/04\/Programming-Interview-Questions-300x200.jpg 300w, https:\/\/simpleprogrammer.com\/wp-content\/uploads\/2018\/04\/Programming-Interview-Questions-1024x682.jpg 1024w, https:\/\/simpleprogrammer.com\/wp-content\/uploads\/2018\/04\/Programming-Interview-Questions-768x512.jpg 768w, https:\/\/simpleprogrammer.com\/wp-content\/uploads\/2018\/04\/Programming-Interview-Questions-1536x1024.jpg 1536w\" sizes=\"auto, (max-width: 1700px) 100vw, 1700px\" \/><\/p>\n<p><span style=\"font-weight: 400;\">I know the feeling.<\/span><\/p>\n<p><strong>You\u2019re before a big coding interview.<\/strong><\/p>\n<p><span style=\"font-weight: 400;\">Yeah, you\u2019ve got your education. <a href=\"https:\/\/simpleprogrammer.com\/step-step-path-becoming-great-software-developer\/\">You&#8217;ve become a software developer to the best of your ability<\/a>. You\u2019ve been putting in the coding reps.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">But still.. Now, months or weeks before the big day..<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Suddenly you\u2019re starting to feel.. clueless. And to be honest \u2013 a bit scared.. or more than a bit!<\/span><\/p>\n<p><i><span style=\"font-weight: 400;\">[pullquote align=&#8221;normal&#8221;]<\/span><\/i><span style=\"font-weight: 400;\"><strong>What will those <em>mean recruiters<\/em> ask you?<\/strong><\/span><i><span style=\"font-weight: 400;\"> [\/pullquote]<\/span><\/i><\/p>\n<p><span style=\"font-weight: 400;\">I\u2019ve been through many coding interviews. More recently I\u2019ve been on the other side, too \u2013 as an interviewer. I\u2019ve even <a href=\"https:\/\/www.amazon.com\/Programming-Interviews-Dummies-Eric-Jones\/dp\/1119565022&amp;linkCode=ll2&amp;tag=makithecompsi-20&amp;linkId=9025e72add75709284960cfdd6fd40eb&amp;language=en_US&amp;ref_=as_li_ss_tl\">written a book<\/a> <\/span><span style=\"font-weight: 400;\">all about programming interviews.<\/span><\/p>\n<h2>Why are coding interviews so hard?<\/h2>\n<p><span style=\"font-weight: 400;\">Coding interviews ARE getting harder. Programmers are studying more to prepare. It\u2019s getting more competitive. Interviewers adapt &#8212; by asking harder questions.<\/span><\/p>\n<p>Also, it&#8217;s just stressful to code under pressure. And the questions are often kept <a href=\"https:\/\/triplebyte.com\/blog\/interview-questions-are-too-hard-and-too-short\">too short<\/a> to be used as a useful <a href=\"https:\/\/simpleprogrammer.com\/prepare-technical-phone-screen-interview\/\">screening<\/a> tool. Instead they&#8217;re tripping up even good coders.<\/p>\n<p><span style=\"font-weight: 400;\">But&#8230; <u>if you\u2019re smart and disciplined about preparing, you can still dominate that interview<\/u>!<\/span><\/p>\n<h2><b>Study these questions inside-out.<\/b><\/h2>\n<p><span style=\"font-weight: 400;\">Today I\u2019ll spill the secret on the questions you face during a <\/span><span style=\"font-weight: 400;\">coding interview<\/span><span style=\"font-weight: 400;\"> and how you tackle them successfully.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">To <a href=\"https:\/\/simpleprogrammer.com\/10-developer-job-interview-tips-to-land-the-best-job-you-can\/\">ace your programming interview<\/a>, you need to prepare with real programming interview questions. Practice on real problems and learn their patterns.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">You\u2019ll impress the interviewers with your informed, to-the-point answers, to where <\/span><i><span style=\"font-weight: 400;\">they\u2019d be dumb not to hire you<\/span><\/i><span style=\"font-weight: 400;\">.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">The world needs more great programmers (YOU!!) with well-paid jobs \u2013 so you can keep making the world a better place.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">I sincerely wish that for you.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Good luck![blank_space height=&#8217;0.1em&#8217;]<\/span><\/p>\n<p><span style=\"font-weight: 400;\">[blank_space height=&#8217;0.1em&#8217;]<\/span><\/p>\n<h2>The 5 Types of Coding Interview Questions to Master<\/h2>\n<p><span style=\"font-weight: 400;\">Take a moment.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Put on the shoes of who\u2019s asking you the coding interview questions.<\/span><\/p>\n<p><em><span style=\"font-weight: 400;\">Recruiters want <\/span><span style=\"font-weight: 400;\">the full picture<\/span><\/em><span style=\"font-weight: 400;\">. <\/span><span style=\"font-weight: 400;\">They want to know about:<\/span><\/p>\n<ol>\n<li><span style=\"font-weight: 400;\">your <\/span><b>CODING KNOWLEDGE<\/b><span style=\"font-weight: 400;\"> about basic programming concepts[blank_space height=&#8217;1em&#8217;]<\/span><\/li>\n<li><span style=\"font-weight: 400;\">y<\/span>our<b> CODING SKILLS<\/b>, mostly related to <i>data structures<\/i> (arrays, strings, linked lists, binary trees..),<i>\u00a0concepts <\/i>(bit manipulation, design patterns..)<i> &amp;<\/i><i> algorithms[blank_space height=&#8217;1em&#8217;]<\/i><\/li>\n<li>your<b> LOGICAL ABILITY<\/b> in general. Sure,\u00a0 intelligence is mostly inherited. But anyone can work to get everything out of their God-given level of intelligence: By practicing logic puzzles and refining their logic skills. [blank_space height=&#8217;1em&#8217;]<\/li>\n<li><span style=\"font-weight: 400;\">your<\/span><b> PROBLEM SOLVING PROCESS<\/b><span style=\"font-weight: 400;\"> \u2013 it\u2019s what makes you <\/span><span style=\"font-weight: 400;\">a good programmer vs. \u201cjust a coder\u201d[blank_space height=&#8217;1em&#8217;]<\/span><\/li>\n<li><span style=\"font-weight: 400;\">your<\/span><b> PERSONALITY<\/b><span style=\"font-weight: 400;\"> \u2013 and how well it fits their company\u2019s culture &amp; goals. These are the so-called \u201cbehavioral\u201d interview questions.[blank_space height=&#8217;0.5em&#8217;]<\/span><\/li>\n<\/ol>\n<p><strong>The 5 categories:<\/strong><\/p>\n<ol>\n<li><span style=\"font-weight: 400;\"><a href=\"#basic\">Coding knowledge<\/a><\/span><\/li>\n<li><span style=\"font-weight: 400;\"><a href=\"#datastructures\">Coding skills<\/a><\/span><\/li>\n<li><span style=\"font-weight: 400;\"><a href=\"#logic\">Logical ability<\/a><\/span><\/li>\n<li><span style=\"font-weight: 400;\"><a href=\"#problemsolving\">Problem-solving<\/a><\/span><\/li>\n<li><span style=\"font-weight: 400;\"><a href=\"#behavioral\">Personality<\/a><\/span><\/li>\n<\/ol>\n<p><span style=\"font-weight: 400;\">Prepare yourself for questions in each of these areas. You\u2019ll know what\u2019s coming, and you\u2019ll be able to give a smart answer.\u00a0<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Show up to your programming interview (in-person or <a href=\"https:\/\/simpleprogrammer.com\/video-interviews-dream-remote-job\/\">via video<\/a>) well-prepared for these types of questions.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">It\u2019s your chance to outshine the other candidates.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Now, on to the <\/span><i><span style=\"font-weight: 400;\">5 types of coding interview questions you need to master<\/span><\/i><span style=\"font-weight: 400;\">: [blank_space height=&#8217;0.1em&#8217;]<\/span><\/p>\n<h3 id=\"basic\"><span style=\"font-weight: 400;\">1. Basic programming interview questions\u00a0<\/span><\/h3>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignleft wp-image-41423\" src=\"https:\/\/simpleprogrammer.com\/wp-content\/uploads\/2022\/08\/Basic-Programming-Interview-Questions.png\" alt=\"Basic Programming Interview Questions\" width=\"115\" height=\"130\" \/><\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p><span style=\"font-weight: 400;\">Early in the interview (and also throughout), interviewers are looking to test you on your programming fundamentals. <\/span><\/p>\n<p>These are questions on general programming terms, concepts, and functions.<\/p>\n<p><span style=\"font-weight: 400;\">If you struggle on the basics, they\u2019ll be able to quickly cross you off the list of job prospects.\u00a0<\/span><\/p>\n<p><strong>Coding Interview Questions for Freshers<\/strong><\/p>\n<p>If you&#8217;re a fresher looking forward to your first coding interviews, start with the more basic questions in this article. Once you&#8217;ve mastered them, you can move on to more difficult questions, problems, and puzzles. Work on the &#8220;freshers&#8221; questions first, and you&#8217;ll be ready for the most advanced stuff. But it all builds on the basics!<\/p>\n<p><i><span style=\"font-weight: 400;\">So make sure you understand these basic programming concepts:<\/span><\/i><\/p>\n<h4><span style=\"font-weight: 400;\">The Top 13 General Coding, Design &amp; Programming Fundamentals Questions<\/span><\/h4>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-41424\" src=\"https:\/\/simpleprogrammer.com\/wp-content\/uploads\/2022\/08\/General-Coding-Questions.png\" alt=\"General Coding Questions\" width=\"210\" height=\"140\" \/><\/p>\n<p><span style=\"font-weight: 400;\">See how many of these questions you can answer in a row without slowing down.<\/span><\/p>\n<p><strong>1. What are the pros and cons of your chosen technology?<\/strong><\/p>\n<p>If your favorite technology is Node.js, for example &#8212; you need to be able to answer this technical question <span style=\"font-weight: 400;\">thoroughly because it&#8217;s going to show your depth of knowledge in this specific area. <\/span><\/p>\n<p><span style=\"font-weight: 400;\">And since you&#8217;re more likely going to be <a href=\"https:\/\/simpleprogrammer.com\/javascript-interview-questions\/\">interviewing for a Node.js job<\/a>, pros and cons are often overlooked. And people just go, oh yeah, I use <a href=\"https:\/\/simpleprogrammer.com\/angular-interview-questions-and-answers\/\">JavaScript<\/a>. I use Node. They don&#8217;t actually know the pros to use it, and they don&#8217;t actually know the cons. And when they give answers, they might just say, \u201cOh yeah. Object oriented. Oh yeah. Great with memory.\u201d<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Don&#8217;t be vague. Be to the point. <\/span><\/p>\n<p><span style=\"font-weight: 400;\">Find some pros and cons of your technology,\u00a0<\/span><span style=\"font-weight: 400;\">and better yet, find pros and cons of anything on your resume.<\/span><\/p>\n<p><strong>2. What are variables? <\/strong> Without variables, you don\u2019t have a program. Variables are values that change within a program, based on the overall conditions and the \u201cwork\u201d the program is doing. Variables are values stored or \u201cdeclared\u201d within the program and represent the working data set for the program. Variables = data sets + algorithms.<\/p>\n<p><strong>3. <b>What is inheritance? <\/b><\/strong><\/p>\n<p>Inheritance is one of the\u00a0core concepts of object-oriented programming\u00a0(OOP) languages. It is a mechanism where you can to derive a class from another class for a hierarchy of classes that share a set of attributes and methods.<\/p>\n<p>You can use it to\u00a0declare different kinds of exceptions, add custom logic to existing frameworks, and even map your domain model to a database.\u00a0 (<a href=\"https:\/\/stackify.com\/oop-concept-inheritance\/\">Source<\/a>)<\/p>\n<p><strong>4. <b>What is polymorphism? <\/b><\/strong><\/p>\n<p><a href=\"https:\/\/simpleprogrammer.com\/java-program\"><span style=\"font-weight: 400;\">Polymorphism<\/span><\/a><span style=\"font-weight: 400;\"> allows new objects in programming to assume the properties of existing objects. The object providing the inherited characteristics is known as a \u201cbase class\u201d or \u201csuperclass.\u201d<\/span><\/p>\n<p><span style=\"font-weight: 400;\">This is a program\u2019s ability to process an object differently, according to its type or class. Picture a car versus a tank. Polymorphism would be a system that provides a blueprint for the systems they have in common and works across both types of vehicle.<\/span><\/p>\n<p><strong>5. <b>What are pointers? <\/b><\/strong><\/p>\n<p><span style=\"font-weight: 400;\">Pointers contain memory addresses for other values. Manipulating pointers can save time versus manipulating the data the pointers refer to. This can be an efficient way to write programs that manipulate data.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Pointers are used often in C, but less so in Java.<\/span><\/p>\n<p><strong>6. <b>Name four types of storage classes.<\/b><b>\u00a0<\/b><\/strong><\/p>\n<p><span style=\"font-weight: 400;\">Register, static, external, and automatic.<\/span><\/p>\n<ol>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><b>Register:<\/b><span style=\"font-weight: 400;\"> These are storage classes kept in the register of the central processing unit.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><b>Static:<\/b><span style=\"font-weight: 400;\"> This is a storage class in which the variable does not change. It is declared at the beginning stages of the programming task.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><b>External:<\/b><span style=\"font-weight: 400;\"> A storage class local to a piece of hardware, such as device drivers. These say to the compiler: \u201cIf I need this variable again, read it from the external device for the most current value.\u201d<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><b>Automatic:<\/b><span style=\"font-weight: 400;\"> A storage class in which blocks or functions define local variables.<\/span><\/li>\n<\/ol>\n<p><strong>7. <b>What is encapsulation?<\/b><b>\u00a0<\/b><\/strong><\/p>\n<p><span style=\"font-weight: 400;\">This is one of the most important concepts in object-oriented design. It involves bundling together a class with a set of instructions. In encapsulation, an object includes not just its data but also functions that can mutate that data. Encapsulation may be used to hide the nature of the data while still facilitating interaction.<\/span><\/p>\n<p><strong>8. <b>Name seven data types.<\/b><b>\u00a0<\/b><\/strong><\/p>\n<ol>\n<li><strong>Floating point<\/strong><\/li>\n<li><strong>Integer<\/strong><\/li>\n<li><strong>String<\/strong><\/li>\n<li><strong>Float<\/strong><\/li>\n<li><strong>Real<\/strong><\/li>\n<li><strong>Character<\/strong><\/li>\n<li><strong>Boolean<\/strong><\/li>\n<\/ol>\n<p><strong>9. <b>Name six <em>data structure<\/em> types.<\/b><b>\u00a0<\/b><\/strong><\/p>\n<ol>\n<li><strong>Linked lists<\/strong><\/li>\n<li><strong>Files<\/strong><\/li>\n<li><strong>Stacks<\/strong><\/li>\n<li><strong>Queues<\/strong><\/li>\n<li><strong>Trees<\/strong><\/li>\n<li><strong>Graphs<\/strong><\/li>\n<\/ol>\n<p><strong>10. <b>What is the difference between a \u201cdeclaration\u201d and a \u201cdefinition\u201d of a particular function or variable?<\/b><b>\u00a0<\/b><\/strong><\/p>\n<p><span style=\"font-weight: 400;\">A declaration involves the type and function of an identifier and describes what the linker requires to reference it. A definition describes what the compiler needs to do to interact with the identifier. Sometimes a declaration provides an initial value, and sometimes the definition provides the value.<\/span><\/p>\n<p><strong>11. <\/strong><b>What is the difference between an interpreter and a compiler?<\/b><strong><b>\u00a0<\/b><\/strong><\/p>\n<p><span style=\"font-weight: 400;\">An interpreter executes commands directly, while a compiler converts those commands (the program) from source code to machine code. Compiled programs run faster than interpretive languages and can be used at scale.<\/span><\/p>\n<ul>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Interpretive language examples: Basic, Korn Shell, Ruby, Python<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Compiler language examples: Java, C++<\/span><\/li>\n<\/ul>\n<p><strong>12. <b>What are the functions of object-oriented design?<\/b><b>\u00a0<\/b><\/strong><\/p>\n<ol>\n<li><strong>Encapsulation<\/strong><\/li>\n<li><strong>Polymorphism<\/strong><\/li>\n<li><strong>Inheritance<\/strong><\/li>\n<li><strong>Abstraction<\/strong><\/li>\n<\/ol>\n<p><strong>13. <b>What is a real-time operating system?<\/b><b>\u00a0<\/b><\/strong><\/p>\n<p><span style=\"font-weight: 400;\">A real-time operating system (OS) processes data as it becomes available, without a buffering period.<\/span><\/p>\n<ul>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Example of a real-time OS: Controlling factory machinery in real-time. Not necessarily instant, but essentially on-demand.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Examples of non-real-time OS: Windows and macOS. Response time is not as important.<\/span><\/li>\n<\/ul>\n<p><span style=\"font-weight: 400;\">[blank_space height=&#8217;0.1em&#8217;]<\/span><\/p>\n<h3 id=\"datastructures\"><span style=\"font-weight: 400;\">2. Data structures &amp; algorithms interview questions and answers<\/span><\/h3>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignleft wp-image-41422\" src=\"https:\/\/simpleprogrammer.com\/wp-content\/uploads\/2022\/08\/datastructuresandalgorithms.png\" alt=\"data structures and algorithms\" width=\"145\" height=\"150\" \/><\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p><span style=\"font-weight: 400;\">You need to know Data Structure and Algorithm inside-out.<\/span><\/p>\n<p><span style=\"font-weight: 400;\"> Yes, you&#8217;ll learn a lot of new concepts by simply attempting to solve these questions.\u00a0 I still suggest you first refresh your knowledge of Data Structure and Algorithms before you dive head-first into the questions!<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Make sure you can create them from scratch. The questions about them may be basic or not \u2013 the more you\u2019re able to create them from scratch, the more easily you can answer any interview question about them, whether basic or not so basic.<\/span><\/p>\n<h4>How to approach any technical programming question<\/h4>\n<ol>\n<li><span style=\"font-weight: 400;\">Ask questions. <\/span><\/li>\n<li><span style=\"font-weight: 400;\">Create an algorithm. <\/span><\/li>\n<li><span style=\"font-weight: 400;\">Write \u201cPseudo\u201d code first. <\/span><\/li>\n<li><span style=\"font-weight: 400;\">Write your code without rushing. <\/span><\/li>\n<li><span style=\"font-weight: 400;\">Test your code \u2013 thoughtfully fix mistakes.<\/span><\/li>\n<\/ol>\n<p><span style=\"font-weight: 400;\"> (This is the process outlined in the classic <\/span><a href=\"https:\/\/www.amazon.com\/Cracking-Coding-Interview-Programming-Questions\/dp\/0984782869?&amp;linkCode=ll2&amp;tag=makithecompsi-20&amp;linkId=9025e72add75709284960cfdd6fd40eb&amp;language=en_US&amp;ref_=as_li_ss_tl\"><span style=\"font-weight: 400;\">Cracking the Coding interview<\/span><\/a><span style=\"font-weight: 400;\"> by Gayle Laakmann)<\/span><\/p>\n<h4>Database questions: The Top 7<\/h4>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"wp-image-41402 alignleft\" src=\"https:\/\/simpleprogrammer.com\/wp-content\/uploads\/2022\/08\/database-1954920_1280.jpg\" alt=\"\" width=\"200\" height=\"131\" \/><\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p><span style=\"font-weight: 400;\">Coding for databases might involve using languages such as <a href=\"https:\/\/simpleprogrammer.com\/top-python-interview-questions\/\">Python<\/a>, Java, and C# to build and implement <a href=\"https:\/\/simpleprogrammer.com\/magento-interview-questions\/\">web-based<\/a>, cloud-based, and mobile applications that individuals and organizations can use to interact with collections of information. <\/span><\/p>\n<p><span style=\"font-weight: 400;\">Not every programming career will require expertise in database management systems. <\/span><\/p>\n<p><span style=\"font-weight: 400;\">But it doesn\u2019t hurt to learn the major concepts around databases.<\/span><\/p>\n<p><b>14. Define the word \u201cdatabase.\u201d What kind of interactions does a database management system provide?<\/b><b> <\/b><\/p>\n<p><span style=\"font-weight: 400;\">A database is any electronic system that contains data and allows it to be used, accessed, updated, and processed.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Database management systems (DBMS) allow administrators, applications, software, and end users to interact with the data stored on the database.<\/span><\/p>\n<p><b>15. How do database management systems improve on the functionality of file-based systems? <\/b><\/p>\n<p><span style=\"font-weight: 400;\">A file-based system may be interacted with directly by users, but not necessarily concurrently. Data-based management provides mediation between the file system and the application programming interfaces (APIs) being used and is more likely to facilitate multiple users at once. However, these users cannot change the same data at the same time.<\/span><\/p>\n<p><b>16. What are the three main types of database technology?<\/b><\/p>\n<p><b> <\/b><\/p>\n<ol>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><b>Structure\/data<\/b><span style=\"font-weight: 400;\">: Useful when writing a program that needs to store, manipulate, or read data\u2014but where a full database implementation is not desirable.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><b>Navigational:<\/b><span style=\"font-weight: 400;\"> Navigational databases are associated with hierarchical or network models. This describes a database where objects are processed iteratively, one by one.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><b>SQL\/relational:<\/b><span style=\"font-weight: 400;\"> This stands for \u201c<a href=\"https:\/\/simpleprogrammer.com\/sql-interview-questions\/\">structured query language<\/a>.\u201d Used to retrieve or update information in a database.<\/span><\/li>\n<\/ol>\n<p><b>17. What is normalization used for?<\/b><\/p>\n<p><b> <\/b><\/p>\n<p><span style=\"font-weight: 400;\">Normalization reorganizes data to eliminate redundancy and save disk space. It does so by creating multiple tables and outlining the relationships between them.<\/span><\/p>\n<p><b>18. What is the difference between DDL and DML?<\/b><\/p>\n<p><b> <\/b><\/p>\n<p><span style=\"font-weight: 400;\">DDL stands for \u201cdata definition language.\u201d It specifies the structure of a database. DML stands for \u201cdata manipulation language\u201d and refers to how data is to be retrieved or modified from said database.<\/span><\/p>\n<p><b>19. Why is database partitioning necessary?<\/b><\/p>\n<p><b> <\/b><\/p>\n<p><span style=\"font-weight: 400;\">Partitioning improves efficiency and data availability and minimizes data loss by creating separate, more stable, and more available separate filesystems. Partitioning allows for parallel processing or separating partitions that need to be accessed more or less often.<\/span><\/p>\n<p><b>20. What is an entity\u2014and what is an entity set?<\/b><\/p>\n<p>An entity is a discrete object or data point, such as a person or place. An entity set groups entities of the same type.<\/p>\n<p><span style=\"font-weight: 400;\">In Java, an entity is an instance of a class. For example: Class = \u201ccar.\u201d Instance\/entity = \u201cCadillac CTS.\u201d<\/span><span style=\"font-weight: 400;\">[blank_space height=&#8217;0.1em&#8217;]<\/span><\/p>\n<h4>Array Coding Interview Questions<\/h4>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignleft wp-image-41403\" title=\"Array Questions in Coding Interviews\" src=\"https:\/\/simpleprogrammer.com\/wp-content\/uploads\/2022\/08\/favpng_array-data-structure-array-programming-variable-computer-programming-data-type.png\" alt=\"Array\" width=\"200\" height=\"143\" \/><\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p><span style=\"font-weight: 400;\">Arrays are the most common data structure in programming\u2014and a vital component in<\/span><a href=\"https:\/\/introcs.cs.princeton.edu\/java\/14array\/\"><span style=\"font-weight: 400;\"> determining how information is accessed<\/span><\/a><span style=\"font-weight: 400;\">. If you have variables as the fundamental building blocks, arrays are the next step up.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">It&#8217;s one of the darling topics of interviewers and you&#8217;ll hear a lot of questions about arrays in any coding interview, e.g. reversing an array, sorting the array, or searching elements on the array.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">The key benefit of an array data structure is that it offers fast O(1) search if you know the index, but adding and removing an element from an array is slow because you cannot change the size of the array once it\u2019s created.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">In order to create a shorter or longer array, you need to create a new array and copy all elements from old to new. <\/span><\/p>\n<p><span style=\"font-weight: 400;\">The key to solving array-based questions is having a good knowledge of array data structure as well as basic programming constructors such as loop, recursion, and fundamental operators.<\/span> <\/p>\n<p><em>Here are the top 12 questions about arrays you&#8217;re likely to get asked at your coding interview:<\/em><\/p>\n<p><strong>21. How would you check whether an array contains only digits?<\/strong><\/p>\n<p><strong>22. How would you go about finding all the permutations of a given array?<\/strong><\/p>\n<p><span style=\"font-weight: 400;\"><strong>23. How do you find the missing number in a given integer array of 1 to 100? <\/strong><\/span>(<a href=\"http:\/\/javarevisited.blogspot.com\/2014\/11\/how-to-find-missing-number-on-integer-array-java.html\">Solution<\/a>)<\/p>\n<p><span style=\"font-weight: 400;\"><strong>24. How do you find the duplicate number on a given integer array? <\/strong><\/span>(<a href=\"http:\/\/javarevisited.blogspot.com\/2014\/01\/how-to-remove-duplicates-from-array-java-without-collection-API.html\">Solution<\/a>)<\/p>\n<p><span style=\"font-weight: 400;\"><strong>25. How do you find the largest and smallest number in an unsorted integer array? <\/strong><\/span>(<a href=\"http:\/\/java67.blogspot.com\/2014\/02\/how-to-find-largest-and-smallest-number-array-in-java.html\">Solution<\/a>)<\/p>\n<p><span style=\"font-weight: 400;\"><strong>26. How do you find all pairs of an integer array whose sum is equal to a given number? <\/strong><\/span>(<a href=\"http:\/\/javarevisited.blogspot.com\/2014\/08\/how-to-find-all-pairs-in-array-of-integers-whose-sum-equal-given-number-java.html\">Solution<\/a>)<\/p>\n<p><span style=\"font-weight: 400;\"><strong>27. How do you find duplicate numbers in an array if it contains multiple duplicates? <\/strong><\/span>(<a href=\"http:\/\/javarevisited.blogspot.com\/2014\/03\/3-ways-to-find-first-non-repeated-character-String-programming-problem.html\">Solution<\/a>)<\/p>\n<p><span style=\"font-weight: 400;\"><strong>28. How are duplicates removed from a given array in Java? <\/strong><\/span>(<a href=\"http:\/\/javarevisited.blogspot.com\/2014\/01\/how-to-remove-duplicates-from-array-java-without-collection-API.html\">Solution<\/a>)<\/p>\n<p><span style=\"font-weight: 400;\"><strong>29. How is an integer array sorted in place using the quicksort algorithm? <\/strong><\/span>(<a href=\"http:\/\/javarevisited.blogspot.com\/2014\/08\/quicksort-sorting-algorithm-in-java-in-place-example.html\">Solution<\/a>)<\/p>\n<p><span style=\"font-weight: 400;\"><strong>30. How do you remove duplicates from an array in place?<\/strong><\/span>(<a href=\"http:\/\/javarevisited.blogspot.com\/2014\/01\/how-to-remove-duplicates-from-array-java-without-collection-API.html\">Solution<\/a>)<\/p>\n<p><span style=\"font-weight: 400;\"><strong>31. How do you reverse an array in place in Java? <\/strong><\/span>(<a href=\"http:\/\/javarevisited.blogspot.com\/2013\/03\/how-to-reverse-array-in-java-int-String-array-example.html\">Solution<\/a>)<\/p>\n<p><span style=\"font-weight: 400;\"><strong>32. How are duplicates removed from an array without using any library? <\/strong><\/span>(<a href=\"http:\/\/javarevisited.blogspot.sg\/2014\/01\/how-to-remove-duplicates-from-array-java-without-collection-API.html\">Solution<\/a>)<span style=\"font-weight: 400;\">[blank_space height=&#8217;0.1em&#8217;]<\/span><\/p>\n<h4>Trees &#8211; The Top 15 Interview Questions and Answers<\/h4>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignleft wp-image-41405\" title=\"Tree Coding Interview Questions\" src=\"https:\/\/simpleprogrammer.com\/wp-content\/uploads\/2022\/08\/favpng_binary-search-tree-binary-tree-search-algorithm.png\" alt=\"Binary Tree\" width=\"300\" height=\"140\" \/><\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p><span style=\"font-weight: 400;\">The following three categories\u2014trees, graphs, and lists\u2014are similar in some fundamental ways, but they still require some specialized knowledge that you might have to call upon during your interview. How well do you know your way around linear and nonlinear data structures?<\/span><\/p>\n<p><span style=\"font-weight: 400;\">In Java, trees contain packages that describe how to manipulate lists.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">All information in the real world cannot be represented in linear fashion, and that\u2019s where tree data structure helps.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Tree data structure is a data structure that allows you to store your data in a hierarchical fashion. Depending on how you store data, there are different types of trees, such as a binary tree, where each node has, at most, two child nodes.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Along with its close cousin binary search tree, it\u2019s also one of the most popular tree data structures. Therefore, you will find a lot of questions based upon them, such as how to traverse them, count nodes, find depth, and check if they are balanced or not.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">A key point to solving binary tree questions is a strong knowledge of theory, e.g. what is the size or depth of the binary tree, what is a leaf, and what is a node, as well as an understanding of the popular traversing algorithms, e.g. pre-, post-, and in-order traversal.<\/span><\/p>\n<p><em><span style=\"font-weight: 400;\">Here&#8217;s a list of 15 popular binary tree-based coding questions from software engineer or developer job interviews:<\/span><\/em><\/p>\n<p><b>33. What is a binary search tree, and what is it used for?<\/b><\/p>\n<p><b> <\/b><\/p>\n<p><span style=\"font-weight: 400;\">A binary tree is a data structure that has two \u201cchildren\u201d and facilitates the study of data that bifurcates.<\/span><\/p>\n<p><b>34. Name five types of trees.<\/b><\/p>\n<p><b> <\/b><\/p>\n<ol>\n<li><strong>Binary trees<\/strong><\/li>\n<li><strong>Binary search trees<\/strong><\/li>\n<li><strong>AVL trees<\/strong><\/li>\n<li><strong>B-trees<\/strong><\/li>\n<li><strong>B+ trees<\/strong><\/li>\n<\/ol>\n<p><span style=\"font-weight: 400;\"><strong>35. How is a binary search tree implemented? <\/strong><\/span>(<a href=\"http:\/\/javarevisited.blogspot.sg\/2015\/10\/how-to-implement-binary-search-tree-in-java-example.html#axzz4wnEtnNB3\">Solution<\/a>)<\/p>\n<p><span style=\"font-weight: 400;\"><strong>36. How do you perform preorder traversal in a given binary tree? <\/strong><\/span>(<a href=\"http:\/\/javarevisited.blogspot.sg\/2016\/07\/binary-tree-preorder-traversal-in-java-using-recursion-iteration-example.html#axzz5ArdIFI7y\">Solution<\/a>)<\/p>\n<p><span style=\"font-weight: 400;\"><strong>37. How do you traverse a given binary tree in preorder without recursion? <\/strong><\/span>(<a href=\"http:\/\/www.java67.com\/2016\/07\/binary-tree-preorder-traversal-in-java-without-recursion.html\">Solution<\/a>)<\/p>\n<p><span style=\"font-weight: 400;\"><strong>38. How do you perform an inorder traversal in a given binary tree? <\/strong><\/span>(<a href=\"http:\/\/www.java67.com\/2016\/08\/binary-tree-inorder-traversal-in-java.html\">Solution<\/a>)<\/p>\n<p><strong>39. How do you print all nodes of a given binary tree using inorder traversal without recursion? <\/strong><span style=\"font-weight: 400;\">(<\/span><a href=\"http:\/\/www.java67.com\/2016\/08\/binary-tree-inorder-traversal-in-java.html\"><span style=\"font-weight: 400;\">Solution<\/span><\/a><span style=\"font-weight: 400;\">)<\/span><\/p>\n<p><span style=\"font-weight: 400;\"><strong>40. How do you implement a postorder traversal algorithm? <\/strong><\/span>(<a href=\"http:\/\/www.java67.com\/2016\/10\/binary-tree-post-order-traversal-in.html\">Solution<\/a>)<\/p>\n<p><span style=\"font-weight: 400;\"><strong>41. How do you traverse a binary tree in postorder traversal without recursion? <\/strong><\/span>(<a href=\"http:\/\/www.java67.com\/2017\/05\/binary-tree-post-order-traversal-in-java-without-recursion.html\">Solution<\/a>)<\/p>\n<p><span style=\"font-weight: 400;\"><strong>42. How are all leaves of a binary search tree printed?<\/strong><\/span>(<a href=\"http:\/\/www.java67.com\/2016\/09\/how-to-print-all-leaf-nodes-of-binary-tree-in-java.html\">Solution<\/a>)<\/p>\n<p><span style=\"font-weight: 400;\"><strong>43. How do you count a number of leaf nodes in a given binary tree? <\/strong><\/span>(<a href=\"http:\/\/javarevisited.blogspot.sg\/2016\/12\/how-to-count-number-of-leaf-nodes-in-java-recursive-iterative-algorithm.html\">Solution<\/a>)<\/p>\n<p><span style=\"font-weight: 400;\"><strong>44. How do you perform a binary search in a given array?<\/strong><\/span>(<a href=\"http:\/\/javarevisited.blogspot.sg\/2015\/10\/how-to-implement-binary-search-tree-in-java-example.html#axzz4wnEtnNB3\">Solution<\/a>)<\/p>\n<p><b>Problem-solving with trees:<\/b><\/p>\n<p><strong>45. How would you go about mirroring a binary tree?<\/strong><\/p>\n<p><strong>46. How do you count a number of leaf nodes in a given binary tree?<\/strong><\/p>\n<p><strong>47. How would you check whether a tree is balanced or not?<span style=\"font-weight: 400;\">[blank_space height=&#8217;0.1em&#8217;]<\/span><\/strong><\/p>\n<h4>Graphs Questions<\/h4>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignleft wp-image-41406\" title=\"Programming Interview Questions about Graphs\" src=\"https:\/\/simpleprogrammer.com\/wp-content\/uploads\/2022\/08\/favpng_graph-theory-data-structure-vertex-directed-graph.png\" alt=\"Graph data structure\" width=\"200\" height=\"132\" \/><\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p><span style=\"font-weight: 400;\">Graphs are nonlinear data structures composed of multiple nodes and edges, or \u201cvertices.\u201d Graphs can represent networking architecture and can be deployed to solve practical problems. Broadly, they describe directed or undirected relationships.<\/span><\/p>\n<p><b>48. What is depth-first search, or traversal, for graphs?<\/b><\/p>\n<p><b> <\/b><\/p>\n<p><span style=\"font-weight: 400;\">Depth-first search (DFS) searches graphs and trees by beginning at the root node and following each branch as far as it can before it backtracks. DFS may be used to detect cycles in a graph, to find a path, and to locate strongly connected components.<\/span><\/p>\n<p><b>49. What is a breadth-first traversal for graphs?<\/b><\/p>\n<p><b> <\/b><\/p>\n<p><span style=\"font-weight: 400;\">Breadth-first traversal (BFS) examines sibling nodes first and children nodes second. BFS may be used in peer-to-peer networking for finding the shortest path and even in web crawlers used in search engines.<\/span><\/p>\n<p><strong>50. Given a particular graph, how would you determine whether or not it cycles?<span style=\"font-weight: 400;\">[blank_space height=&#8217;0.1em&#8217;]<\/span><\/strong><\/p>\n<h4>Lists questions in coding interview<\/h4>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignleft wp-image-41407\" title=\"Lists Coding Interview Questions\" src=\"https:\/\/simpleprogrammer.com\/wp-content\/uploads\/2022\/08\/favpng_doubly-linked-list-node-data-structure.png\" alt=\"Linked List Data Structure\" width=\"306\" height=\"140\" \/><\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>A linked list is another common data structure that complements the array data structure.<\/p>\n<p>Similar to the array, it is also a linear data structure and stores elements in a linear fashion.<\/p>\n<p>However, unlike the array, it doesn\u2019t store them in contiguous locations; instead, they are scattered everywhere in memory, which is connected to each other using nodes.<\/p>\n<p>[pullquote align=&#8221;normal&#8221;] A linked list is nothing but a list of nodes where each node contains the value stored and the address of the next node.[\/pullquote]<\/p>\n<p>Because of this structure, it\u2019s easy to add and remove elements in a linked list, as you just need to change the link instead of creating the array, but the search is difficult and often requires O(n) time to find an element in the singly linked list.<\/p>\n<p>It also comes in varieties like:<\/p>\n<ul>\n<li>a singly linked list, which allows you to traverse in one direction (forward or reverse)<\/li>\n<\/ul>\n<ul>\n<li>a doubly linked list, which allows you to traverse in both directions (forward and backward)<\/li>\n<\/ul>\n<ul>\n<li>a circular linked list, which forms a circle<\/li>\n<\/ul>\n<p> In order to solve linked list-based questions, a good knowledge of recursion is important, because a linked list is a recursive data structure.<\/p>\n<p>If you take one node from a linked list, the remaining data structure is still a linked list, and because of that, many linked list problems have simpler recursive solutions than iterative ones.<\/p>\n<p><span style=\"font-weight: 400;\"><em>Here are 8 of the most common and popular linked list interview questions and their solutions<\/em>:<\/span><\/p>\n<p><span style=\"font-weight: 400;\"><strong>51. How do you find the middle element of a singly linked list in one pass? <\/strong><\/span>(<a href=\"http:\/\/javarevisited.blogspot.sg\/2012\/12\/how-to-find-middle-element-of-linked-list-one-pass.html\">Solution<\/a>)<\/p>\n<p><strong>52. How do you check if a given linked list contains a cycle? How do you find the starting node of the cycle <\/strong><span style=\"font-weight: 400;\">(<\/span><a href=\"http:\/\/javarevisited.blogspot.sg\/2013\/05\/find-if-linked-list-contains-loops-cycle-cyclic-circular-check.html\"><span style=\"font-weight: 400;\">Solution<\/span><\/a><span style=\"font-weight: 400;\">)<\/span><\/p>\n<p><strong>53. How do you reverse a linked list? <\/strong>(<a href=\"http:\/\/www.java67.com\/2016\/07\/how-to-reverse-singly-linked-list-in-java-example.html\">Solution<\/a>)<\/p>\n<p><span style=\"font-weight: 400;\"><strong>54. How do you reverse a singly linked list without recursion? <\/strong><\/span>(<a href=\"http:\/\/javarevisited.blogspot.sg\/2017\/03\/how-to-reverse-linked-list-in-java-using-iteration-and-recursion.html\">Solution<\/a>)<\/p>\n<p><span style=\"font-weight: 400;\"><strong>55. How are duplicate nodes removed in an unsorted linked list? <\/strong><\/span>(<a href=\"https:\/\/www.geeksforgeeks.org\/remove-duplicates-from-an-unsorted-linked-list\/\">Solution<\/a>)<\/p>\n<p><span style=\"font-weight: 400;\"><strong>56. How do you find the length of a singly linked list <\/strong><\/span>(<a href=\"http:\/\/javarevisited.blogspot.sg\/2016\/05\/how-do-you-find-length-of-singly-linked.html\">Solution<\/a>)<\/p>\n<p><span style=\"font-weight: 400;\"><strong>57. How do you find the third node from the end in a singly linked list? <\/strong><\/span>(<a href=\"http:\/\/javarevisited.blogspot.sg\/2016\/07\/how-to-find-3rd-element-from-end-in-linked-list-java.html\">Solution<\/a>)<\/p>\n<p><span style=\"font-weight: 400;\"><strong>58. How do you find the sum of two linked lists using Stack? <\/strong><\/span>(<a href=\"https:\/\/www.geeksforgeeks.org\/sum-of-two-linked-lists\/\">Solution<\/a>)<span style=\"font-weight: 400;\">[blank_space height=&#8217;0.1em&#8217;]<\/span><\/p>\n<h4><span style=\"font-weight: 400;\">Algorithmic interview questions<\/span><\/h4>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignleft wp-image-41415\" src=\"https:\/\/simpleprogrammer.com\/wp-content\/uploads\/2022\/08\/Algorithm.png\" alt=\"Algorithm\" width=\"219\" height=\"140\" \/><\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p><span style=\"font-weight: 400;\">Algorithms are often the bread and butter of a coding professional\u2019s career. You know them as the recipe that powers how data is gathered, sorted, and ultimately made useful in other processes. <\/span><\/p>\n<p><span style=\"font-weight: 400;\">You can expect algorithm-related questions such as these 7:<\/span><\/p>\n<p><span style=\"font-weight: 400;\"><strong>59. How is a bubble sort algorithm implemented?<\/strong><\/span>(<a href=\"http:\/\/javarevisited.blogspot.sg\/2014\/08\/bubble-sort-algorithm-in-java-with.html#axzz5ArdIFI7y\">Solution<\/a>)<\/p>\n<p><span style=\"font-weight: 400;\"><strong>60. How is an iterative quicksort algorithm implemented? <\/strong><\/span>(<a href=\"http:\/\/javarevisited.blogspot.sg\/2016\/09\/iterative-quicksort-example-in-java-without-recursion.html#axzz5ArdIFI7y\">Solution<\/a>)<\/p>\n<p><span style=\"font-weight: 400;\"><strong>61. How do you implement an insertion sort algorithm? <\/strong><\/span>(<a href=\"http:\/\/www.java67.com\/2014\/09\/insertion-sort-in-java-with-example.html\">Solution<\/a>)<\/p>\n<p><span style=\"font-weight: 400;\"><strong>62. How is a merge sort algorithm implemented?<\/strong><\/span>(<a href=\"http:\/\/www.java67.com\/2018\/03\/mergesort-in-java-algorithm-example-and.html\">Solution<\/a>)<\/p>\n<p><span style=\"font-weight: 400;\"><strong>63. How do you implement a bucket sort algorithm?<\/strong><\/span>(<a href=\"http:\/\/javarevisited.blogspot.sg\/2017\/01\/bucket-sort-in-java-with-example.html\">Solution<\/a>)<\/p>\n<p><span style=\"font-weight: 400;\"><strong>64. How do you implement a counting sort algorithm? <\/strong><\/span>(<a href=\"http:\/\/www.java67.com\/2017\/06\/counting-sort-in-java-example.html\">Solution<\/a>)<\/p>\n<p><span style=\"font-weight: 400;\"><strong>65. How is a radix sort algorithm implemented?<\/strong><\/span>(<a href=\"http:\/\/www.java67.com\/2018\/03\/how-to-implement-radix-sort-in-java.html\">Solution<\/a>)<span style=\"font-weight: 400;\">[blank_space height=&#8217;0.1em&#8217;]<\/span><\/p>\n<h4><span style=\"font-weight: 400;\">String Coding Interview Questions<\/span><\/h4>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignleft wp-image-41416\" title=\"String Coding Interview Questions\" src=\"https:\/\/simpleprogrammer.com\/wp-content\/uploads\/2022\/08\/String.jpg\" alt=\"String\" width=\"403\" height=\"140\" \/><\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p><span style=\"font-weight: 400;\">Along with array and linked list data structures, a string is another popular topic on programming job interviews. I have never participated in a coding interview where no string-based question was asked.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">A good thing about the string is that if you know the array, you can solve string-based questions easily, because strings are nothing but a character array.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">So all the techniques you learn by solving array-based coding questions can be used to solve string programming questions as well.<\/span><\/p>\n<p><em><span style=\"font-weight: 400;\">Here&#8217;s my list of 11 frequently asked string coding questions from programming job interviews:<\/span><\/em><\/p>\n<p><strong>66. How do you print duplicate characters from a string?<\/strong> (<a href=\"http:\/\/java67.blogspot.sg\/2014\/03\/how-to-find-duplicate-characters-in-String-Java-program.html\">Solution<\/a>)<\/p>\n<p><strong>67. How do you check if two strings are anagrams of each other?<\/strong> (<a href=\"http:\/\/javarevisited.blogspot.sg\/2013\/03\/Anagram-how-to-check-if-two-string-are-anagrams-example-tutorial.html\">Solution<\/a>)<\/p>\n<p><strong>68. How do you print the first non-repeated character from a string?<\/strong> (<a href=\"http:\/\/javarevisited.blogspot.sg\/2014\/03\/3-ways-to-find-first-non-repeated-character-String-programming-problem.html\">Solution<\/a>)<\/p>\n<p><strong>69. How can a given string be reversed using recursion?<\/strong> (<a href=\"http:\/\/javarevisited.blogspot.sg\/2012\/01\/how-to-reverse-string-in-java-using.html\">Solution<\/a>)<\/p>\n<p><strong>70. How do you check if a string contains only digits?<\/strong> (<a href=\"http:\/\/javarevisited.blogspot.sg\/2012\/10\/regular-expression-example-in-java-to-check-String-number.html\">Solution<\/a>)<\/p>\n<p><strong>71. How are duplicate characters found in a string?<\/strong> (<a href=\"http:\/\/java67.blogspot.sg\/2014\/03\/how-to-find-duplicate-characters-in-String-Java-program.html\">Solution<\/a>)<\/p>\n<p><strong>72. How do you count a number of vowels and consonants in a given string?<\/strong> (<a href=\"http:\/\/java67.blogspot.sg\/2013\/11\/how-to-count-vowels-and-consonants-in-Java-String-word.html\">Solution<\/a>)<\/p>\n<p><strong>73. How do you count the occurrence of a given character in a string?<\/strong> (<a href=\"http:\/\/javarevisited.blogspot.sg\/2012\/12\/how-to-count-occurrence-of-character-in-String.html\">Solution<\/a>)<\/p>\n<p><strong>74. How do you find all permutations of a string?<\/strong> (<a href=\"http:\/\/javarevisited.blogspot.com\/2015\/08\/how-to-find-all-permutations-of-string-java-example.html\">Solution<\/a>)<\/p>\n<p><strong>75. How do you reverse words in a given sentence without using any library method?<\/strong> (<a href=\"http:\/\/java67.blogspot.com\/2015\/06\/how-to-reverse-words-in-string-java.html\">Solution<\/a>)<\/p>\n<p><strong>76. How do you check if two strings are a rotation of each other?<\/strong> (<a href=\"http:\/\/www.java67.com\/2017\/07\/string-rotation-in-java-write-program.html\">Solution<\/a>)<\/p>\n<p><strong>77. How do you check if a given string is a palindrome?<\/strong> (<a href=\"http:\/\/java67.blogspot.com\/2015\/06\/how-to-check-is-string-is-palindrome-in.html\">Solution<\/a>)<\/p>\n<p>These questions help you improve your knowledge of string as a data structure.<\/p>\n<p><span style=\"font-weight: 400;\">If you feel that your understanding of binary tree coding is inadequate and you can\u2019t solve these questions on your own, I suggest you go back and pick a <a href=\"https:\/\/www.amazon.com\/gp\/product\/819324527X?&amp;linkCode=ll2&amp;tag=makithecompsi-20&amp;linkId=9025e72add75709284960cfdd6fd40eb&amp;language=en_US&amp;ref_=as_li_ss_tl\">good data structure and algorithm book<\/a>.[blank_space height=&#8217;0.1em&#8217;]<\/span><\/p>\n<p><span style=\"font-weight: 400;\">[blank_space height=&#8217;0.1em&#8217;]<\/span><\/p>\n<h3 id=\"logic\"><span style=\"font-weight: 400;\">3. Programming Interview Logical Questions and Solutions\u00a0<\/span><\/h3>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignleft wp-image-41417 size-full\" src=\"https:\/\/simpleprogrammer.com\/wp-content\/uploads\/2022\/08\/Logic.png\" alt=\"Logic Questions\" width=\"200\" height=\"166\" \/><\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>Apart from data structure-based questions, most of the programming job interviews also ask general logic-based questions, which I\u2019ll describe in this section.<\/p>\n<p>It\u2019s important that you practice these concepts because sometimes they become tricky to solve in the actual interview.<\/p>\n<p>Having practiced them before not only makes you familiar with them, but also gives you more confidence in explaining the solution to the interviewer.<\/p>\n<p><em>Here are 9 Logic &amp; Math questions:<\/em><\/p>\n<p><span style=\"font-weight: 400;\"><strong>78. How do you swap two numbers without using the third variable?<\/strong> (<\/span><a href=\"http:\/\/www.java67.com\/2015\/08\/how-to-swap-two-integers-without-using.html\"><span style=\"font-weight: 400;\">Solution<\/span><\/a><span style=\"font-weight: 400;\">)<\/span><\/p>\n<p><span style=\"font-weight: 400;\"><strong>79. How do you check if two rectangles overlap with each other?<\/strong> (<\/span><a href=\"http:\/\/javarevisited.blogspot.sg\/2016\/10\/how-to-check-if-two-rectangle-overlap-in-java-algorithm.html\"><span style=\"font-weight: 400;\">Solution<\/span><\/a><span style=\"font-weight: 400;\">)<\/span><\/p>\n<p><span style=\"font-weight: 400;\"><strong>80. How do you design a vending machine?<\/strong> (<\/span><a href=\"http:\/\/javarevisited.blogspot.sg\/2016\/06\/design-vending-machine-in-java.html\"><span style=\"font-weight: 400;\">Solution<\/span><\/a><span style=\"font-weight: 400;\">)<\/span><\/p>\n<h5>Logical Math and Probability Interview Questions<\/h5>\n<p><strong>81. What&#8217;s the formula to check if a number is even?<\/strong><\/p>\n<p>num % 2 == 0<\/p>\n<p><strong>82. What&#8217;s the formula for the Sum of 1 to N?<\/strong><\/p>\n<p>1 + 2 + &#8230; + (N &#8211; 1) + N = (N+1) * N\/2<\/p>\n<p><strong>83. What&#8217;s the math formula for the Sum of Geometric Progression?<\/strong><\/p>\n<p id=\"7499\" class=\"pw-post-body-paragraph lj lk ju ll b lm ln kv lo lp lq ky lr ls lt lu lv lw lx ly lz ma mb mc md me iy gb\" data-selectable-paragraph=\"\">2<sup>0<\/sup>\u00a0+ 2<sup>1<\/sup>\u00a0+ 2<sup>2<\/sup>\u00a0+ 2<sup>3<\/sup>\u00a0+ &#8230; 2<sup>n<\/sup>\u00a0= 2<sup>n+1<\/sup>\u00a0&#8211; 1<\/p>\n<p><strong>84. Given two fair dices, what is the probability that two dices sum to 8?<\/strong><\/p>\n<p id=\"7499\" class=\"pw-post-body-paragraph lj lk ju ll b lm ln kv lo lp lq ky lr ls lt lu lv lw lx ly lz ma mb mc md me iy gb\" data-selectable-paragraph=\"\">There are 36 (6*6) outcomes for tossing two fair dices, and the outcomes when two dices sum to 8 are:<\/p>\n<p id=\"d455\" class=\"pw-post-body-paragraph lj lk ju ll b lm ln kv lo lp lq ky lr ls lt lu lv lw lx ly lz ma mb mc md me iy gb\" data-selectable-paragraph=\"\">(2, 6), (3,5), (4,4), (5,3), (6,2);<\/p>\n<p id=\"d9ec\" class=\"pw-post-body-paragraph lj lk ju ll b lm ln kv lo lp lq ky lr ls lt lu lv lw lx ly lz ma mb mc md me iy gb\" data-selectable-paragraph=\"\">The probability of two dices sum to 8 is 5\/36. <a href=\"https:\/\/towardsdatascience.com\/12-probability-practice-questions-for-data-science-interviews-2ec5230304d9\">Source<\/a><\/p>\n<p><strong>85. There are 100 people standing in a circle. The person standing at 1st position kills the next person (i.e.the person standing at 2nd position) and gives the sword to next to next person (i.e. the person standing at 3rd position ). Which person survives in the end?<\/strong><\/p>\n<p>If the total number of people is not in power of 2, then the person at nth position of the Arithmetic Progression defined below will always survive.<\/p>\n<p>Arithmetic Progression ( X ) = a + d * ( n \u2013 1 )<\/p>\n<p>where, a = 3<\/p>\n<p>d = 2<\/p>\n<p>n = Total number of persons \u2013 Greatest nth root of 2 less that total number of persons<\/p>\n<p id=\"7499\" class=\"pw-post-body-paragraph lj lk ju ll b lm ln kv lo lp lq ky lr ls lt lu lv lw lx ly lz ma mb mc md me iy gb\" data-selectable-paragraph=\"\">So for a circle of 100 persons:<\/p>\n<p class=\"pw-post-body-paragraph lj lk ju ll b lm ln kv lo lp lq ky lr ls lt lu lv lw lx ly lz ma mb mc md me iy gb\" data-selectable-paragraph=\"\"><strong>X = 3 + 2 * ( 100 -64 \u2013 1 ) = 73<\/strong><\/p>\n<p><strong>86. How do you check for Primality? <\/strong>(<a href=\"https:\/\/www.geeksforgeeks.org\/primality-test-set-1-introduction-and-school-method\/\">Solution<\/a>)<span style=\"font-weight: 400;\">[blank_space height=&#8217;0.1em&#8217;]<\/span><\/p>\n<h3 id=\"problemsolving\"><span style=\"font-weight: 400;\">4. Problem solving interview questions for software engineer or coder jobs<\/span><\/h3>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignleft wp-image-41418\" src=\"https:\/\/simpleprogrammer.com\/wp-content\/uploads\/2022\/08\/ProblemSolving.png\" alt=\"Problem Solving\" width=\"200\" height=\"125\" \/><\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p><span style=\"font-weight: 400;\">Some programming interviews will build to some kind of practical, hands-on, or problem-solving demonstration to see how well you can improvise and bring together the major and minor programming concepts. <\/span><\/p>\n<p><span style=\"font-weight: 400;\">Remember that the most important underlying skill for any type of programmer is the ability to think logically.<\/span><\/p>\n<p><em>11 problem-solving questions for you to practice:<\/em><\/p>\n<p><strong>87. Here\u2019s an example of a problem involving random selection:<\/strong><\/p>\n<p> If you had an array of 52 numbers, such as a deck of cards, it would be easy to choose one at random. Your task is to generate a number between 1 and 52 and use that as the index to your array. In other words, derive a system whereby a number or card is chosen at random from a set or deck with all numbers or cards equally probable.<\/p>\n<p><strong>88. Here\u2019s a more difficult variation:<\/strong><\/p>\n<p><span style=\"font-weight: 400;\">Imagine you can neither see the whole set at once nor store it. In other words, you\u2019re not told how many total numbers there will be, and you are shown only one number at a time. You cannot store all the numbers you are shown, and you are only told when you\u2019ve seen the final number of the set.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">If you are allowed to store two numbers at most, can you respond with a random number, chosen in an equiprobable manner, from that one-at-a-time set or stream immediately upon being told the stream is complete?<\/span><\/p>\n<p><strong>89. Here\u2019s how to solve this problem:<\/strong><\/p>\n<p><span style=\"font-weight: 400;\">You need store only two numbers: the total count of numbers seen so far, and your current candidate response, selected from the number stream if it were to end at that point.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">When you are shown the first number, you have a count of one. Therefore, your candidate response must be the first and only number seen\u2014it has a probability of one out of one. If you are shown a second number, it becomes your new candidate response with a probability of one out of two. Likewise, a third number will become the new candidate response with a probability of one out of three, and so on.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Thus, as each new number is seen, generate a random number between one and the number of data points seen to that point (N). If your random number is equal to N, then keep the number you were just presented with as your new possible response. Otherwise, keep the answer previously saved through this same logic.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">You perform this selection update each time you see a new data point. When you are told the stream is done, the saved value is the right response, chosen equiprobably from all the numbers seen. The probability is 1 out of N regardless of how many there were before the stream stopped.<\/span><\/p>\n<p><strong>Here are some other problems to work through:<\/strong><\/p>\n<p><strong>90. Write an algorithm to find each instance of a given word in a selection of text.<\/strong><\/p>\n<p><strong>91. Write a program to generate a random number from within a given range.<\/strong><\/p>\n<p><strong>92. How do you check if a string contains only digits?<\/strong><\/p>\n<p><strong>93. Given two strings of characters, find the minimum number of changes required to convert string 1 to string 2.<\/strong><\/p>\n<p><strong>94. How do you count a number of vowels and consonants in a given string?<\/strong><\/p>\n<p><strong>95. Given a grid where each square has a numerical value, how would you code a solution for finding the lowest-value route from one side of the grid to the other?<\/strong><\/p>\n<h4><span style=\"font-weight: 400;\">Problem-solving questions on scalability<\/span><\/h4>\n<p><strong>96. Find all documents that contain a list of words<\/strong><\/p>\n<p><strong>97. Design data structures for a social media network\u00a0<\/strong>(<a href=\"https:\/\/www.geeksforgeeks.org\/design-data-structures-for-a-very-large-social-network-like-facebook-or-linkedln\/\">Solution<\/a>)<span style=\"font-weight: 400;\">[blank_space height=&#8217;0.1em&#8217;]<\/span><\/p>\n<h3 id=\"behavioral\"><span style=\"font-weight: 400;\">5. Behavioral Programming Interview Questions &#8211; How do you fit their culture?<\/span><\/h3>\n<p><iframe loading=\"lazy\" title=\"YouTube video player\" src=\"https:\/\/www.youtube.com\/embed\/Xk4iDSCrTzU\" width=\"715\" height=\"400\" frameborder=\"0\" allowfullscreen=\"allowfullscreen\" data-mce-fragment=\"1\"><\/iframe><\/p>\n<p>By asking so-called <a href=\"https:\/\/simpleprogrammer.com\/ace-behavioral-interview\/\">behavioral questions<\/a> during your programming interview, they&#8217;re trying to figure out if your personality will fit their company&#8217;s culture.<\/p>\n<p>If you&#8217;re arrogant, you get argumentative and defensive quickly when someone criticizes you, or you start blaming others, they&#8217;ll take that as a reason to reject you for the job.<\/p>\n<h4>Soft skills software developer questions &#8211; study them!<\/h4>\n<p>Though most of your programming interview will be about your coding skills &amp; analytical ability &#8212; it&#8217;s well worth your time to prepare for these &#8220;softer&#8221; questions. Recruiters will probably ask you about some of the points in your resume as well. So it makes sense to be ready for that, too.<\/p>\n<p><em><span style=\"font-weight: 400;\">Quick Tip: In our article on <\/span><a href=\"https:\/\/simpleprogrammer.com\/soft-skills-for-programmers\/\"><span style=\"font-weight: 400;\">soft skills for programmers<\/span><\/a><span style=\"font-weight: 400;\">, we go much deeper into the behavioral attributes you need to succeed in programming interviews \u2013 and generally, your career.<\/span><\/em><\/p>\n<h4>The Top 7 Behavioral &amp; Soft Skills Programming Interview Questions<\/h4>\n<p><b>98. What are your weaknesses?<\/b><\/p>\n<p>When they&#8217;re asking about your weaknesses, give them an actual weakness of yours! Don&#8217;t give another strength of yours, disguised as a weakness.<\/p>\n<p>This would make them think you&#8217;re arrogant or egotistical.<\/p>\n<p>Rather, be honest about a weakness you have &#8212; but then show them how you&#8217;re working to overcome that weakness.<\/p>\n<p><b>99. What&#8217;s a recent technical challenge you&#8217;ve faced &#8212; and how did you solve it?<\/b><\/p>\n<p>They&#8217;re judging your <em>process<\/em> here.<\/p>\n<p>Prepare a situation you had, in which you solved a problem through a process.<\/p>\n<p>It might be an error you at first couldn&#8217;t solve. But you show them your process of how in the end, you managed to debug\u00a0 it.<\/p>\n<p>Maybe you went to Google &#8212; but Google didn&#8217;t find anything.<\/p>\n<p>Then you went to Stack Overflows. Then you went to some of the blogs you know, you watched YouTube videos. Maybe you still couldn&#8217;t find the answer.<\/p>\n<p>So maybe you went to your mentor.<\/p>\n<p>Your network.<\/p>\n<p>Maybe finally you got to talk to the creator of the stack or the open source library. And you finally solved the problem.<\/p>\n<p>This is how you show them what you can do for them, by using your amazing problem-solving process for\u00a0<em>their<\/em> company.<\/p>\n<p><b>100. What have been your failures, and how do you deal with failure in general?<\/b><\/p>\n<p>Again, be honest about a real failure you&#8217;ve experienced. Then you can paint yourself in a positive light by showing how you&#8217;ve bounced back from that failure and how you&#8217;re making sure the same won&#8217;t happen again.<\/p>\n<p>It&#8217;ll show them your strength of character.<\/p>\n<p><b>101. Why do you believe you&#8217;re a good fit for this job?<\/b><\/p>\n<p>This is a great place to give your elevator pitch.<\/p>\n<p>Even if it&#8217;s not asked, you can answer this question: Maybe on your way out, if someone&#8217;s walking you out.<\/p>\n<p>It&#8217;s about the why. You have to sell them on the why. If you&#8217;ve ever watched Simon Sinek&#8217;s video, it&#8217;s much like that.<\/p>\n<p>The why, how, and what.<\/p>\n<p><b>102. What&#8217;s the greatest knowledge you&#8217;ve gained from a past experience?<\/b><\/p>\n<p>This question revolves around a specific point on your resume.<\/p>\n<p><span style=\"font-weight: 400;\">This is where you have a great opportunity to sell some of the soft skills you might have learned. <\/span><\/p>\n<p><span style=\"font-weight: 400;\">Or if you just got done with a strength and weaknesses question, relate back to the weakness, and talk about the strengths that you were just talking about. <\/span><\/p>\n<p><span style=\"font-weight: 400;\">Regardless, this behavioral programming interview question is where you can sell what you&#8217;ve learned and why you believe now you&#8217;re prepared for this job because of what you&#8217;ve learned in the past and how that will help you here and now.<\/span><\/p>\n<p><b>103. How do you handle conflict with co-workers?<br \/>\n<\/b><\/p>\n<p>What the interviewers are looking for here is that you can prove you can work well with people, aren&#8217;t petty &#8212; and if conflicts happen, you&#8217;re both resilient and proactive in solving the problem.<\/p>\n<p>So instead of blaming and complaining, you&#8217;re taking the lead. You&#8217;re acknowledging you might be partly responsible for the conflict, but you&#8217;re not being weak either.<\/p>\n<p><b>104. General &#8220;small talk&#8221; questions<br \/>\n<\/b><\/p>\n<p>You might get to small talk with the interviewer. Here it&#8217;s important not to reveal anything that they&#8217;d use to immediately disqualify you.<\/p>\n<p>Don&#8217;t talk about:<\/p>\n<ul>\n<li>Politics<\/li>\n<li>Religion<\/li>\n<li>How you think about others of different cultural backgrounds<\/li>\n<\/ul>\n<h2><span style=\"font-weight: 400;\">\u2018Weird\u2019 Common Programming Interview Questions they won\u2019t stop asking<\/span><\/h2>\n<p>Sometimes, the interviewers will ask you something slightly &#8220;cringe&#8221; &#8212; clich\u00e9 questions they got from who-knows-where.<\/p>\n<p>They won&#8217;t really help them assess candidates in the way they think they do. But they&#8217;re sometimes still asking them.<\/p>\n<p>Have a satisfying answer prepared and you&#8217;ll be able to dodge these unnerving, but still common questions.<\/p>\n<p><strong>105. Where do you see yourself in 5 years?<\/strong><\/p>\n<p>Paint the picture of how you&#8217;ll still be working for their company, growing it in all sorts of ways.<\/p>\n<p>Never talk about how you&#8217;re considering other options for your future.<\/p>\n<p><strong>106. What was your salary at your previous job?<\/strong><\/p>\n<p>Here they&#8217;re trying to see if you&#8217;re going to give up proprietary information to someone else.<\/p>\n<p>When you&#8217;re asked this question, say something like &#8220;I&#8217;d prefer not to reveal my previous salary right now because that&#8217;s proprietary information.&#8221;<\/p>\n<p><strong>107. What salary do you want for this job?<\/strong><\/p>\n<p>If the interviewer asks you about what salary you want in the job you&#8217;re applying for, don&#8217;t answer the question directly. What the question really is asking is if you think of yourself above the company.<\/p>\n<p>Rather say something like: &#8220;I feel that I&#8217;d like to know more about the company and see how we like each other before we discuss salary. And salary&#8217;s not the most important thing I&#8217;m looking for.&#8221;<\/p>\n<p>After all, you&#8217;ll later have to negotiate your salary as part of your overall compensation package, anyway.<\/p>\n<h3>Brain Teaser Interview Questions<\/h3>\n<p>These are tricky questions that can be logically solved. They&#8217;re not directly programming questions, but they&#8217;re supposed to show your interviewers that you can think on your feet and are smart enough to quickly solve the puzzles thrown at you.<\/p>\n<p><strong>108. You have nine balls. Eight are of the same weight, one is heavier. You&#8217;re given a scale which tells you only whether the left side or the right side is heavier. Find die heavy ball in just two uses of the scale.<\/strong><\/p>\n<p>Divide the balls into sets of three. After weighing once, you&#8217;ll know which has the heavy ball.<\/p>\n<p>(with\u00a0<em>N<strong>\u00a0<\/strong><\/em>balls, where N is divisible by 3, weighing once gives us a set of N\/3 balls with the heavy ball.)<\/p>\n<p>For the final set of three balls, simply repeat the process: Put one ball off to the side an weigh two. Pick the heavier of the two. (Or, if the balls are the same, pick the third one)<\/p>\n<p><strong>109. There&#8217;s a building of 100 floors. If an egg drops from the Nth floor or above, it&#8217;ll break. If it&#8217;s dropped from any floor below, it won&#8217;t break. You&#8217;re given two eggs. Find N, while minimizing the number of drops for the worst case<\/strong>.<\/p>\n<p>Solve for X in: X + (X-1) + (X-2) + &#8230; + 1 = 100.<\/p>\n<p>X (X + 1) \/ 2 = 100 -&gt; X = 14.<\/p>\n<p>We go to floor 14, then 27, then 39, &#8230; This takes 14 steps in the worst case.<\/p>\n<p><span style=\"font-weight: 400;\">[blank_space height=&#8217;0.1em&#8217;]<\/span><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-41708\" src=\"https:\/\/simpleprogrammer.com\/wp-content\/uploads\/2018\/04\/Coding-Interview-Success.jpg\" alt=\"Coding Interview Success\" width=\"1150\" height=\"812\" \/><\/p>\n<h2>Your next step to rocking your coding interview<\/h2>\n<p>These <strong>coding, data structure, algorithm, logic <\/strong>and<strong> behavioral questions <\/strong>are the ones you need to know to successfully interview with any company &#8212; big or small, for any level of programing job.<\/p>\n<p>This list of coding questions:<\/p>\n<ul>\n<li>helps you to start prepping for your interview[blank_space height=&#8217;1em&#8217;]<\/li>\n<li>gives you good topics to study[blank_space height=&#8217;1em&#8217;]<\/li>\n<li>lets you find your strengths and weaknesses<\/li>\n<\/ul>\n<p>Above all, you need good knowledge of data structure and algorithms to succeed in your coding interview. So that\u2019s where you should focus most of your attention. But.. don&#8217;t neglect those <a href=\"https:\/\/simpleprogrammer.com\/soft-skills-for-programmers\/\">soft skills<\/a> either!<\/p>\n<p>Wishing you all the best for your programming interview,<\/p>\n<p>Sincerely,<\/p>\n<p>John<\/p>\n<p><em>For more information about how to succeed on your journey to becoming a highly paid software developer, discover the 5 learning mistakes programmers make:<\/em><\/p>\n","protected":false},"excerpt":{"rendered":"<p>I know the feeling. You\u2019re before a big coding interview. Yeah, you\u2019ve got your education. You&#8217;ve become a software developer to the best of your ability. You\u2019ve been putting in the coding reps. But still.. Now, months or weeks before the big day.. Suddenly you\u2019re starting to feel.. clueless. And to be honest \u2013 a&#8230;<\/p>\n","protected":false},"author":2,"featured_media":41707,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_kad_post_transparent":"","_kad_post_title":"","_kad_post_layout":"","_kad_post_sidebar_id":"","_kad_post_content_style":"","_kad_post_vertical_padding":"","_kad_post_feature":"","_kad_post_feature_position":"","_kad_post_header":false,"_kad_post_footer":false,"_kad_post_classname":"","footnotes":""},"categories":[14560,162228966,11788],"tags":[],"class_list":["post-28849","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-career","category-education-2","category-interview"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.6 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Top 109 Scary Coding Interview Questions SOLVED with Answers - Simple Programmer<\/title>\n<meta name=\"description\" content=\"Many computer science graduates and programmers are applying for coding and software development roles but have no idea what kind of programming questions to expect in interviews. Here, we&#039;ve listed 50 frequently asked programming interview questions and their solutions, so aspiring programmers can be better prepared.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/simpleprogrammer.com\/programming-interview-questions\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Top 109 Scary Coding Interview Questions SOLVED with Answers - Simple Programmer\" \/>\n<meta property=\"og:description\" content=\"Many computer science graduates and programmers are applying for coding and software development roles but have no idea what kind of programming questions to expect in interviews. Here, we&#039;ve listed 50 frequently asked programming interview questions and their solutions, so aspiring programmers can be better prepared.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/simpleprogrammer.com\/programming-interview-questions\/\" \/>\n<meta property=\"og:site_name\" content=\"Simple Programmer\" \/>\n<meta property=\"article:published_time\" content=\"2022-08-29T14:00:48+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2026-03-11T01:50:43+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/simpleprogrammer.com\/wp-content\/uploads\/2018\/04\/Programming-Interview-Questions.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"1700\" \/>\n\t<meta property=\"og:image:height\" content=\"1133\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"John Sonmez\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"John Sonmez\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"30 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/simpleprogrammer.com\\\/programming-interview-questions\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/simpleprogrammer.com\\\/programming-interview-questions\\\/\"},\"author\":{\"name\":\"John Sonmez\",\"@id\":\"https:\\\/\\\/simpleprogrammer.com\\\/#\\\/schema\\\/person\\\/1abc70edfb189184827740310672de67\"},\"headline\":\"Top 109 Scary Coding Interview Questions SOLVED with Answers\",\"datePublished\":\"2022-08-29T14:00:48+00:00\",\"dateModified\":\"2026-03-11T01:50:43+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/simpleprogrammer.com\\\/programming-interview-questions\\\/\"},\"wordCount\":6054,\"commentCount\":0,\"image\":{\"@id\":\"https:\\\/\\\/simpleprogrammer.com\\\/programming-interview-questions\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/simpleprogrammer.com\\\/wp-content\\\/uploads\\\/2018\\\/04\\\/Programming-Interview-Questions.jpg\",\"articleSection\":[\"Career\",\"Education\",\"Interview\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/simpleprogrammer.com\\\/programming-interview-questions\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/simpleprogrammer.com\\\/programming-interview-questions\\\/\",\"url\":\"https:\\\/\\\/simpleprogrammer.com\\\/programming-interview-questions\\\/\",\"name\":\"Top 109 Scary Coding Interview Questions SOLVED with Answers - Simple Programmer\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/simpleprogrammer.com\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/simpleprogrammer.com\\\/programming-interview-questions\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/simpleprogrammer.com\\\/programming-interview-questions\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/simpleprogrammer.com\\\/wp-content\\\/uploads\\\/2018\\\/04\\\/Programming-Interview-Questions.jpg\",\"datePublished\":\"2022-08-29T14:00:48+00:00\",\"dateModified\":\"2026-03-11T01:50:43+00:00\",\"author\":{\"@id\":\"https:\\\/\\\/simpleprogrammer.com\\\/#\\\/schema\\\/person\\\/1abc70edfb189184827740310672de67\"},\"description\":\"Many computer science graduates and programmers are applying for coding and software development roles but have no idea what kind of programming questions to expect in interviews. Here, we've listed 50 frequently asked programming interview questions and their solutions, so aspiring programmers can be better prepared.\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/simpleprogrammer.com\\\/programming-interview-questions\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/simpleprogrammer.com\\\/programming-interview-questions\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/simpleprogrammer.com\\\/programming-interview-questions\\\/#primaryimage\",\"url\":\"https:\\\/\\\/simpleprogrammer.com\\\/wp-content\\\/uploads\\\/2018\\\/04\\\/Programming-Interview-Questions.jpg\",\"contentUrl\":\"https:\\\/\\\/simpleprogrammer.com\\\/wp-content\\\/uploads\\\/2018\\\/04\\\/Programming-Interview-Questions.jpg\",\"width\":1700,\"height\":1133},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/simpleprogrammer.com\\\/programming-interview-questions\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/simpleprogrammer.com\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Top 109 Scary Coding Interview Questions SOLVED with Answers\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/simpleprogrammer.com\\\/#website\",\"url\":\"https:\\\/\\\/simpleprogrammer.com\\\/\",\"name\":\"Simple Programmer\",\"description\":\"\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/simpleprogrammer.com\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/simpleprogrammer.com\\\/#\\\/schema\\\/person\\\/1abc70edfb189184827740310672de67\",\"name\":\"John Sonmez\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/dc2f18dfa76e017566ce607de002d7abe4acfd5ec19a6db82c180b00867b8d94?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/dc2f18dfa76e017566ce607de002d7abe4acfd5ec19a6db82c180b00867b8d94?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/dc2f18dfa76e017566ce607de002d7abe4acfd5ec19a6db82c180b00867b8d94?s=96&d=mm&r=g\",\"caption\":\"John Sonmez\"},\"url\":\"https:\\\/\\\/simpleprogrammer.com\\\/author\\\/jsonmez\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Top 109 Scary Coding Interview Questions SOLVED with Answers - Simple Programmer","description":"Many computer science graduates and programmers are applying for coding and software development roles but have no idea what kind of programming questions to expect in interviews. Here, we've listed 50 frequently asked programming interview questions and their solutions, so aspiring programmers can be better prepared.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/simpleprogrammer.com\/programming-interview-questions\/","og_locale":"en_US","og_type":"article","og_title":"Top 109 Scary Coding Interview Questions SOLVED with Answers - Simple Programmer","og_description":"Many computer science graduates and programmers are applying for coding and software development roles but have no idea what kind of programming questions to expect in interviews. Here, we've listed 50 frequently asked programming interview questions and their solutions, so aspiring programmers can be better prepared.","og_url":"https:\/\/simpleprogrammer.com\/programming-interview-questions\/","og_site_name":"Simple Programmer","article_published_time":"2022-08-29T14:00:48+00:00","article_modified_time":"2026-03-11T01:50:43+00:00","og_image":[{"width":1700,"height":1133,"url":"https:\/\/simpleprogrammer.com\/wp-content\/uploads\/2018\/04\/Programming-Interview-Questions.jpg","type":"image\/jpeg"}],"author":"John Sonmez","twitter_card":"summary_large_image","twitter_misc":{"Written by":"John Sonmez","Est. reading time":"30 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/simpleprogrammer.com\/programming-interview-questions\/#article","isPartOf":{"@id":"https:\/\/simpleprogrammer.com\/programming-interview-questions\/"},"author":{"name":"John Sonmez","@id":"https:\/\/simpleprogrammer.com\/#\/schema\/person\/1abc70edfb189184827740310672de67"},"headline":"Top 109 Scary Coding Interview Questions SOLVED with Answers","datePublished":"2022-08-29T14:00:48+00:00","dateModified":"2026-03-11T01:50:43+00:00","mainEntityOfPage":{"@id":"https:\/\/simpleprogrammer.com\/programming-interview-questions\/"},"wordCount":6054,"commentCount":0,"image":{"@id":"https:\/\/simpleprogrammer.com\/programming-interview-questions\/#primaryimage"},"thumbnailUrl":"https:\/\/simpleprogrammer.com\/wp-content\/uploads\/2018\/04\/Programming-Interview-Questions.jpg","articleSection":["Career","Education","Interview"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/simpleprogrammer.com\/programming-interview-questions\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/simpleprogrammer.com\/programming-interview-questions\/","url":"https:\/\/simpleprogrammer.com\/programming-interview-questions\/","name":"Top 109 Scary Coding Interview Questions SOLVED with Answers - Simple Programmer","isPartOf":{"@id":"https:\/\/simpleprogrammer.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/simpleprogrammer.com\/programming-interview-questions\/#primaryimage"},"image":{"@id":"https:\/\/simpleprogrammer.com\/programming-interview-questions\/#primaryimage"},"thumbnailUrl":"https:\/\/simpleprogrammer.com\/wp-content\/uploads\/2018\/04\/Programming-Interview-Questions.jpg","datePublished":"2022-08-29T14:00:48+00:00","dateModified":"2026-03-11T01:50:43+00:00","author":{"@id":"https:\/\/simpleprogrammer.com\/#\/schema\/person\/1abc70edfb189184827740310672de67"},"description":"Many computer science graduates and programmers are applying for coding and software development roles but have no idea what kind of programming questions to expect in interviews. Here, we've listed 50 frequently asked programming interview questions and their solutions, so aspiring programmers can be better prepared.","breadcrumb":{"@id":"https:\/\/simpleprogrammer.com\/programming-interview-questions\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/simpleprogrammer.com\/programming-interview-questions\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/simpleprogrammer.com\/programming-interview-questions\/#primaryimage","url":"https:\/\/simpleprogrammer.com\/wp-content\/uploads\/2018\/04\/Programming-Interview-Questions.jpg","contentUrl":"https:\/\/simpleprogrammer.com\/wp-content\/uploads\/2018\/04\/Programming-Interview-Questions.jpg","width":1700,"height":1133},{"@type":"BreadcrumbList","@id":"https:\/\/simpleprogrammer.com\/programming-interview-questions\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/simpleprogrammer.com\/"},{"@type":"ListItem","position":2,"name":"Top 109 Scary Coding Interview Questions SOLVED with Answers"}]},{"@type":"WebSite","@id":"https:\/\/simpleprogrammer.com\/#website","url":"https:\/\/simpleprogrammer.com\/","name":"Simple Programmer","description":"","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/simpleprogrammer.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/simpleprogrammer.com\/#\/schema\/person\/1abc70edfb189184827740310672de67","name":"John Sonmez","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/dc2f18dfa76e017566ce607de002d7abe4acfd5ec19a6db82c180b00867b8d94?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/dc2f18dfa76e017566ce607de002d7abe4acfd5ec19a6db82c180b00867b8d94?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/dc2f18dfa76e017566ce607de002d7abe4acfd5ec19a6db82c180b00867b8d94?s=96&d=mm&r=g","caption":"John Sonmez"},"url":"https:\/\/simpleprogrammer.com\/author\/jsonmez\/"}]}},"_links":{"self":[{"href":"https:\/\/simpleprogrammer.com\/wp-json\/wp\/v2\/posts\/28849","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/simpleprogrammer.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/simpleprogrammer.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/simpleprogrammer.com\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/simpleprogrammer.com\/wp-json\/wp\/v2\/comments?post=28849"}],"version-history":[{"count":1,"href":"https:\/\/simpleprogrammer.com\/wp-json\/wp\/v2\/posts\/28849\/revisions"}],"predecessor-version":[{"id":47106,"href":"https:\/\/simpleprogrammer.com\/wp-json\/wp\/v2\/posts\/28849\/revisions\/47106"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/simpleprogrammer.com\/wp-json\/wp\/v2\/media\/41707"}],"wp:attachment":[{"href":"https:\/\/simpleprogrammer.com\/wp-json\/wp\/v2\/media?parent=28849"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/simpleprogrammer.com\/wp-json\/wp\/v2\/categories?post=28849"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/simpleprogrammer.com\/wp-json\/wp\/v2\/tags?post=28849"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}