Computer Science / IT
Computer Science and IT cover programming, operating systems, data structures, databases, networks, software engineering, web technologies, and emerging fields. This page provides a comprehensive study guide with core topics and TNPSC-style questions for Combined Technical Services exam preparation.
1. Programming Concepts
Programming is the process of writing instructions that tell a computer how to solve a problem. A program is written using a programming language such as C, C++, Java, Python, or C#.
Characteristics of a Good Program
- Correctness
- Simplicity
- Efficiency
- Readability
- Maintainability
- Reusability
- Portability
Programming Languages
- Machine Language – Binary (0 and 1), fastest execution, difficult for humans.
- Assembly Language – Uses mnemonics, requires assembler.
- High-Level Language – Examples: C, C++, Java, Python, C#, JavaScript. Requires compiler or interpreter.
Compiler vs Interpreter
| Compiler | Interpreter |
|---|---|
| Converts entire program | Converts line by line |
| Faster execution | Slower execution |
| Errors after compilation | Errors immediately |
| Example: C, C++ | Example: Python |
TNPSC Question: Which language uses an interpreter?
Answer: Python
Programming Paradigms
Procedural Programming – Program divided into functions. Example: C Language. Advantages: Simple, Fast. Disadvantages: Difficult for large projects.
Object-Oriented Programming (OOP) – Program organized around objects. Main principles: Class, Object, Encapsulation, Inheritance, Polymorphism, Abstraction. Benefits: Code reuse, Better security, Easy maintenance.
Basic Programming Concepts
- Variables – Memory locations used to store values. Example: int age = 20;
- Data Types – Integer, Float, Double, Character, Boolean.
- Operators – Arithmetic (+, -, *, /, %), Relational (<, >, >=, <=, ==), Logical (AND, OR, NOT), Assignment (=), Increment (++), Decrement (--).
- Control Statements – Selection: if, if-else, switch. Iteration: for, while, do-while. Jump: break, continue, return, goto.
Functions
A function performs a specific task. Advantages: Reusability, Easy debugging, Modular programming. Types: Library functions, User-defined functions.
Recursion
A function calling itself. Example: Factorial fact(5) = 5 × 4 × 3 × 2 × 1. Advantages: Elegant solution. Disadvantages: More memory, Stack overflow.
2. Data Structures
Data structure is a method of organizing data for efficient processing.
Types
- Primitive – int, char, float.
- Non-Primitive – Array, Linked List, Stack, Queue, Tree, Graph.
Array
Collection of similar data stored in contiguous memory. Advantages: Fast access, Simple implementation. Disadvantages: Fixed size. Applications: Matrix, Searching, Sorting.
Linked List
Nodes connected through pointers. Types: Singly, Doubly, Circular Linked List. Advantages: Dynamic memory, Easy insertion. Disadvantages: Sequential access.
Stack
LIFO (Last In First Out). Operations: Push, Pop, Peek. Applications: Function calls, Expression evaluation, Undo operation.
Queue
FIFO (First In First Out). Operations: Enqueue, Dequeue. Types: Simple, Circular, Priority Queue, Deque. Applications: CPU scheduling, Printer queue.
Tree
Hierarchical data structure. Terms: Root, Parent, Child, Leaf, Height, Degree. Types: Binary Tree, Binary Search Tree, AVL Tree, Heap. Applications: Database indexing, File systems.
Graph
Collection of vertices and edges. Types: Directed, Undirected, Weighted. Traversal: BFS, DFS. Applications: Social networks, Maps, Routing.
Hashing
Stores data using hash function. Advantage: Very fast searching. Collision Resolution: Chaining, Linear probing, Quadratic probing.
3. Algorithms
Algorithm is a step-by-step procedure to solve a problem. Characteristics: Finite, Definite, Effective, Correct, Efficient.
Time Complexity
- O(1) – Constant
- O(log n) – Binary Search
- O(n) – Linear Search
- O(n log n) – Merge Sort
- O(n²) – Bubble Sort
- O(2ⁿ) – Recursive algorithms
Space Complexity – Measures memory usage.
Searching Algorithms
- Linear Search – Checks each element. Complexity O(n).
- Binary Search – Works only on sorted data. Complexity O(log n). Frequently asked in TNPSC.
Sorting Algorithms
- Bubble Sort – Repeatedly swaps adjacent elements. Worst complexity O(n²).
- Selection Sort – Finds minimum repeatedly. Complexity O(n²).
- Insertion Sort – Best for nearly sorted arrays.
- Merge Sort – Divide and Conquer. Complexity O(n log n). Stable sorting algorithm.
- Quick Sort – Uses Pivot. Average O(n log n), Worst O(n²). Fastest in practice.
- Heap Sort – Uses Binary Heap. Complexity O(n log n).
Algorithm Design Techniques
- Divide and Conquer – Problems divided into subproblems. Examples: Merge Sort, Quick Sort, Binary Search.
- Greedy Algorithm – Chooses locally optimal solution. Examples: Dijkstra, Huffman Coding, Prim, Kruskal.
- Dynamic Programming – Stores previously computed results. Examples: Fibonacci, Knapsack, Matrix Chain Multiplication.
- Backtracking – Explores all possible solutions. Examples: N Queen, Sudoku, Rat in Maze.
4. Database Management System (DBMS)
DBMS is software used to store, organize and retrieve data efficiently. Examples: MySQL, Oracle, SQL Server, PostgreSQL.
Advantages: Data Security, Data Sharing, Reduced Redundancy, Backup, Recovery.
Database Models
- Hierarchical
- Network
- Relational (most popular)
- Object-Oriented
Relational Database – Data stored in tables. Terms: Row (Tuple), Column (Attribute), Table (Relation).
Keys
- Primary Key – Uniquely identifies a record. Cannot contain NULL.
- Foreign Key – Connects two tables.
- Candidate Key – Possible primary key.
- Composite Key – Multiple columns.
- Super Key – Unique identifier.
- Alternate Key – Candidate key not selected.
Normalization
- 1NF – Atomic values.
- 2NF – Removes partial dependency.
- 3NF – Removes transitive dependency.
Benefits: Less redundancy, Better consistency.
SQL (Structured Query Language)
- DDL – CREATE, ALTER, DROP, TRUNCATE.
- DML – INSERT, UPDATE, DELETE.
- DQL – SELECT.
- DCL – GRANT, REVOKE.
- TCL – COMMIT, ROLLBACK, SAVEPOINT.
SQL Clauses – WHERE, GROUP BY, ORDER BY, HAVING, DISTINCT, LIMIT.
Joins
Inner Join, Left Join, Right Join, Full Join, Self Join, Cross Join.
Transactions
Properties (ACID): Atomicity, Consistency, Isolation, Durability.
Advanced Concepts
- Indexing – Improves search speed. Types: Clustered, Non-clustered.
- Views – Virtual table. Advantages: Security, Simplicity.
- Stored Procedures – Precompiled SQL programs. Advantages: Faster execution, Reusability.
- Triggers – Automatically executed on events (INSERT, UPDATE, DELETE).
5. Operating System (OS)
An Operating System is system software that acts as an interface between the user and computer hardware. It manages hardware resources, executes programs, controls files, memory, and input/output devices.
Functions of Operating System
- Process Management
- Memory Management
- File Management
- Device Management
- Security and Protection
- User Interface
- Resource Allocation
- Error Detection
Types of Operating Systems
- Batch OS – Jobs executed in batches without user interaction. Suitable for payroll processing and billing systems.
- Multiprogramming OS – Multiple programs reside in memory simultaneously; CPU switches between programs.
- Multitasking OS – Allows multiple applications to run simultaneously. Example: Windows, Linux.
- Multiprocessing OS – Uses two or more CPUs. Improves speed and reliability.
- Time Sharing OS – CPU time shared among multiple users; each gets a small time slice.
- Real-Time OS (RTOS) – Types: Hard Real-Time, Soft Real-Time. Applications: Aircraft control, Robotics, Medical equipment.
Process Management
A process is a program in execution. Process States: New, Ready, Running, Waiting (Blocked), Terminated.
Process Control Block (PCB) contains: Process ID, Program Counter, CPU Registers, Memory Information, Scheduling Information.
CPU Scheduling
- FCFS (First Come First Serve) – Simple, easy implementation. Disadvantages: Convoy effect, High waiting time.
- SJF (Shortest Job First) – Minimum average waiting time. Disadvantages: Difficult to predict execution time, Starvation possible.
- Priority Scheduling – Higher priority process executes first. Problem: Low-priority starvation. Solution: Aging.
- Round Robin Scheduling – Each process gets a fixed time quantum. Advantages: Fair, Suitable for time-sharing systems.
Deadlock
Deadlock occurs when processes wait indefinitely for resources. Necessary Conditions (Coffman Conditions): Mutual Exclusion, Hold and Wait, No Preemption, Circular Wait.
Deadlock Handling: Prevention, Avoidance, Detection, Recovery.
Memory Management
- Paging – Memory divided into pages. Eliminates external fragmentation.
- Segmentation – Memory divided into logical segments. Examples: Code, Stack, Data.
- Virtual Memory – Allows execution of programs larger than physical memory. Advantages: Better utilization, Large program execution.
Page Replacement Algorithms – FIFO, LRU (Least Recently Used), Optimal. Frequently asked in TNPSC exams.
File System
A file system organizes files on storage devices. Operations: Create, Delete, Read, Write, Rename. Examples: NTFS, FAT32, ext4.
6. Computer Networks
A computer network is a collection of interconnected computers sharing resources. Advantages: Resource Sharing, Communication, Data Sharing, Internet Access.
Types of Networks
- PAN – Personal Area Network. Range: Few meters. Example: Bluetooth.
- LAN – Local Area Network. Examples: Office, School, College. Advantages: High speed, Low cost.
- MAN – Metropolitan Area Network. Covers an entire city.
- WAN – Wide Area Network. Largest network. Example: Internet.
Network Topologies
- Bus – Single cable. Simple. Disadvantage: Cable failure affects network.
- Star – Central hub. Most commonly used. Advantage: Easy troubleshooting.
- Ring – Devices connected in a circle. Data flows in one direction.
- Mesh – Every node connected. Highly reliable. Disadvantage: Expensive.
- Tree – Combination of Star and Bus.
OSI Model (Seven Layers)
- Physical
- Data Link
- Network
- Transport
- Session
- Presentation
- Application
Important for TNPSC.
TCP/IP Model
Layers: Network Access, Internet, Transport, Application.
IP Address
- IPv4 – 32-bit. Example: 192.168.1.1
- IPv6 – 128-bit. Developed to overcome IPv4 limitations.
- MAC Address – Physical address of a network interface. Assigned by manufacturer.
Network Devices
- Hub – Broadcasts data to all devices.
- Switch – Sends data only to destination. More efficient than Hub.
- Router – Connects different networks. Used for Internet connectivity.
- Bridge – Connects LAN segments.
- Gateway – Connects different protocols.
Transmission Media
- Guided – Twisted Pair Cable, Coaxial Cable, Optical Fiber.
- Unguided – Radio, Microwave, Satellite.
Network Protocols
HTTP, HTTPS, FTP, SMTP, POP3, IMAP, DNS, DHCP, Telnet, SSH, TCP, UDP. Know default purposes for TNPSC.
Network Security
Threats – Virus, Worm, Trojan, Spyware, Ransomware, Phishing.
Protection – Firewall, Antivirus, Encryption, VPN, Authentication.
Cryptography
Plain Text → Encryption → Cipher Text → Decryption → Original Message.
Types: Symmetric Key, Asymmetric Key.
7. Software Engineering
Software Engineering is the systematic approach to software development. Objectives: High Quality, Low Cost, Maintainability, Reliability.
SDLC (Software Development Life Cycle)
- Requirement Analysis
- Planning
- Design
- Coding
- Testing
- Deployment
- Maintenance
Frequently asked.
Software Development Models
- Waterfall Model – Sequential. Advantage: Simple. Disadvantage: No flexibility.
- Spiral Model – Risk-based. Suitable for large projects.
- Prototype Model – Customer feedback included.
- Agile Model – Iterative. Popular in IT industry.
Software Testing
Purpose: Identify defects.
Levels – Unit Testing, Integration Testing, System Testing, Acceptance Testing.
Testing Types – Black Box, White Box, Regression, Smoke, Performance, Load, Stress Testing.
Software Quality Attributes – Reliability, Availability, Efficiency, Security, Maintainability, Portability, Scalability.
CASE Tools – Computer Aided Software Engineering Tools. Used for: Design, Documentation, Testing, Maintenance.
8. Web Technologies
- HTML – HyperText Markup Language. Used to create web pages. Common tags: , ,
, ,,
, ,
,
,