Programming Language Interview Questions by Language
Last updated 2026-11-19
Alongside algorithms, interviewers test whether you actually understand the language on your resume. Questions range from definitions, such as the difference between an interface and an abstract class, to behaviour questions that ask you to predict what a snippet prints. The guides in this section cover one language at a time, and larger languages are split into subtopics such as collections, memory, concurrency or generics.
If a language is on your resume, expect questions about it. A candidate who lists Java and cannot explain how a HashMap resolves collisions, or lists Python and cannot explain mutable default arguments, loses credibility quickly. These banks are built to close those gaps with short, correct explanations backed by code.
What interviewers test in a language
- Core syntax and semantics: types, scope, references versus values.
- Object model: classes, inheritance, polymorphism, interfaces.
- Standard library: collections, strings, input and output, exceptions.
- Memory and performance: garbage collection, stack versus heap, copying.
- Concurrency basics: threads, locks and what can go wrong.
Read the code, then predict the output
Output prediction questions are common because they reveal real understanding. For each snippet in these guides, cover the answer, write down your prediction and your reasoning, and only then compare. If you were wrong, the reason is usually a rule you can learn in a sentence, such as integer caching in Java or late binding of closures in Python.
Know the trade-offs, not just the definitions
A good answer to a language question names a trade-off. When asked about ArrayList versus LinkedList, or list versus tuple, or vector versus array, say what each is better at and what it costs. Pair every definition with a short situation where you would choose one over the other.
Pick one language to go deep in
It is better to know one language thoroughly than five superficially. Choose the language you will code in during tests, learn its standard collections and their complexities, and then read the guides for any other language you have listed. Be honest on your resume about your level; interviewers probe the gaps.
Connecting languages to algorithms and fundamentals
Language questions overlap with the rest of preparation. Collections questions lean on data structures, so pair them with the DSA topic banks. Memory and threading questions lean on operating systems, covered in CS fundamentals.
All 75 guides in this section
- .NET Core and .NET 8 Interview Questions.NET Core interview questions: CLR, middleware pipeline, dependency injection lifetimes, configuration, Kestrel, hosting, deployment and Native AOT.
- Advanced Python Interview QuestionsAdvanced Python interview questions: descriptors, metaclasses, context managers, asyncio, typing, MRO, slots and performance traps with worked answers.
- ASP.NET Core MVC Interview QuestionsASP.NET Core MVC interview questions: routing, model binding, validation, filters, Razor views, TempData, authorisation, CSRF and API controllers.
- C Language Interview Questions and AnswersC language interview questions with worked answers: storage classes, structs, unions, preprocessor, volatile, memory, strings and undefined behaviour.
- C Pointers Interview QuestionsC pointers interview questions with worked answers: pointer arithmetic, arrays vs pointers, double pointers, function pointers, dangling pointers and malloc.
- C Programming Output Questions with AnswersC programming output questions with answers and reasons: macros, sizeof, integer promotion, printf, switch fall-through, pointers and undefined behaviour traps.
- C# Async Await Interview QuestionsC# async await interview questions: state machines, async void, ConfigureAwait, deadlocks, WhenAll, ValueTask, cancellation and output order.
- C# Coding Interview QuestionsC# coding interview questions with working solutions and complexity: two sum, parentheses, sliding window, intervals, LRU cache, Lazy singleton.
- C# Collections Interview QuestionsC# collections interview questions: List growth, Dictionary internals, HashSet, PriorityQueue, ConcurrentDictionary, immutable and frozen collections.
- C# Delegates and Events Interview QuestionsC# delegates and events interview questions: multicast, Func/Action, event vs delegate, EventHandler pattern, closures, memory leaks and variance.
- C# Interview Questions and AnswersC# interview questions with worked answers for C# 12 and .NET 8: value vs reference types, boxing, ref/out, records, nullables, using and outputs.
- C# LINQ Interview QuestionsC# LINQ interview questions: deferred execution, IEnumerable vs IQueryable, Select vs SelectMany, joins, GroupBy, Single vs First and outputs.
- C# OOPs Interview QuestionsC# OOPs interview questions: virtual vs new vs override, abstract vs interface, constructors, sealed, access modifiers, explicit interfaces.
- C++ Coding Interview QuestionsC++ coding interview questions with working solutions and complexity: string, array, linked list, class design and STL problems asked in technical rounds.
- C++ Interview Questions and AnswersC++ interview questions with worked answers: RAII, move semantics, const, undefined behaviour, lambdas and the gotchas interviewers probe. C++17 and C++20.
- C++ Memory Management Interview QuestionsC++ memory management interview questions: stack vs heap, leaks, double free, placement new, alignment, copy vs move and RAII, with worked answers.
- C++ OOPS Interview QuestionsC++ OOPS interview questions with worked answers: constructors, inheritance, polymorphism, diamond problem, object slicing and access specifiers, with code.
- C++ Pointers and References Interview QuestionsC++ pointers and references interview questions with worked answers: const pointers, dangling references, pointer arithmetic and output tracing.
- C++ Smart Pointers Interview QuestionsC++ smart pointer interview questions: unique_ptr, shared_ptr, weak_ptr, make_shared, cycles, custom deleters and ownership rules, with code and output.
- C++ STL Interview QuestionsC++ STL interview questions with worked answers: vector, map vs unordered_map, iterator invalidation, priority_queue, algorithms and complexity gotchas.
- C++ Templates Interview QuestionsC++ templates interview questions with worked answers: specialisation, deduction, SFINAE, concepts, variadic templates, CRTP and why templates live in headers.
- C++ Virtual Functions Interview QuestionsC++ virtual function interview questions: vtable and vptr, override, final, pure virtual, virtual destructors, slicing and output prediction with code.
- Core Java Interview Questions for FreshersCore Java interview questions for freshers: features, data types, constructors, static, arrays, switch fall-through and output puzzles with answers.
- Entity Framework Core Interview QuestionsEntity Framework Core interview questions: DbContext, change tracking, loading strategies, N+1, migrations, concurrency, raw SQL and performance.
- Java 8 Streams and Lambdas Interview QuestionsJava 8 streams and lambdas interview questions: functional interfaces, flatMap, collectors, laziness, Optional, parallel streams and coding tasks.
- Java Coding Interview QuestionsJava coding interview questions with working solutions and complexity: two sum, parentheses, Kadane, linked list, binary search, rotate, GCD.
- Java Collections Interview QuestionsJava Collections interview questions: ArrayList vs LinkedList, fail-fast iterators, Arrays.asList, PriorityQueue order, Comparator and more.
- Java Concurrency Utilities Interview Questionsjava.util.concurrent interview questions: ThreadPoolExecutor, CompletableFuture, locks, latches, atomics, ConcurrentHashMap, ForkJoin and pool sizing.
- Java Exception Handling Interview QuestionsJava exception handling interview questions: checked vs unchecked, try-with-resources, finally traps, custom exceptions, chaining and outputs.
- Java Garbage Collection Interview QuestionsJava garbage collection interview questions: generations, GC roots, G1, ZGC, reference types, memory leaks, OutOfMemoryError and tuning flags.
- Java Generics Interview QuestionsJava generics interview questions: type erasure, wildcards and PECS, bounded types, raw types, generic arrays, bridge methods and output puzzles.
- Java HashMap Internals Interview QuestionsHow HashMap really works: hashing, index calculation, collisions, treeification, resize, ConcurrentHashMap and LRU cache, with code.
- Java Interfaces and Abstract Classes Interview QuestionsJava interface vs abstract class interview questions: default methods, class-wins rule, private methods, sealed types, template method and outputs.
- Java Interview Questions and AnswersCore Java interview questions with worked answers: equals vs ==, Integer cache, finally, static init order, overloading, overflow and more.
- Java Multithreading Interview QuestionsJava multithreading interview questions: start vs run, synchronized, volatile, deadlock, wait/notify, race conditions, virtual threads and more.
- Java OOPs Interview QuestionsJava OOPs interview questions on inheritance, polymorphism, abstraction, encapsulation, constructors, super, covariant returns and tricky outputs.
- Java String Interview QuestionsJava String interview questions: immutability, string pool, intern, StringBuilder, split gotchas, replaceAll, text blocks and output puzzles.
- JavaScript Array Methods Interview QuestionsJavaScript array methods interview questions: map, filter, reduce, splice vs slice, sort, flat, includes and array pitfalls with output and code.
- JavaScript Closures Interview QuestionsJavaScript closures interview questions: lexical scope, loop traps with var and let, private state, once, memoize, currying and debounce with code.
- JavaScript Coding Interview Questions with SolutionsJavaScript coding interview questions with solutions: palindromes, two sum, flatten, deep clone, throttle, pipe, binary search and event emitter.
- JavaScript DOM Interview QuestionsJavaScript DOM interview questions: selectors, event bubbling and delegation, innerHTML vs textContent, reflow, observers and storage with code.
- JavaScript ES6 Interview QuestionsES6 and modern JavaScript interview questions: destructuring, spread, arrow functions, modules, Map, Set, Symbol, Proxy and generators with code.
- JavaScript Event Loop Interview QuestionsJavaScript event loop interview questions: call stack, microtasks vs macrotasks, setTimeout, nextTick, blocking code and output order with code.
- JavaScript Hoisting and Scope Interview QuestionsJavaScript hoisting and scope interview questions: var, let, const, temporal dead zone, function hoisting, scope chain and output puzzles with code.
- JavaScript Interview Questions and AnswersCore JavaScript interview questions with worked answers: var, let, const, type coercion, equality, typeof, spread and output-prediction traps.
- JavaScript Promises and Async/Await Interview QuestionsJavaScript promises and async await interview questions: states, chaining, Promise.all, error handling, ordering puzzles and polyfills with code.
- JavaScript Prototypes and Inheritance Interview QuestionsJavaScript prototype and inheritance interview questions: prototype chain, new, Object.create, classes, super, instanceof and pollution traps.
- JavaScript this Keyword Interview QuestionsJavaScript this keyword interview questions: binding rules, call, apply, bind, arrow functions, lost context and output puzzles with code.
- JVM Internals Interview QuestionsJVM internals interview questions: class loading, runtime data areas, bytecode, JIT tiers, metaspace, object layout and troubleshooting tools.
- MySQL Interview Questions and AnswersMySQL interview questions with worked answers: InnoDB vs MyISAM, utf8mb4, sql_mode, upsert, isolation and locking, EXPLAIN, replication and 8.0 features.
- Nth Highest Salary in SQL: Interview QuestionsNth highest salary in SQL with tested queries and results: LIMIT OFFSET, DENSE_RANK, correlated subquery, ties, NULLs and per-department variants.
- PL/SQL Interview Questions and AnswersPL/SQL interview questions with worked answers and code: blocks, cursors, exceptions, procedures vs functions, packages, triggers, BULK COLLECT and FORALL.
- PostgreSQL Interview Questions and AnswersPostgreSQL interview questions with worked answers: MVCC, VACUUM, index types, JSONB, upsert, EXPLAIN ANALYZE, isolation levels and differences from MySQL.
- Python Coding Interview Questions with SolutionsPython coding interview questions with solutions: two sum, FizzBuzz, anagram grouping, merge intervals, LRU cache and more, with complexity analysis.
- Python Decorators Interview QuestionsPython decorator interview questions: closures, functools.wraps, decorators with arguments, class decorators, stacking order and caching, with code.
- Python Exception Handling Interview QuestionsPython exception handling interview questions: try, except, else, finally, custom exceptions, chaining, context managers and output puzzles.
- Python File Handling Interview QuestionsPython file handling interview questions: open modes, with, read vs readline, encoding, CSV, JSON, pathlib, seek and large-file patterns, with code.
- Python Generators and Iterators Interview QuestionsPython generators and iterators interview questions: yield, the iterator protocol, send, yield from, lazy pipelines and output traps, with code.
- Python Interview Questions and AnswersCore Python interview questions with worked answers: mutability, scope, copies, the GIL, closures and output-prediction traps that interviewers love.
- Python Lambda, Map, Filter and Reduce Interview QuestionsPython lambda, map, filter, reduce and functional programming interview questions: closures, partial, sorting keys, pitfalls and output puzzles.
- Python List, Dict and Set Interview QuestionsPython list, dictionary and set interview questions: slicing, sorting, comprehensions, hashing, complexity and output puzzles with worked answers.
- Python Memory Management Interview QuestionsPython memory management interview questions: reference counting, garbage collection, interning, copies, __slots__ and memory leaks with answers.
- Python Multithreading and Multiprocessing Interview QuestionsPython multithreading and multiprocessing interview questions: GIL, threads vs processes, locks, queues, pools, asyncio and race conditions.
- Python OOPs Interview QuestionsPython OOPs interview questions: classes, inheritance, MRO, dunder methods, property, ABCs and tricky output puzzles, answered with code.
- Python String Interview QuestionsPython string interview questions: immutability, slicing, formatting, split and join, Unicode, palindromes and anagram problems with worked code.
- SQL CTE and Recursive Query Interview QuestionsSQL CTE and recursive query interview questions with tables, queries and results: WITH clauses, hierarchies, number series, cycles and dialects.
- SQL GROUP BY and HAVING Interview QuestionsSQL GROUP BY and HAVING interview questions with sample tables, queries and exact results: WHERE vs HAVING, NULL in aggregates, COUNT variants and duplicates.
- SQL Indexes Interview QuestionsSQL index interview questions with worked answers: B-tree, clustered vs non-clustered, composite index order, covering index, when an index is ignored.
- SQL Interview Questions and AnswersSQL interview questions with worked answers and real query results: DDL vs DML, NULL, UNION, constraints, views, transactions and isolation levels.
- SQL Interview Questions for FreshersSQL interview questions for freshers with answers and real results: SELECT, WHERE, ORDER BY, LIKE, GROUP BY, NULL, keys and joins on a students table.
- SQL Joins Interview QuestionsSQL joins interview questions with the table, the query and the exact result: inner, left, full, self and cross joins, anti-joins, NULL keys and fan-out.
- SQL Query Practice: Interview Questions with SolutionsSQL query practice for interviews: 14 classic problems on customers and orders tables with solutions, exact results and MySQL or PostgreSQL notes.
- SQL Subqueries Interview QuestionsSQL subquery interview questions with sample data, queries and exact results: correlated subqueries, IN vs EXISTS, NOT IN with NULL, ANY, ALL.
- SQL Window Functions Interview QuestionsSQL window function interview questions with tables, queries and exact results: ROW_NUMBER, RANK, LAG, running totals, frames, NTILE and gaps-and-islands.
- TypeScript Interview Questions and AnswersTypeScript interview questions: interface vs type, any vs unknown, generics, narrowing, utility types, enums and strict mode with worked code.
Frequently asked questions
Which languages do these guides cover?
Python, Java, C++, JavaScript, C# and SQL, with subtopic pages for the larger ones. Each guide lists its own questions with worked answers.
Is SQL a programming language for interview purposes?
Interviewers treat it as one. Expect to write joins, aggregations and window functions on the spot, so SQL gets its own banks here.
How deep should I go on a language I only know a little?
Do not list it unless you can answer basic questions about it. Better to claim fewer languages and answer every question well.
Do output prediction questions really matter?
Yes, they are quick for interviewers to set and reveal how well you know the language rules, so practise them regularly.