Home / Ram Sharma / English MCQs Solution

Solution

You will find all MCQs whose solution is updated by Ram Sharma

Q. Which lifecycle hook is called after view and child views are initialized?

Q. What happens if you declare a component but forget to export it in a module?

Q. Which binding is used to respond to user events in Angular?

Q. Which syntax allows property binding in Angular?

Q. Which service in Angular can handle HTTP requests?

Q. What is the primary purpose of Angular modules?

Q. Which is NOT a valid Angular pipe?

Q. Which command creates a routing-enabled Angular app?

Q. What does the 'trackBy' function improve in *ngFor?

Q. Which of the following is used to create a custom directive?

Q. What is the purpose of 'providedIn' inside @Injectable?

Q. What does the keyword 'export' do in Angular?

Q. What is a guard in Angular routing?

Q. Which Angular lifecycle hook is triggered after the content has been projected?

Q. Which file is used to declare routes in Angular?

Q. What is the use of RouterOutlet in Angular?

Q. Which Angular feature is used to create a singleton service?

Q. Which directive is used for binding an input field with a property?

Q. Which file acts as the entry point for Angular applications?

Q. What does 'two-way binding' in Angular use?

Q. Which lifecycle hook runs every time a change is detected?

Q. Which Angular module supports HTTP requests?

Q. What does `HttpClient` in Angular return by default?

Q. Which operator is used for safe navigation in Angular templates?

Q. What does the Angular `ngOnDestroy` hook do?

Q. Which file contains metadata for Angular CLI projects?

Q. Which directive is used to repeat elements in Angular?

Q. Which Angular service allows navigation between views?

Q. How can data be shared from parent to child component?

Q. Which module is required to use Angular forms?

Q. What is the lifecycle hook that is called once after component initialization?

Q. Which Angular command creates a new component?

Q. Which file defines the root module in an Angular application?

Q. What is the role of 'System.Diagnostics.Debug' class?

Q. Which option is used to disable tiered compilation in .NET?

Q. Which CLI tool helps with real-time performance metrics?

Q. Which .NET package manager installs dependencies from nuget.org?

Q. Which API provides low-level memory and buffer operations?

Q. Which file tells .NET runtime what DLL contains the application entry point?

Q. What kind of projects use 'global.json' in .NET?

Q. What is the purpose of 'System.Runtime.InteropServices' namespace?

Q. What does the GC 'compact large object heap' option do?

Q. What is an 'AppContext switch' used for in .NET?

Q. What does 'Tiered Compilation' improve in .NET runtime?

Q. Which tool is used to inspect GC behavior and memory usage?

Q. What is a 'RID' in .NET used for?

Q. Which attribute marks an assembly as CLS-compliant?

Q. Which file holds settings used during application startup?

Q. What is the function of 'dotnet store' command?

Q. Which runtime component verifies code safety and type correctness?

Q. What is the primary purpose of the IL (Intermediate Language)?

Q. Which environment variable controls the runtime configuration in .NET?

Q. What does the .NET CLI command 'dotnet migrate' do?

Q. Which of the following supports multi-targeting in .NET projects?

Q. Which class provides access to the command-line arguments?

Q. Which feature of .NET allows applications to respond to memory pressure?

Q. What does the `System.IO` namespace provide?

Q. Which of these is true about .NET runtime identifiers (RIDs)?

Q. What is the purpose of `Assembly.Load()` in .NET?

Q. Which command adds a NuGet package in .NET Core?

Q. Which type of assembly is NOT stored in the GAC?

Q. Which of the following is true about the .NET JIT compiler?

Q. Which .NET CLI command creates a new class library project?

Q. Which tool compiles IL into native code during deployment?

Q. Which feature allows examining metadata about assemblies at runtime?

Q. Which statement about .NET GC generations is correct?

Q. Which file defines package references in .NET Core?

Q. What is the primary role of the CLI tool `dotnet test`?

Q. Which runtime feature ensures applications do not access unauthorized memory?

Q. What is contained in the `.runtimeconfig.json` file?

Q. Which GC generation in .NET holds long-lived objects?

Q. What does the 'dotnet build' command do?

Q. Which class in .NET provides information about the current process?

Q. What is the role of `dotnet runtime`?

Q. Which runtime optimization avoids JIT compilation?

Q. Which NuGet package is required for JSON serialization in .NET Core?

Q. What does the `RuntimeInformation` class provide?

Q. What is the `.deps.json` file used for in .NET Core?

