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 Ability: Speed Mathematics and Basic Mathematics, Percentage, Ratio and Proportion (Ratios), Average, Profit and Loss, Simple Interest and Compound Interest, Time and Work, Pipe and Cistern, Speed Time and Distance, Number System, HCF LCM, Data Interpretation, Age Problems, Mixture and Alligation, Partnership, Algebra, Sequence and Series (Series), Mensuration and Geometry, Arithmetic
- Reasoning Ability: Puzzle Solving (Puzzles), Seating Arrangements, Coding Decoding, Blood Relations, Directions (Direction Test), Syllogisms, Data Sufficiency, Ranking, Order and Sequence, Series (Number and Letter Series) (Numerical Relations and Reasoning), Logical Sequence Of Words, Calendar, Clock, Cubes & Dices, Analytical Reasoning (Counting Figures Reasoning), Data Arrangement, Non Verbal Reasoning (Spatial Aptitude) (Spatial Reasoning) (Visual Reasoning), Deductive and Inductive Reasoning (Logical Deduction and Induction) (Prepositional Reasoning)
- Verbal Ability: Comprehension / Reading Comprehension / Unseen Passages (Critical Reasoning) (Paragraph Questions), Cloze Test (Cloze Passage), Sentence Re-arrangements (Para Jumbles) (Narrative Sequencing), Vocabulary, Sentence Completion (Fill in the blanks), Active Passive Voice (Voice), Direct and Indirect Speech, Subject Verb Agreement (Verb Noun Agreement), Tenses, Preposition, Articles, Sentence Correction (Error Correction)
- Programming Basics (MCQs + Interview): C Programming by Yash Sir, Programming in C++, Java, Python for Placements by Yash Sir
- OOPs (MCQs + Interview): Object Oriented Programming (OOPS)
- DBMS (MCQs + Interview): Basics of DBMS, ER Diagram, Relational Model & Functional Dependencies, Keys & Integrity Constraints, Normalization (1NF - BCNF), Transaction Management, Decomposition Properties & 4NF, Concurrency Control, Database Recovery, File Organization & Indexing, Relational Algebra, Database Security & Authorization
- SQL (MCQs + Interview): SQL
- Operating Systems (MCQs + Interview): Introduction to OS, Process Management, CPU Scheduling, Deadlock, Threads & Process Creation, Memory Management, Virtual Memory, Process Synchronization, Disc Scheduling, File Management, Security
- Computer Networks (MCQs + Interview): 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, Mobile Technology, Cloud Computing and IoT, Cyber and Info Security
- Coding: Coding Questions by Yash Sir
- HR Interview: MR & HR Interview Preparation
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.