Unit 3: Programming in C, C++, Java, JavaScript & Assembly
C pointers & memory layout, C++ virtual dispatch & STL, Java JVM & OOP, JavaScript event loop & closures, and 8085/8086/RISC Assembly.
Published Study Notes & Chapters (4)
C++ & OOP Internals: Virtual Tables (vptr/vtable), Constructors, Diamond Inheritance & STL
Compile-time vs runtime polymorphism, vptr/vtable dispatch, base-to-derived constructor vs reverse destructor order, virtual destructors, diamond virtual inheritance, and C++ STL time complexities.
Java & JVM Architecture: String Pool, Integer Cache, Interfaces, Exceptions & Concurrency
Pass-by-value object references, String Constant Pool vs new String(), Integer缓存 [-128, 127], equals/hashCode contract, Java 8+ default interface methods, and try-catch-finally return overrides.
JavaScript (ES6+) Runtime: Event Loop (Microtasks vs Macrotasks), Closures, Hoisting & Coercion
Single-threaded JS Call Stack, Microtask Queue (Promise/queueMicrotask/async-await) priority over Macrotask Queue (setTimeout), var hoisting vs let/const TDZ, prototypal chain, and == coercion.
Assembly Languages (8085, 8086 & RISC): Registers, Flags, T-States, Interrupts & Traces
8085 flag byte [S,Z,X,AC,X,P,X,CY], instruction byte sizes & T-states (MVI, LXI, LDA, STA, LHLD, CALL), hardware interrupt priority & vector addresses (TRAP 0024H), 8086 20-bit physical addressing, and RISC assembly.
Solved Unit 3: Programming in C, C++, Java, JavaScript & Assembly PYQs & Practice Questions
Launch Timed Mock (10 Qs)Which C++ operators CANNOT be overloaded by a user-defined class?
Which C++ mechanism resolves the Diamond Ambiguity Problem in multiple inheritance (D inherits from both B1 and B2, which both inherit from A) so D contains only one shared subobject of A?
In C++, class Derived publicly inherits from Base. Suppose Base* ptr = new Derived(); is deleted via delete ptr; when Base has a non-virtual destructor. What happens?
In Java, what integer value is returned by static int test() { try { return 10; } finally { return 20; } }?
What does the Java expression String a = "NET"; String b = new String("NET"); System.out.print((a == b) + ":" + (a == b.intern())); print?
In JavaScript, what does [typeof null, typeof NaN, NaN === NaN] evaluate to?
In JavaScript (ES6+), in what exact order are characters logged by: console.log("A"); setTimeout(() => console.log("B"), 0); Promise.resolve().then(() => console.log("C")); console.log("D");?
How many Machine Cycles and T-States are required by the 8085 microprocessor to fetch and execute the 3-byte instruction STA 4050H?