Q. What does `System.GC.GetTotalMemory()` return?

Q. Which directory does `dotnet publish` output files to by default?

Q. Which .NET version introduced a unified platform for all app types?

Q. Which file defines the target framework in a .NET project?

Q. What is the purpose of `dotnet tool` commands?

Q. What is the function of the `System.Diagnostics.Trace` class?

Q. What is a 'neutral culture' in .NET globalization?

Q. What is the role of the `System.Environment` class in .NET?

Q. What does the `System.AppContext` class provide in .NET Core?

Q. Which type of .NET assemblies can be versioned and shared across apps?

Q. Which format are .NET assemblies stored in?

Q. What is the entry point method of a .NET application?

Q. Which method forces the garbage collector to run immediately?

Q. Which .NET directory contains shared assemblies for global use?

Q. Which tool is used to generate documentation from XML comments in .NET?

Q. What is the purpose of the `System.Threading` namespace?

Q. Which .NET tool is used to package libraries for NuGet?

Q. What is the use of `System.Diagnostics` namespace?

Q. Which component converts IL to CPU-specific code during execution?

Q. What is the purpose of the Common Language Infrastructure (CLI)?

Q. Which tool allows inspection of the contents of a .NET DLL file?

Q. Which part of .NET handles type safety, memory, and exception handling?

Q. Which runtime optimization tool precompiles IL to native code?

Q. What is the difference between .NET Framework and .NET Core?

Q. What is the main purpose of the `dotnet clean` command?

Q. Which part of .NET defines the core types and base classes?

Q. What does the `System.Runtime` namespace provide?

Q. Which file is responsible for restoring NuGet packages in a .NET Core project?

Q. What does the term 'intermediate language' refer to in .NET?

Q. Which of the following is used for cross-language integration in .NET?

Q. Which .NET tool lists all installed SDKs and runtimes?

Q. Which of the following manages memory allocation in .NET?

Q. What does the .NET Host (dotnet.exe) do?

Q. Which .NET command is used to publish a self-contained application?

Q. Which runtime component is responsible for handling exceptions in .NET?

Q. Which of the following represents the version-agnostic specification of .NET?

Q. What is the function of the Base Class Library (BCL) in .NET?

Q. What is the purpose of `dotnet restore` command?

Q. What does `sn.exe` do in .NET?

Q. What is the purpose of `reflection` in .NET?

Q. Which .NET runtime is optimized for mobile and embedded devices?

Q. Which part of .NET enforces code access security (CAS)?

Q. In .NET, what does 'side-by-side execution' refer to?

Q. Which tool is used to compile C# code into a .NET assembly?

Q. Which attribute is used to mark methods that should not be inlined or optimized?

Q. Which runtime is used by .NET 5 and later versions?

Q. Which .NET CLI command is used to create a new project?

Q. What is the role of the `AppDomain` in the .NET Framework?

Q. What kind of code is stored inside a .NET assembly?

Q. What is a key characteristic of the .NET Standard?

Q. Which feature in .NET enables multiple versions of the same assembly to coexist?

Q. What does the term 'managed code' refer to in .NET?

Q. Which execution model does .NET Core use?

Q. Which of the following is used to inspect the metadata of an assembly?

Q. Which component ensures type safety in the .NET runtime?

Q. Which file contains project dependencies in a .NET Core app?

Q. What is a strong-named assembly?

Q. What is the purpose of CLS (Common Language Specification)?

Q. Which version of .NET first introduced cross-platform support?

Q. What is a satellite assembly in .NET?

Q. What does an assembly's manifest contain?

Q. Which of the following tools converts IL to native code ahead of time?

Q. Which of these is NOT part of the .NET Base Class Library (BCL)?

Q. What does the CLR use to manage memory automatically?

Q. What is the file extension of a .NET assembly?

Q. Which of the following is a key feature of .NET Core?

Q. What is the purpose of metadata in a .NET assembly?

Q. Which of the following is NOT true about garbage collection in .NET?

Q. What is the Common Type System (CTS) in .NET?

Q. Which tool is used to deploy assemblies to the GAC?

Q. What does GAC stand for in .NET?

Q. Which component of .NET compiles MSIL to native code?

Q. What is the purpose of the .NET Core Runtime?

Q. Which of the following is a portable, intermediate representation of .NET code?

Q. What is the role of the CLR in .NET?

Q. Which of the following represents a value type in .NET?

Q. Which directive includes a namespace in C#?

