SIX WEEKS SUMMER TRAINING REPORT
On
Complete Interview Preparation
Submitted By
Shivam Singh
Registration No. 12221831
Under the Guidance of
Mr. Sandeep Jain
School of Computer Science & Engineering
Lovely professional University, Phagwara
(May-July 2024)
DECLARATION
I hereby declare that I have completed my six weeks summer training at Complete
Interview Preparation from 5th June 2024 to 31th July 2024 under the guidance of
Mr. Sandeep Jain. I have declared that I have worked with full dedication during
these six weeks of training and my learning outcomes fulfil the requirements of
training for the award of degree of Bachelor of Technology, Lovely Professional
university, Phagwara.
(Signature of student)
Name of Student: Shivam Singh
Registration no: 12221831
Date: 28th Aug, 2024
Acknowledgement
It is with sense of gratitude; I acknowledge the efforts of entire hosts of well
wishers who have in some way or other contributed in their own special ways to
the success and completion of the Summer Training.
Successfully completion of any type technology requires helps from a number of
people. I have also taken help from different people for the preparation of the
report. Now, there is little efforts to show my deep gratitude to those helpful
people.
I would like to also thank my college Lovely Professional University for offering
such a course which not only improve my programming skill but also taught me
other new technology.
Then I would like to thank my parents and friends who have helped me with their
valuable suggestions and guidance for choosing this course.
Last but not least I would like to thank my all classmates who have helped me a
lot.
Training certificate from organization
Table Of Contents
1. Introduction
2. Technology Learnt
3. Reason for choosing this technology
4. Project Undertaken
5. Code Snippets
6. DFD diagram for Tic Tac Toe
7. Learning Outcome
8. Explanation
9. Conclusion
Introduction
The course name is Complete Interview Preparation, one can join the course
anytime. All of the content will be available once one gets enrolled. One can finish
it at his own decided speed.
In the contemporary landscape of technology and innovation, computer science
plays a pivotal role in shaping the future. At the heart of this discipline is the
ability to design and implement efficient software solutions, which requires a deep
understanding of programming principles, data structures, and algorithms. The
course in question serves as a critical foundation for students embarking on their
journey into the world of computer science, offering a comprehensive exploration
of these essential topics.
This course is meticulously crafted to bridge the gap between theoretical
knowledge and practical application. It addresses both fundamental and advanced
programming concepts, providing students with a robust framework to approach
complex problems and develop effective solutions. By covering key programming
languages, core principles, and essential data structures, the course aims to equip
learners with the skills necessary to thrive in a dynamic and competitive field.
The course covers a broad range of topics, from basic programming principles to
advanced data structures and algorithms. Students start with foundational
programming concepts and gradually progress to more sophisticated topics,
including object-oriented programming, algorithm design, and optimization
techniques. This gradual progression ensures that students build a solid
understanding before moving on to more complex material.
Moreover, the course is designed to be hands-on, with numerous coding exercises
and projects that reinforce theoretical concepts through practical application. This
approach not only enhances learning but also prepares students to tackle real-world
programming challenges.
Technology Learnt
1. Programming Languages:
• C++: Introduction and Basic I/o, Variables, Different Errors, Operators,
Loops, Arrays, String, Functions, Pointers, Dynamic Memory Allocation,
Exception Handling and Smart Pointers
2. Object Oriented Programming:
• Classes and Objects
• Inheritance and Polymorphism: Overloading and Overriding
• Abstraction and Encapsulation
• Access Modifiers
• Friend and virtual functions in c++
• Static, final, this and super keywords
3. Data Structures (Basics):
• Analysis of Algorithms:
o Growth of functions
o Asymptotic Notations Omega, Theta,
o Recursion Tree Method
o Space Complexity
• Arrays:
o Insertion, Deletion, Updation, Shifting
o Reversal, Sort Check, Maximum, Minimum
• Recursion:
o Introduction to Recursion
o Tail Recursion
o Natural Number Check using Recursion
o Palindrome Check using Recursion
o Sum of Digits, Rod Cutting and Subsets
• Hashing:
o Introduction to Hashing
o Direct Address Table
o Collision Handling
o Chaining
o Open Addressing
o Double Hashing
• String:
o Introduction to Strings
• Searching:
o Linear Search
o Binary Search(Iterative and Recursive)
• Sorting:
o Stability in Sorting Algorithm
o Bubble Sort
o Selection Sort
o Insertion Sort
o Quick Sort
o Merge Sort
o Heap Sort
• Linked List:
o Drawbacks of Arrays
o Introduction to Linked List and Implementation
o Traversal. Insertion and Deletion
o Sorted Insertion in Linked List
o Reversal of Linked List
o Finding Middle
o Remove Duplicate from Sorted Linked List
o Circular Linked List(Traversal, Insertion, Deletion)
o Doubly Linked List(Traversal, Insertion, Deletion)
• Stack:
o Introduction to Stack Data Structure
o Implement using array
o Implementation using Linked List
o Stack Application
• Queues:
o Introduction to Queue Data Structure
o Implement using array
o Implementation using Linked List
• Dequeue:
o Introduction to Queue Data Structure
o Implement using array
o Implementation using Linked List
• Tree:
o Implementation
o Traversals: preorder, postorder, inorder, level order(Iteratice and
Recursive)
o Binary Tree: Height, Size, Maximum
o Print Nodes at k Distance
• BST:
o Implementation
o Search
o Insertion and Deletion
o Floor and Ceil in BST in CPP
o Self Balancing BST
o AVL Tree
o Applications of BST
• Heap:
o Implementation
o Insert
o Heapify and Extract in Heap
o Decrease key, Delete and Build Heap
4. C++ STL:
• Introduction to STL
o Introduction and Application
o Iterators
o Templates
o Function and Class Templates
• Pairs in CPP STL
o Introduction
o Problem: Sorting an array according to another array
o Practice Problems
• Vectors in CPP STL
o Introduction
o Vector Declaration
o More Functions of Vectors
o Time Complexities of different operations and passing Vectors to
function
o Internal working of Vectors
5. CS Subjects:
• Operating System:
o OS and its Types
o Process Management and Scheduling
o Process Synchronization
o Deadlock
o Memory Management
• Database Management System:
o Introduction to DBMS
o Architectures and ER Model
o Database Normalization
o Concurrency Control
o SQL
• Computer Networks:
o Introduction to Computer Networks
o TCP/IP vs OSI Model
o Circuit Switching vs Packet Switching
o Ip and Classful Addressing
o Transport Layer
o TCP & UDP
o Virtual Memory
6. Aptitude and Reasoning:
• Quantitative Analysis
• Logical and Verbal Reasoning
• Verbal Aptitude
Reason for Choosing this technology
The technology stack covered in this course was selected to provide a
comprehensive foundation for aspiring software engineers and developers,
particularly those aiming to excel in technical interviews and software development
roles. Here's why these technologies were chosen:
1. Programming Languages (C++):
- C++ is known for its high performance, memory management capabilities, and
extensive use in systems programming, game development, and competitive
programming. It provides deep insights into how software interacts with hardware,
making it crucial for understanding underlying system mechanics.
2. Object-Oriented Programming (OOP):
- OOP principles such as inheritance, polymorphism, abstraction, and
encapsulation are fundamental to modern software design. Learning these concepts
in C++ provides a solid understanding of how to design scalable and maintainable
software systems.
3. Data Structures and Algorithms:
- Mastery of data structures and algorithms is essential for problem-solving and
optimizing software performance. This course covers essential structures like
arrays, linked lists, stacks, queues, trees, and graphs, along with algorithms for
sorting, searching, and dynamic programming, which are crucial for technical
interviews and real-world applications.
4. Libraries (C++ STL):
- The Standard Template Library (STL) in C++ provide pre-built implementations
of common data structures and algorithms, enabling developers to write more
efficient and less error-prone code. Understanding these libraries is vital for
effective software development.
5. Advanced Topics (Graph Theory, Dynamic Programming, etc.):
- The inclusion of advanced topics such as graph theory, dynamic programming,
and greedy algorithms equips students with the tools needed to tackle complex
problems often encountered in competitive programming and real-world
applications.
7. CS Core Subjects (Operating Systems, DBMS, Networking):
- A solid understanding of core computer science subjects like operating systems,
database management systems, and computer networks is necessary for building a
holistic understanding of how software operates within various environments and
how different components interact.
8. Aptitude and Reasoning:
- Logical reasoning and quantitative aptitude are often tested in technical
interviews to assess a candidate's problem-solving abilities and analytical thinking,
making this an essential part of the preparation.
Overall, the chosen technologies and topics in this course provide a well-rounded
education that prepares students for both technical interviews and professional
software development roles.
Project UnderTaken
Introduction to Tic Tac Toe with Minimax Algorithm
Tic Tac Toe is a classic two-player game where players take turns marking a
3x3 grid with their respective symbols (usually X and O). The objective is to
align three of their symbols in a row, column, or diagonal. Although it's simple,
implementing an unbeatable AI for Tic Tac Toe involves understanding key
concepts in decision-making algorithms, particularly the Minimax algorithm.
The Challenge:
In Tic Tac Toe, the game can result in a win, loss, or draw. When two players
play optimally, the game will always end in a draw. The challenge is to create
an AI that never loses, ensuring it either wins or forces a draw against any
opponent
Minimax Algorithm Overview
The Minimax algorithm is a decision rule used for minimizing the possible loss
in a worst-case scenario. In the context of Tic Tac Toe, it's used by the AI to
choose the best possible move that maximizes its chances of winning while
minimizing the opponent's chances.
Maximizing Player (AI): The AI tries to maximize its score by choosing moves
that increase its chances of winning.
Minimizing Player (Human): The opponent tries to minimize the AI's score,
essentially playing optimally to win or draw.
How Minimax Works in Tic Tac Toe
In this Tic-Tac-Toe implementation, recursion is used, specifically in the
implementation of the Minimax algorithm.
Recursive Exploration: The algorithm simulates every possible move on the
board, recursively evaluating all subsequent moves by both players until it
reaches the end of the game (win, loss, or draw).
How Recursion Works Here:
1. Base Case:
o The recursion stops when the game is over (a win, loss, or draw).
The minimax function then returns a score based on the outcome.
2. Recursive Case:
o For each possible move, the minimax function is called again to
simulate the opponent's move. This continues until the base case is
reached. o Depending on whether it's the AI's turn or the human's
turn, the function either maximizes or minimizes the score.
Is Backtracking Used?
• Backtracking is a more specific type of recursion where you explore all
possible solutions by building a solution incrementally, abandoning a path as
soon as it is determined that the path cannot lead to a valid solution.
Score Calculation: Once the end of a possible game scenario is reached:
• +10 points for an AI win.
• -10 points for a human win. • 0 points for a draw.
Optimal Move Selection: The AI selects the move with the highest score,
ensuring it takes the best possible action. If multiple moves have the same
score, any of them may be chosen.
Code Snippet:
Output:
DFD Diagram of Tic Tac Toe
Explanation:
Constants and Macros
#define COMPUTER 1
#define HUMAN 2
#define SIDE 3
#define COMPUTERMOVE 'O'
#define HUMANMOVE 'X'
Functions void showBoard(char
board[][SIDE]) • Displays the
current state of the board. void
showInstructions()
• Displays instructions on how to play, mapping the board positions to
numbers 1 through 9.
void initialise(char board[][SIDE])
• Initializes the board by setting all positions to '*', representing empty cells.
void declareWinner(int whoseTurn)
• Declares the winner based on whose turn it was. bool rowCrossed(char
board[][SIDE])
• Checks if any row is completely filled with the same player's move,
indicating a win.
bool columnCrossed(char board[][SIDE])
• Checks if any column is completely filled with the same player's move,
indicating a win.
bool diagonalCrossed(char board[][SIDE])
• Checks if either diagonal is completely filled with the same player's move,
indicating a win.
bool gameOver(char board[][SIDE])
• Checks if the game is over by calling the row, column, and diagonal check
functions.
Minimax Algorithm
int minimax(char board[][SIDE], int depth, bool isAI)
• This is the heart of the AI, implementing the Minimax algorithm:
o Base case: If the game is over, it returns a score based on whether
the AI (computer) or the human has won.
o Recursive case: The function recursively simulates all possible
moves:
• If it's the AI's turn (isAI == true), it tries to maximize the
score.
• If it's the human's turn (isAI == false), it tries to minimize the
score.
•
int bestMove(char board[][SIDE], int moveIndex)
• This function uses the Minimax algorithm to determine the best move for the
computer: o It iterates through all possible moves and calls the minimax
function to get the best score for each move. o The move with the best score
is returned.
Game Logic
• The main game loop:
o The board is initialized, and instructions are shown.
o The loop continues until the game is over or all cells are filled. o The
computer and human take turns making moves.
o If the human's move is valid, it's placed on the board; otherwise, the
human is prompted to try again. o After each move, the board is
updated and displayed.
o If the game ends, the winner is declared, or a draw is announced.
Main Function
Int main() -
• The main function controls the flow of the game:
o It starts by printing the game title.
o The player is asked if they want to go first.
o The game loop continues until the player decides to quit.
Initial Prompt:
• The user is asked if they want to go first. Based on their choice, the game
starts with either the human or the computer making the first move.
Gameplay:
• The human selects a position by entering a number (1-9). If the position is
valid and unoccupied, their move is placed on the board.
• The computer then makes its move using the Minimax algorithm to ensure it
plays optimally.
Winning Condition:
• After each move, the game checks if there's a winner or if the board is full
(indicating a draw).
End of Game:
• The game continues until either the human or the computer wins or all
positions are filled, resulting in a draw.
• The user is then asked if they want to play again or quit.
LEARNING OUTCOMES
Upon completing this course, students will have developed a robust
understanding of both foundational and advanced programming concepts,
with a particular focus on C++. They will gain proficiency in essential
programming constructs such as loops, arrays, strings, functions, and pointers,
and will be capable of managing dynamic memory allocation and exception
handling with confidence. The course emphasizes object-oriented
programming principles, enabling students to design and implement
sophisticated software solutions using classes, objects, inheritance,
polymorphism, abstraction, and encapsulation. Additionally, students will
become adept at utilizing advanced features in C++, such as smart pointers,
BigInteger, and ArrayLists, to tackle complex programming challenges. This
strong foundation in programming languages, combined with a deep
understanding of object-oriented design, prepares students to develop and
maintain robust software applications and effectively address real-world
problems.
Beyond programming skills, students will gain significant expertise in
essential computer science areas, including data structures and algorithms.
They will learn to analyze the efficiency of algorithms using asymptotic
notations, implement various data structures like arrays, linked lists, stacks,
queues, and trees, and optimize them for time and space complexity. The
course covers advanced data structures and algorithms, such as dynamic
programming, backtracking, greedy algorithms, and graph theory, equipping
students with the tools necessary to solve complex computational problems.
Moreover, students will leverage standard libraries and tools like C++ STL,
enhancing their productivity and code reusability. By mastering these data
structures and algorithmic techniques, students will be prepared to solve a
wide range of computational problems efficiently.
The course also immerses students in practical applications of their
knowledge through hands-on projects and case studies. By engaging with
real-world scenarios such as developing a movie ticket booking application,
an e-commerce platform, and designing automated parking lot solutions,
students will apply object-oriented analysis and design principles in
meaningful ways. These projects will not only reinforce their understanding
of software development processes but also familiarize them with industry-
standard tools like UML for modeling and visualizing software architecture.
Through these experiences, students will gain the ability to analyze complex
software requirements, design scalable and efficient solutions, and bring their
concepts to life through fully developed applications.
Furthermore, the course places a strong emphasis on preparing students for
the demands of technical interviews. With comprehensive coverage of core
computer science subjects like operating systems, database management, and
computer networks, students will build a solid knowledge base needed to
tackle the challenging questions often encountered in interviews. The course
offers extensive practice in solving interview-style problems, focusing on
algorithmic thinking and problem-solving strategies critical for success.
Students will refine their skills in areas such as process management, memory
management, database normalization, and network protocols, ensuring they
are well-prepared to demonstrate a holistic understanding of these concepts in
real-world systems. By the end of the course, students will possess a well-
rounded skill set that combines theoretical knowledge with practical
application, making them highly competitive candidates for technical roles in
the industry.
Conclusion
The course provided a comprehensive and structured approach to mastering key
programming and computer science concepts, preparing participants thoroughly for
technical challenges. It began with foundational knowledge in programming language
like C++, offering detailed lessons on essential topics such as data structures,
algorithms, object-oriented programming, and advanced data structures. The
curriculum also included hands-on exercises and practice problems, which were
integral in reinforcing theoretical knowledge through practical application.
Furthermore, the inclusion of specialized topics such as object-oriented analysis and
design, CS subjects like operating systems and database management systems, as well
as crucial soft skills like resume building, ensured that learners not only gained
technical expertise but were also well-prepared for professional environments. The
course's focus on interview preparation, with a particular emphasis on commonly
asked questions and scenarios, added significant value for participants looking to enter
the job market or advance their careers.
In conclusion, this course was not only a deep dive into programming and computer
science but also an effective tool for career development, equipping participants with
the knowledge, skills, and confidence needed to succeed in both academic and
professional settings.
Bibliography
• Google
• GeeksforGeeks website