Pointer AMAZON & MICROSOFT Questions

Duration: 13 min

This video lesson is available to enrolled students.

Return to /learn/COGNIZANT-PREPARATION/technical-assessment/c-programming-by-yash-sir/c-language-mcqs/asset-pointer-amazon-microsoft-questions after enrolling

Inside: a video lesson and guided study material.

Module outline

  1. Communication Round: Vocabulary, Subject Verb Agreement (Verb Noun Agreement), 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), Direct and Indirect Speech, Active Passive Voice (Voice), Verbal Analogy (Word Based Analogy), Articles, Preposition, Conjunction, Sentence Construction, English Writing Ability, Communication Assessment
  2. Quantitative Aptitude: Ratio and Proportion (Ratios), Divisibility Rules, Data Interpretation, Mixture and Alligation, Permutation and Combination, Logarithm, Number System, HCF LCM, Speed Time and Distance, Percentage, Average, Powers and Exponents (Surds and Indices), Time and Work, Mensuration and Geometry, Age Problems, Pipe and Cistern, Probability, Profit and Loss, Simple Interest and Compound Interest, Algebra
  3. Analytical and Logical Reasoning: Series (Number and Letter Series) (Numerical Relations and Reasoning), Coding Decoding, Data Sufficiency, Non Verbal Reasoning (Spatial Aptitude) (Spatial Reasoning) (Visual Reasoning), Directions (Direction Test), Ranking, Order and Sequence, Deductive and Inductive Reasoning (Logical Deduction and Induction) (Prepositional Reasoning), Selection Decision Table (Decision Making), Logical Sequence Of Words, Puzzle Solving (Puzzles), Syllogisms, Seating Arrangements, Calendar, Clock, Blood Relations, Cubes & Dices, Venn Diagram, Analytical Reasoning (Counting Figures Reasoning)
  4. Cognizant Gaming Aptitude: Gamified / Game Based Aptitude
  5. Java (Cluster 1): Java
  6. ANSI SQL MySQL (Cluster 1,2,3): SQL
  7. HTML, CSS, JavaScript (Cluster 1,3): HTML, CSS, JavaScript
  8. Python (Cluster 2): Python for Placements by Yash Sir
  9. Cloud Fundamentals (Cluster 2): Emerging Tech Trends
  10. C# (Cluster 3): C#
  11. OOPs: Object Oriented Programming (OOPS)
  12. Technical Assessment (Coding): Coding Questions by Yash Sir, C Programming by Yash Sir, Programming in C++, Pseudo Codes
  13. Data Structures: Introduction to DS, Array, Stack, Queue, Linked List, Tree, Graphs, Hashing
  14. DBMS: 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
  15. Operating Systems: 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
  16. Computer Networks: 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
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

  1. 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. 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'.

  3. 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'.

  4. 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.

Loading lesson…