Q. Which LINQ method returns the first element matching a condition?

Q. Which method in `List<T>` removes all elements?

Q. What does `is` keyword do in C#?

Q. Which feature in C# allows defining a method with the same name but different parameters?

Q. Which method writes output to the console in C#?

Q. What does `try-catch-finally` handle in C#?

Q. Which delegate is used for event handling in .NET?

Q. Which class in .NET represents a fixed-size sequential collection of elements of the same type?

Q. Which of the following is a thread-safe collection in .NET?

Q. Which class is used to handle text file operations?

Q. What is the purpose of `override` keyword in C#?

Q. What does the `virtual` keyword indicate in a method declaration?

Q. Which keyword is used to declare a method that must be implemented in derived classes?

Q. What is the base class for all classes in C#?

Q. Which C# type is used to represent a time interval?

Q. What does CTS stand for in .NET?

Q. Which component of .NET compiles IL to machine code at runtime?

Q. What is the role of the `Main()` method in a C# console application?

Q. Which keyword is used to define a property in C#?

Q. Which type of loop guarantees at least one execution?

Q. What does `string.IsNullOrEmpty()` check for?

Q. What is the use of `??` operator in C#?

Q. Which method can be used to convert a string to uppercase in C#?

Q. Which collection class maintains the insertion order?

Q. What does `yield return` do in C#?

Q. What is the output type of a LINQ `Count()` method?

Q. Which of the following statements about static constructors is true?

Q. What does `ref` keyword in C# do?

Q. What type of class cannot be instantiated directly?

Q. Which ASP.NET Core middleware handles errors globally?

Q. Which attribute is used to validate email addresses in a model?

Q. What is `Tuple.Create()` used for?

Q. Which HTTP status code indicates 'Not Found'?

Q. Which C# keyword is used to define a constant value?

Q. Which LINQ method ensures only unique elements are returned?

Q. What is the default scope of a class in C# if no access modifier is provided?

Q. What is the purpose of `IDisposable` interface in .NET?

Q. Which .NET keyword is used to handle final cleanup before garbage collection?

Q. Which of these types is immutable in .NET?

Q. Which property is used to get query string in ASP.NET Core?

Q. Which C# keyword is used to define an interface?

Q. Which attribute marks a class as a controller in ASP.NET Core?

Q. What type is `List<int>` in .NET?

Q. What is the purpose of `HttpClient` in .NET?

Q. What does `await` do in an async method?

Q. Which access modifier allows access only within the same class?

Q. What is the function of `ModelBinder` in ASP.NET MVC?

Q. What does the `var` keyword represent in C#?

Q. Which type of exception occurs when accessing an index outside an array?

Q. What does `Task.Run()` do in C#?

Q. Which LINQ method is used to sort elements in descending order?

Q. Which of the following is used for thread safety in .NET?

Q. Which of these represents a strongly-typed view in ASP.NET MVC?

Q. What is the output of `true && false || true` in C#?

Q. What is the purpose of `nameof()` operator in C#?

Q. Which C# type allows storing a null value?

Q. What does the `sealed` keyword do in C#?

Q. What does `AddDbContext` method do in .NET Core?

Q. What does `dotnet restore` do?

Q. Which pattern is used for Dependency Injection in .NET Core?

Q. Which method runs a middleware component in ASP.NET Core?

Q. What does `async` keyword indicate in C#?

Q. What is `ModelState.IsValid` used for?

Q. What is `TempData` used for in ASP.NET MVC?

Q. What does `DbSet<T>` represent in EF Core?

Q. Which .NET Core command creates a new console project?

Q. What is the result of `Select()` in LINQ?

Q. Which method in LINQ is used to filter elements?

Q. In ASP.NET Core, where are configuration values typically stored?

Q. Which NuGet package is required to use Entity Framework Core?

Q. Which HTTP verb is used by default in a GET request?

Q. Which design pattern does ASP.NET MVC follow?

Q. Which method is used to retrieve data from a DbSet in Entity Framework?

Q. Which class is used to represent a database context in Entity Framework?

Q. What is the extension of a Razor View Page in ASP.NET Core?

Q. Which object is used to manage session state in ASP.NET?

Q. Which method in ASP.NET is triggered on every page request?

Q. Which version of .NET unified .NET Core and .NET Framework?

Q. Which interface is used for collection iteration in .NET?

Q. What is the default return type of a constructor in C#?

Q. Which tool can compile C# code from the command line?

Q. Which type in .NET represents a true/false value?

