Pointer AMAZON & MICROSOFT Questions
Duration: 13 min
This video lesson is available to enrolled students.
Inside: a video lesson and guided study material.
Module outline
- Quantitative Aptitude: Ratio and Proportion (Ratios), Data Interpretation, Mixture and Alligation, Permutation and Combination, Number System, Sequence and Series (Series), Speed Time and Distance, Speed Mathematics and Basic Mathematics, Algebra, Percentage, Profit and Loss, Simple Interest and Compound Interest, Powers and Exponents (Surds and Indices), Time and Work, Mensuration and Geometry, Partnership
- Reasoning Ability: Series (Number and Letter Series) (Numerical Relations and Reasoning), Coding Decoding, Data Sufficiency, Seating Arrangements, Deductive and Inductive Reasoning (Logical Deduction and Induction) (Prepositional Reasoning), Directions (Direction Test), Ranking, Order and Sequence, Syllogisms, Blood Relations, Puzzle Solving (Puzzles), Inequality, Machine Input-Output
- English Language: Vocabulary, Noun, Subject Verb Agreement (Verb Noun Agreement), Adjectives, Tenses, Comprehension / Reading Comprehension / Unseen Passages (Critical Reasoning) (Paragraph Questions), Cloze Test (Cloze Passage), Sentence Correction (Error Correction), Sentence Completion (Fill in the blanks), Sentence Re-arrangements (Para Jumbles) (Narrative Sequencing), Sentence Construction, Pronoun, Preposition, Conjunction, Adverb, Verb, Modals, Articles, Determiner, Interjection
- General Awareness: Evolution of Indian Banking (Banking & Financial Awareness), GK- Current Affairs, Static General Knowledge, Indian Economy
- C Concepts + MCQs (IT Specialist): C Programming by Yash Sir, C Language Core
- Java (IT Specialist): Java
- Python (IT Specialist): Python for Placements by Yash Sir, Python Basics
- OOPs (IT Specialist): Object Oriented Programming (OOPS)
- DBMS (IT Specialist): Basics of DBMS, ER Diagram, Relational Model & Functional Dependencies, Keys & Integrity Constraints, Normalization (1NF - BCNF), Decomposition Properties & 4NF, File Organization & Indexing, Relational Algebra, Relational Calculus, Transaction Management, Concurrency Control, Database Recovery, ORDBMS, Database Security & Authorization, Query Processing & Optimization, Enhanced Data Models, Data Warehousing & Mining, Big Data Systems, NoSQL
- SQL (IT Specialist): SQL
- Software Engineering (IT Specialist): Fundamentals of Software Engineering, Software Requirements and Quality Assurance, Software Design, Estimation and Metrics, Software Testing, Software Maintenance and Configuration Management
- Data Structure (IT Specialist): Introduction to DS, Array, Stack, Queue, Linked List, Tree, Graphs, Hashing
- Operating System (IT Specialist): Introduction to OS, Process Management, CPU Scheduling, Process Synchronization, Deadlock, Threads & Process Creation, Memory Management, Virtual Memory, Disc Scheduling, File Management, Windows OS, Linux OS, Security, Distributed Systems, Virtual Machines
- Compiler Design (IT Specialist): Intro to Compilers, Lexical Analysis, Grammar & CFG, Syntax Analysis: Top-Down, Syntax Analysis: Bottom-Up, Semantic Analysis & SDT, Intermediate Code Gen, Code Optimization, Run Time Environment
- Computer Architecture (IT Specialist): Basics of COA, Floating Point Rep, Cache Memory Organization, Input Output Organisation, Pipelining, Instr Formats & Modes, Control Unit Design, Register Transfer and Microoperations, Multiprocessors, Programming the Basic Computer
- Data Communication & Networking (IT Specialist): Introduction to CN, Data Communication, DLL: Access Control, DLL: Flow Control, DLL: Error Control, DLL: Framing, Data Link Layer - Ethernet, Net Layer: IPv4 & Proto, Net Layer: IP Addressing, Net Layer:Routing Protocol, Transport Layer Services, TL: Congestion & UDP, Application Layer, Hardware basics, Network Security
- Descriptive Test (Main Exam): English Writing Ability
AI summary & chapters
AI Summary
An AI-generated summary of this video lecture.
This educational video is a lecture on C programming, specifically focusing on multiple-choice questions (MCQs) related to pointers, a fundamental concept in the language. The video begins with an introduction to the topic, followed by a detailed analysis of two distinct MCQs. The first question, from Amazon 2019, presents a C code snippet that declares an integer variable 'a' and a pointer 'ptr'. The instructor explains the memory layout, showing that 'a' holds the value 36, and 'ptr' is a pointer to 'a', meaning it stores the address of 'a'. The code then uses the printf function with the format specifier '%u' to print the address of 'a' (via &a), the value of 'ptr' (which is the address), and the value pointed to by 'ptr' (which is 36). The instructor demonstrates that the output will be the address, the value 36, and the address again, leading to the correct answer being 'Address Value Address'. The second question, from Microsoft 2019, involves a character pointer 'ptr' initialized with a string literal "Microsoft". The code attempts to print the character at the address stored in 'ptr' using the format specifier '%c'. The instructor explains that the expression '*&*ptr' is equivalent to '*ptr', which dereferences the pointer to get the first character of the string, 'M'. The video concludes with a brief outro from the instructor, who is associated with the 'Knowledge Gate' educational platform.
Chapters
0:00 – 2:00 00:00-02:00
The video opens with a title slide for a C Programming MCQs lecture by Yash Jain. The slide features a glowing blue keyboard and a small diagram of a presentation screen. The instructor, visible in a small window, introduces the topic. The scene then transitions to a new slide with a large golden 'C' and a green box labeled 'POINTERS' with gear icons, setting the stage for the lesson on C programming pointers.
2:00 – 5:00 02:00-05:00
The video displays the first MCQ, which is from Amazon 2019. The code shown is: #include <stdio.h> int main() { int a = 36; int *ptr; ptr = &a; printf("%u %u", &a, *ptr); return 0; } The instructor explains the code step-by-step. He highlights that 'a' is an integer with a value of 36, and 'ptr' is a pointer to an integer. He draws a diagram showing 'a' at memory address 100 with value 36, and 'ptr' at address 200, storing the address 100. He explains that &a is the address of 'a' (100), and *ptr is the value at the address stored in ptr (36). The printf function prints these two values, resulting in '100 36'. The options are: a) Address Value Value, b) Value Address, c) Address Address, d) Compilation error. The instructor concludes that the correct answer is not listed, but the output is '100 36'.
5:00 – 10:00 05:00-10:00
The instructor continues to analyze the first MCQ. He clarifies that the output of the printf statement is the address of 'a' (100) and the value of 'a' (36). He then points out that the question asks for the output of the printf statement, which is '100 36'. He reviews the options and notes that option (a) 'Address Value Value' is the closest, but the second value should be the value of 'a', not the address. He then moves to the second MCQ from Microsoft 2019. The code is: #include <stdio.h> int main() { char *ptr = "Microsoft"; printf("%c", *&*ptr); return 0; } He explains that 'ptr' is a pointer to a character, and it is initialized with the address of the first character of the string "Microsoft". He draws a diagram showing the string in memory and the pointer 'ptr' pointing to the first character 'M'. He explains that the expression *&*ptr is equivalent to *ptr, which dereferences the pointer to get the character 'M'. He concludes that the output will be 'M'.
10:00 – 12:43 10:00-12:43
The video shows the second MCQ from Microsoft 2019. The code is: #include <stdio.h> int main() { char *ptr = "Microsoft"; printf("%c", *&*ptr); return 0; } The instructor explains that the expression *&*ptr is a complex way of writing *ptr. He draws a diagram showing the string "Microsoft" in memory and the pointer 'ptr' pointing to the first character 'M'. He explains that *ptr dereferences the pointer to get the character 'M'. The printf function then prints this character. The options are: (A) Compiler Error, (B) Garbage Value, (C) Runtime Error, (D) M. The instructor concludes that the correct answer is (D) M. The video ends with the instructor speaking in front of a white background with the 'KG' logo.
The video provides a structured and clear analysis of two C programming MCQs, focusing on the core concept of pointers. It begins with an introduction to the topic, then systematically breaks down each question. For the first question, it demonstrates the relationship between a variable, its address, and a pointer to that variable, using a diagram to illustrate the memory layout. For the second question, it explains the syntax of pointer dereferencing and how a string literal is stored in memory. The instructor uses a consistent method of drawing diagrams and explaining the logic behind the code, making the complex topic of pointers accessible. The progression from a simple integer pointer to a character pointer with a string literal effectively builds the viewer's understanding of pointer usage in C.