Q. Which data structure is ideal for key-value pairs in .NET?

Q. Which method is used to manually throw an exception?

Q. What is the base class for all exceptions in .NET?

Q. What is the output type of `Console.Read()`?

Q. What is the purpose of `ref` keyword in method parameters?

Q. Which of the following is NOT a visibility modifier in C#?

Q. Which feature in C# allows memory management automatically?

Q. Which method is used to convert a string to an integer in C#?

Q. Which of these is NOT a valid loop in C#?

Q. What is the return type of `Console.ReadLine()`?

Q. What does the `params` keyword allow in C#?

Q. What is boxing in C#?

Q. Which keyword is used to inherit a class in C#?

Q. What does IL stand for in the context of .NET?

Q. Which assembly type is used to share code across multiple applications?

Q. Which loop executes at least once regardless of condition?

Q. What does the keyword `static` mean in C#?

Q. Which .NET tool is used to manage packages?

Q. Which version of .NET introduced cross-platform support via .NET Core?

Q. Which namespace contains basic classes like Console, Math, etc.?

Q. Which method is the entry point of a C# console application?

Q. What is the output of Console.WriteLine("Hello" + 2 + 2);?

Q. Which .NET keyword is used to handle exceptions?

Q. Which of the following is NOT a value type in .NET?

Q. What is the default access modifier for class members in C#?

Q. Which .NET feature enables multiple languages to interact seamlessly?

Q. What is the file extension for compiled C# code?

Q. Which class is the base class of all classes in .NET?

Q. Which .NET component compiles C# code to Intermediate Language (IL)?

Q. What does JIT stand for in .NET?

Q. Which of these is NOT a .NET language?

Q. What is the purpose of the `using` statement in C#?

Q. Which of the following is a valid .NET data type?

Q. What is the CLR in .NET?

Q. Which collector requires Java 12 or higher?

Q. What does `Collectors.mapping(String::toUpperCase, Collectors.toList())` do?

Q. Which collector would you use to collect and immediately transform the result to a string?

Q. What is the correct way to collect elements into a `SortedMap`?

Q. Which collector is suitable to convert a stream to an unmodifiable map?

Q. What does `Collectors.summingDouble()` return?

Q. Which collector is ideal for building a histogram of values?

Q. What is the result of `Collectors.partitioningBy()`?

Q. What will happen if a merge function in `Collectors.toMap()` returns null?

Q. Which collector merges two results from different collectors?

Q. How can you collect strings from a stream and format them with prefix and suffix?

Q. What type of map is returned by default from `Collectors.groupingBy()`?

Q. Which collector helps to partition elements based on a predicate?

Q. Which collector would you use to count the number of elements grouped by a key?

Q. Which collector would you use to collect elements into a specific collection like `LinkedList`?

Q. What does `collectingAndThen()` do?

Q. Which method would you use to produce an immutable Set?

Q. Which collector can be used to compute summary statistics of integers?

Q. What does `Collectors.toMap()` require to resolve duplicate keys?

Q. Which method allows two collectors to run in parallel and merge their results?

Q. Which collector is used to create a frequency map of elements?

Q. Which of the following returns a read-only List?

Q. What is returned by `Collectors.counting()`?

Q. What does `Collectors.joining(",")` do?

Q. Which collector is used to compute the average of integer values?

Q. What is the purpose of `Collectors.groupingBy()`?

Q. Which collector would be best to collect elements into a `TreeSet`?

Q. Which method collects stream elements into a List?

Q. What does `collect(Collectors.toMap(f1, f2, f3, f4))` signify?

Q. Which collector provides access to both counts and totals?

Q. Which method allows counting of elements after transformation?

Q. Which combination will produce a TreeMap grouping of elements by length?

Q. Which of the following will result in an immutable map?

Q. What is the return type of `teeing()`?

Q. What does `summarizingInt()` provide that `averagingInt()` does not?

Q. Which collector would convert each item to uppercase and then collect to a set?

Q. What collector returns a single string with prefix and suffix?

Q. What is the result of collecting with `Collectors.partitioningBy(x -> x > 5)`?

Q. Which collector applies a transformation after collecting to a list?

Q. What is required to sort a result map by key?

Q. What is returned by `Collectors.groupingBy(..., Collectors.counting())`?

Q. Which collector would you use to find the maximum value per group?

Q. What is the role of the third parameter in `toMap()`?

Q. How do you ensure immutability with `groupingBy()` results?

Q. Which collector helps in performing transformation on grouped values?

Q. What is the return type of `Collectors.reducing()`?

Q. Which collector is used for weighted average calculations?

Q. What does `Collectors.summingInt()` do?

Q. Which collector allows changing both value transformation and map type?

Q. What will happen if the merge function in `toMap` returns null?

Q. Which collector requires Java 12+?

Q. Which collector results in a boolean map (true/false) of elements?

Q. Which collector aggregates elements using a binary operation?

Q. What will `Collectors.joining(", ")` produce from `["a", "b", "c"]`?

Q. What is the effect of using `groupingBy(Function, Supplier, Collector)`?

Q. What happens if you collect a stream into `Collectors.toUnmodifiableSet()` and try to add an element?

Q. How can you sort a stream and collect the result to a list?

Q. Which collector allows you to flatten nested data within groups?

Q. Which collector is most suitable for combining total salary per department?

Q. Which method is used to create a downstream collector that transforms and then reduces data?

Q. Which collector helps accumulate elements into a mutable result container?

Q. Which collector provides a count of grouped elements?

Q. Which collector should be used for grouping and converting values to sets?

Q. Which of these is a post-processing collector?

Q. What does `Collectors.toMap()` require to avoid duplicate key errors?

Q. Which collector allows grouping by one key and then reducing the result?

Q. What does `Collectors.summarizingDouble()` return?

Q. Which collector would be most appropriate to gather elements into a `LinkedList`?

Q. Which collector would you use to create a mutable collection with custom supplier?

Q. Which method is NOT a valid collector in Java?

Q. Which of the following combinations is valid?

Q. Which collector requires a downstream collector to collect values in a partition?

Q. Which of these collectors is useful for combining numeric results?

Q. Which collector works well with Enum keys to produce an `EnumMap`?

Q. How can you concatenate strings with a separator using collectors?

Q. What will be the result type of `Collectors.summarizingInt()`?

Q. Which collector can be used for post-processing the result?

Q. Which method allows you to use a custom merge function in `toMap()`?

Q. Which collector can be used to produce a frequency map?

Q. Which collector creates a sorted map using the natural ordering of keys?

Q. What is the main purpose of downstream collectors?

Q. What is the result of `Collectors.mapping(Function.identity(), Collectors.toList())`?

Q. Which collector is useful to collect into a `TreeSet`?

Q. In `Collectors.teeing()`, what is required as parameters?

Q. What does `Collectors.teeing()` do?

Q. Which method provides a collector that maps elements and then collects them?

Q. Which of the following collectors creates an immutable set?

Q. What is the purpose of using `Collectors.toUnmodifiableList()`?

Q. What is the purpose of `Collectors.unmodifiableList()` in Java 10+?

Q. Which collector is best suited for summarizing statistics from a Double stream?

Q. What does `Collectors.collectingAndThen()` do?

Q. Which collector is used to merge duplicate values in a Map?

Q. What does `Collectors.joining(delimiter, prefix, suffix)` do?

Q. What does `Collectors.reducing()` do?

Q. What is the return type of `groupingBy()`?

Q. Which collector collects elements into a specific collection type?

Q. Which collector provides both grouping and counting?

Q. What happens if duplicate keys are provided in `Collectors.toMap()` without a merge function?

Q. Which collector creates a partitioned map with boolean keys?

Q. What does `Collectors.counting()` return?

Q. Which collector is used to collect statistical information?

Q. What does `Collectors.averagingInt()` return?

Q. Which method collects elements into a single `String`?

Q. Which collector groups stream elements by a classifier function?

Q. What does `Collectors.toMap()` require to function?

Q. Which collector would you use to collect stream elements into a Set?

Q. What is the purpose of `Collectors.toList()`?

Q. What happens when you apply `limit(0)` on a stream?

Q. Which operation can create an infinite stream?

Q. Which interface does Stream<T> extend?

Q. Which stream function is designed for side-effects like debugging?

Q. Which collector is used to group elements by a classifier?

Q. What is the result of `collect(Collectors.counting())`?

Q. What is the result of `stream.sorted().findFirst()`?

Q. What is the purpose of `Stream.builder()`?

Q. Which method is used to build a stream from a Supplier?

Q. What does `Stream.empty()` return?

Q. What happens if `collect(Collectors.toMap())` encounters duplicate keys?

Q. Which terminal operation produces a single value result?

Q. What is the return type of `Stream.mapToInt()`?

Q. Which Stream operation returns the maximum element?

Q. Which Stream method turns each element into a Stream and flattens them?

Q. How many times does `peek()` execute?

Q. What will `Collectors.joining()` do with no arguments?

Q. What does `IntStream.range(1, 4)` produce?

Q. Which method checks if no elements match the given predicate?

Q. Which operation is used to convert Stream<T> to primitive streams?

Q. What does `Collectors.mapping()` do?

Q. Which stream operation would you use to produce a flat structure from nested lists?

Q. Which method terminates the stream and performs action on each element?

Q. Which method of `IntStream` returns the average of elements?

Q. Which of the following stream methods uses short-circuiting?

Q. How do you get a parallel stream from a List?

Q. What does `stream().min()` return?

Q. Which method would you use to transform a stream of objects into another type?

Q. Which Stream operation allows removing duplicate elements?

Q. What does `collect(Collectors.toCollection(TreeSet::new))` return?

Q. Which type of stream can be used for reading lines from a file?

Q. What does `dropWhile()` do in Java 9+?

Q. Which of the following is stateless?

Q. Which method turns a stream into a Map with duplicate key handling?

Q. What does the `unordered()` method do in a stream?

Q. Which class is used for primitive stream statistics?

Q. Which method collects elements into a `Set`?

Q. What will happen if you call `stream()` on a null list?

Q. Which of these is NOT a valid terminal operation?

Q. What is a terminal operation in the Java Stream API?

Q. Which package contains the Stream API in Java?

Q. How do you get an Optional value from a stream?

Q. Which of these is true about `parallelStream()`?

Q. What is the result of filtering an empty stream?

Q. Which of the following operations can be both terminal and intermediate?

Q. What happens if a terminal operation is not called on a stream?

Q. What does `mapToInt()` return?

Q. Which method counts the total number of elements in a stream?

Q. What will `stream.findFirst().get()` do if stream is empty?

Q. Which stream method checks if all elements satisfy a condition?

Q. Which of the following is used to summarize statistics like count, sum, average?

Q. What is returned by `collect(Collectors.joining(", "))`?

Q. Which method allows limiting the stream elements by a condition in Java 9+?

Q. Which of these methods helps inspect elements without modifying the stream?

Q. What is returned by `reduce(0, Integer::sum)`?

Q. Which collector returns a `Map<Boolean, List<T>>`?

Q. Which method is used to convert a list into a stream?

Q. What does `Stream.iterate()` generate?

Q. Which method is used to sort a stream using a custom comparator?

Q. Which terminal operation collects elements into a map?

Q. Which version of Java introduced the Stream API?

Q. What does `takeWhile()` do in a stream?

Q. Which of the following streams represent primitive types?

Q. What happens if you try to reuse a Java Stream?

Q. What does the `noneMatch()` method do?

Q. Which method is used to count elements after a filter?

Q. What is the purpose of `reduce()` in Java streams?

Q. What does `Collectors.groupingBy()` do?

Q. Which is a stateful intermediate operation?

Q. What does `toArray()` return in Stream API?

Q. What is the return type of `collect()`?

Q. Which method is used to convert primitive streams to object streams?

Q. Which collector is used to get the average of stream elements?

Q. Which class provides utility methods for collectors?

Q. What does `findAny()` return?

Q. Which method would you use to concatenate two streams?

Q. Which type of stream supports parallel processing?

Q. Which of the following will short-circuit a stream?

Q. What does `allMatch()` do in a stream?

Q. Which method is used to skip the first N elements of a stream?

Q. What does the `sorted()` method do in Java Streams?

Q. Which is the correct order of execution in Stream API?

Q. What does `peek()` do in a stream?

Q. Which terminal operation returns an Optional?

Q. Which of the following returns an empty stream?

Q. What does `flatMap()` do in a stream?

Q. Which of these can be used to create an infinite stream?

Q. What does `anyMatch()` return?

Q. What does `limit(n)` do in streams?

Q. Which operation is lazy in streams?

Q. What is the result type of `mapToInt()`?

Q. Which of the following creates a parallel stream?

Q. Which Stream method is used to perform a reduction?

Q. What does `distinct()` do in a Stream?

Q. Which of these is a terminal operation?

Q. Which method in Stream API is used for aggregation?

Q. What will `Stream.of(1, 2, 3).count()` return?

Q. What type of operation is `map()` in a stream?

Q. Which method is used to convert a Stream to a List?

Q. What does the `filter()` method do in Java Streams?

Q. Which of the following returns a stream from a collection?

Q. Which collection provides a view of a portion of a list?

Q. Which of these classes is synchronized?

Q. Which method in Queue removes and returns the head of the queue?

Q. Which implementation is preferred for large, sorted data without duplicates?

Q. What is the time complexity of `get()` in an ArrayList?

Q. Which interface does not extend the Collection interface?

Q. Which collection grows automatically when new elements are added?

Q. Which collection uses natural ordering or a provided Comparator?

Q. Which of these is not an implementation of the List interface?

Q. What does `Collections.reverse(list)` do?

Q. Which method in Map returns a Set of all keys?

Q. Which is a non-synchronized collection class?

Q. Which collection is best for implementing a stack?

Q. Which interface provides the `descendingIterator()` method?

Q. What happens when you add a null element to a TreeSet?

Q. Which Map implementation is suitable for caching with auto-removal?

Q. Which data structure is used internally by HashSet?

Q. Which method is used to convert a Collection to an array?

Q. Which of the following collections is ordered and indexed?

Q. Which class is best suited for implementing a thread-safe bounded queue?

Q. Which method is used to safely remove an element during iteration?

Q. Which method returns the number of key-value mappings in a map?

Q. Which class is recommended for high-concurrency maps?

Q. What does the method `iterator()` return?

Q. Which method can be used to convert a Set to a List?

Q. What happens when a duplicate key is inserted in a HashMap?

Q. Which of the following is a NavigableSet implementation?

Q. Which collection class implements a queue with natural ordering?

Q. What is the load factor of a HashMap by default?

Q. Which map uses weak references for keys?

Q. Which method adds all elements of one collection to another?

Q. Which Java class is used to handle bounded blocking queues?

Q. Which collection guarantees O(1) time for insertion and lookup?

Q. Which method is used to get a synchronized list?

Q. Which collection class is fail-safe?

Q. What does `Collections.unmodifiableList(list)` return?

Q. Which interface extends both Queue and Deque?

Q. Which collection throws ConcurrentModificationException if modified during iteration?

Q. Which collection is best suited for implementing LRU Cache?

Q. Which class provides a navigable map in Java?

Q. Which collection is ideal for fast search and does not allow duplicates?

Q. Which collection is backed by a hash table?

Q. Which collection allows null elements and is synchronized?

Q. Which method retrieves but does not remove the head of a queue?

Q. Which implementation uses a red-black tree under the hood?

Q. Which interface provides support for queue operations?

Q. Which of the following collections allow null values?

Q. Which collection is used to store unique elements and maintain order?

Q. Which of the following is not part of the Java Collections Framework?

Q. Which map implementation is sorted by natural ordering of keys?

Q. What is the default sorting behavior of TreeSet?

Q. Which Java collection is suitable for implementing a priority queue?

Q. Which class implements a last-in, first-out (LIFO) stack?

Q. Which implementation is best for constant-time performance for add and remove?

Q. Which method checks if a collection contains a specific element?

Q. Which method checks if a collection is empty?

Q. Which interface allows duplicate elements?

Q. Which method removes all elements from a collection?

Q. What is the output type of `HashMap.keySet()`?

Q. Which of the following will sort elements automatically?

Q. Which collection does not allow duplicate keys?

Q. What is the initial capacity of a Java HashMap?

Q. Which method returns the number of elements in a collection?

Q. Which of the following implements the Set interface?

Q. Which class allows random access to elements?

Q. Which collection class is best suited for LIFO operations?

Q. Which method is used to sort a list in Java?

Q. Which class can be used to implement a stack?

Q. Which implementation of Map maintains ascending key order?

Q. What does the `Map` interface represent?

Q. Which class implements a FIFO queue?

Q. Which of the following is thread-safe?

Q. Which collection does not allow null keys?

Q. Which interface is used to represent a group of objects?

Q. Which class provides a resizable array implementation?

Q. Which collection class maintains insertion order?

Q. Which class allows duplicate elements in Java Collections?

Q. Which interface is implemented by every collection class in Java?

Q. Which access modifier is the most restrictive?

Q. Which method is used to compare strings in Java for equality?

Q. Which is not a Java primitive data type?

Q. What is the output of: System.out.println(10 + 20 + "30")?

Q. What is the purpose of garbage collection in Java?

Q. Which operator is used for logical AND in Java?

Q. What is the use of the 'super' keyword?

Q. Which of the following is not a loop structure in Java?

Q. What does the 'this' keyword refer to?

Q. Which statement is true about constructors in Java?

Q. Which method is used to start a thread in Java?

Q. Which keyword is used to create a constant in Java?

Q. Which of the following is used for method overloading in Java?

Q. What is the output of this code?

Q. Which keyword is used to stop a loop in Java?

Q. Which exception is thrown when dividing by zero using integers?

Q. Which class is the superclass of all classes in Java?

Q. Which operator is used to compare two values in Java?

Q. What is the default value of a boolean variable in Java?

Q. What does JVM stand for?

Q. Which method is used to find the length of a string in Java?

Q. Which of the following is not a primitive type in Java?

Q. Which interface must be implemented to create a thread in Java?

Q. Which keyword is used to inherit a class in Java?

Q. Which concept allows you to reuse code in Java?

Q. Which of these classes is used for writing to files?

Q. What is the size of an int variable in Java?

Q. Which of these is a valid declaration of an array?

Q. What will be the output?

Q. Which loop checks the condition after executing the loop body?

Q. Which package contains the Scanner class?

Q. Which access modifier makes a member visible to all other classes?

Q. Which exception is thrown when an array is accessed with an illegal index?

Q. What will be the output of this code?

Q. Which of the following is the correct way to create an object?

Q. Which of the following is not a Java feature?

Q. What will be the output of the following code?

Q. Which method is the entry point for a Java application?

Q. Which of these is a valid keyword in Java?

Q. Which of the following keywords is not used in OOP?

Q. Which method is used to initialize class-level variables?

Q. What is the base class for all classes in Python?

Q. How do you check if an object belongs to a class?

Q. What is the type of a class in Python?

Q. What will the following code print?

Q. What is the method resolution order (MRO)?

Q. What will be the result?

Q. Which of the following is not a special method?

Q. What is data hiding in OOP?

Q. What happens when `super()` is used?

Q. What is the output of this code?

Q. Can a class inherit from multiple base classes in Python?

Q. Which of the following is used to define an abstract method?

Q. What does the `__repr__` method do?

Q. How do you create an object in Python?

Q. What does `@classmethod` require as the first parameter?

Q. What is true about the `@staticmethod` decorator?

Q. What will this code print?

Q. What is true about class and instance variables?

Q. What will this code print?

Q. Which access modifier makes attributes private?

Q. Which of these is a special method?

Q. What does `super()` do in Python?

Q. What is polymorphism?

Q. Which keyword is used for inheritance?

Q. Which method is automatically called when you print an object?

Q. What will be the output?

Q. Which of the following is true about inheritance?

Q. What is method overloading in Python?

Q. What does `self` represent in a class?

Q. How do you access class attributes?

Q. What will be printed?

Q. Which keyword is used to create a class in Python?

Q. What is the return value of this function?

Q. What is the result of calling this function?

Q. Which of the following defines a function with a docstring?

Q. What is the output of this code?

Q. Which of the following is the correct way to return multiple values?

Q. What will be the output?

Q. What does this function do?

Q. What is the output?

Q. Which of the following is NOT a valid function name?

Q. What is the result of this function call?

Q. What does this code print?

Q. What does this function return?

Q. Which is true about return statements?

Q. What is the output?

Q. Which of the following creates an anonymous function?

Q. What is the output of this function?

Q. What happens if a function has both *args and **kwargs?

Q. What will this return?

Q. Which of the following defines a function with a default parameter?

Q. What will the following code output?

Q. What will this code print?

Q. What will this code output?

Q. Can functions be nested in Python?

Q. What will be the output of the following code?

Q. What is lambda in Python?

Q. What does **kwargs do in a function definition?

Q. What is the use of *args in a function?

Q. What will the output be?

Q. What does the following return?

Q. Which of the following is a recursive function?

Q. What will be printed?

Q. What will be the output of this code?

Q. Which statement is true about return statements?

Q. What will be the output of this code?

Q. What does this code print?

Q. What happens if you call a function before it is defined?

Q. What is the scope of a variable defined inside a function?

Q. What is the output of this code?

Q. Which of these is a valid function call?

Q. What will this code output?

Q. Which keyword is used to create a function in Python?

Q. What is the return value of the function below?

Q. Which of the following is true about Python functions?

Q. What will the following code output?

Q. What will be printed by this code?

Q. Which of these statements about Python functions is true?

Q. What will be the output of this code?

Q. Which of the following is a valid way to define a function in Python?

Q. What is the output of the following function call?