Coding

Coding rounds, worked example by worked example.

Python, Java, C, C++. And the data structures and algorithms that actually show up in placement coding rounds.

Pattern problems, arrays, strings, trees, graphs, dynamic programming. Every solution is runnable; every complexity claim is justified.

374
articles
4
languages covered
DSA
core focus
All coding articles

Solve in the language your placement test wants.

Browse all FACE Prep articles
AI for Engineers

The 6-Month AI Roadmap for CSE Students: 2026 Plan

A month-by-month AI learning plan built on your CSE foundations: ML theory, deployment skills, and portfolio projects calibrated for placement season.

19 May 2026 · 7 min read
AI for Engineers

2026 AI Roadmap for ECE Students: From Electronics to ML

ECE coursework in signal processing and linear algebra gives you a head-start on the ML math layer. Here is the 6-month plan to build on it.

19 May 2026 · 6 min read
AI for Engineers

8 Python Coding Patterns in AI/ML Fresher Interviews 2026

Eight Python coding patterns that repeat in AI/ML fresher interviews, from pandas groupby and numpy broadcasting to implementing logistic regression in 20 lines.

19 May 2026 · 9 min read
AI for Engineers

Top 5 AI Projects for Fresher Resumes in 2026

Five AI project types that generate interview callbacks at Indian fresher drives in 2026, ranked by recruiter-side hireability impact, not technical complexity.

19 May 2026 · 10 min read
Placement Prep

C Programs Set 2: Six Placement-Round Problems Solved

Reverse a number, sum of digits, Armstrong check, GCD, Fibonacci, and prime with sqrt optimisation. Code, step traces, and time complexity for each.

18 May 2026 · 9 min read
AI for Engineers

Pandas and NumPy Interview Questions for AI/ML Freshers: 2026 Guide

The 15 Pandas and 8 NumPy operations that recur in AI/ML fresher screening rounds in 2026, with answer patterns and key gotchas.

18 May 2026 · 8 min read
Placement Prep

Transpose of a Matrix: C, C++, Java and Python Code

Full code to find the transpose of a matrix in C, C++, Java and Python. Covers square and rectangular inputs, in-place swap, and O(rows*cols) complexity.

18 May 2026 · 8 min read
Placement Prep

Introduction to Arrays in C Programming

Learn how arrays work in C, from declaration and initialisation to 1D and 2D types, core operations, and the patterns that appear in placement interviews.

17 May 2026 · 8 min read
Placement Prep

Balanced Parenthesis Checker: Stack-Based Solution With Code

Step-by-step guide to checking balanced parentheses using a stack in Python and Java, with time and space complexity analysis for placement rounds.

17 May 2026 · 5 min read
Placement Prep

Constants in C and C++: const, define, constexpr Explained

Learn to declare constants in C and C++ using const, #define, enum, and constexpr. Includes examples, comparison table, and placement MCQ patterns.

17 May 2026 · 6 min read
Placement Prep

Escape Sequences in C: Complete Guide with Examples

A complete reference for C escape sequences with code examples and traced output. Covers newline, tab, null, and placement-round output questions.

17 May 2026 · 6 min read
Placement Prep

Factorial Program in C, C++ and Java: 4 Methods

Find the factorial of a number in C, C++ and Java using iterative, recursive, tgamma, and BigInteger methods, with working code and a side-by-side comparison.

17 May 2026 · 7 min read
Placement Prep

File Handling in Python: Open, Read, Write, Delete

Master Python file handling for placement exams. Covers open modes, the with statement, read/write methods, and the os module with runnable examples.

17 May 2026 · 5 min read
Placement Prep

Functions in C and C++: What Placement Tests Actually Test

Declarations, definitions, pass by value, pass by reference: the function concepts that C and C++ placement OA rounds check repeatedly.

17 May 2026 · 7 min read
Placement Prep

How to Concatenate Strings in Python: 5 Methods with Examples

Five methods to concatenate strings in Python: +, join(), f-strings, format(), and %, with code examples, performance trade-offs, and placement round tips.

17 May 2026 · 5 min read
Placement Prep

Core Java Interview Questions for Freshers (With Answers)

Thirty core Java interview questions with answers covering OOP, Collections, Exception Handling, and Multithreading. Built for service-tier technical interviews.

17 May 2026 · 9 min read
Company Corner

Infosys Certification Exams 2026: Springboard, Pattern, and Prep

What Infosys certifications exist in 2026, how Springboard registration works, exam pattern, syllabus areas, and prep methods for engineering students.

17 May 2026 · 6 min read
Placement Prep

Python Iterators Explained: How the Protocol Works

Python iterators power every for loop in the language. Learn how __iter__ and __next__ work, build a custom iterator class, and avoid the interview mistakes.

17 May 2026 · 7 min read
Placement Prep

int main() vs int main(void) in C and C++: The Difference Explained

In C++, int main() and int main(void) are identical. In C, empty parentheses mean unspecified arguments, void means none. The full breakdown with code examples.

17 May 2026 · 5 min read
Career Roadmap

Programming Skills That Pay for Freshers in 2026

Six skills separate freshers who clear product-company technical screens from those who don't. Here is what they are and how to build them.

17 May 2026 · 6 min read
Placement Prep

Palindrome Program in Python: Check Numbers and Strings

Five methods to check palindromes in Python: integer reversal, slicing, two-pointer, and recursion. Step-traces, complexity table, and placement context included.

17 May 2026 · 6 min read
Placement Prep

Multiplication Table Program in C, C++, Java, and Python

Write a multiplication table program in C, C++, Java, and Python using for and while loops. Includes algorithm, sample I/O, output formatting, and placement context.

17 May 2026 · 7 min read
Placement Prep

Program to Find the Largest Palindrome in an Array

Step-by-step walkthrough to find the largest palindrome in an array of integers, with Python code, two worked examples, and complexity analysis.

17 May 2026 · 6 min read
Placement Prep

Positive, Negative, or Zero: Number Sign Program in 4 Languages

Check if a number is positive, negative, or zero in C, C++, Java, and Python. Covers the three-branch algorithm, ternary operators, and integer overflow edge cases.

17 May 2026 · 5 min read
Placement Prep

Solid and Hollow Rectangle Star Pattern Programs

Learn to print solid and hollow rectangle star patterns with programs in C, Python, and Java. Covers loop logic, worked output, and common coding mistakes.

17 May 2026 · 8 min read
Placement Prep

Python Variable Scope: Local and Global Variables Explained

Learn how local and global variables work in Python, when to use the global keyword, and how scope errors appear in placement coding tests.

17 May 2026 · 5 min read
Company Corner

Sort Elements by Frequency: 3 Approaches for Wipro Interviews

Sort elements of an array by frequency using HashMap sort, bucket sort, and TreeMap. Python and Java code examples, complexity table, and Wipro NTH context.

17 May 2026 · 7 min read
Placement Prep

String Operations in Python: 10 Programs Every Fresher Should Know

Master Python string operations with 10 working code examples: reverse, concatenate, check palindromes, count vowels, and format strings. Built for placement prep.

17 May 2026 · 5 min read
Company Corner

TCS CodeVita Questions from Previous Editions (With Solutions)

TCS CodeVita is a global coding contest separate from TCS NQT. Covers problem categories, verified sample problems, and a prep roadmap across recent CodeVita editions.

17 May 2026 · 10 min read
Company Corner

TCS NQT Coding Questions and Answers: 2026 Format and Strategy

The TCS NQT coding section gives you 30 minutes and 2 questions. Understand the 2026 format, cutoffs, sample questions with solutions, and prep strategy.

17 May 2026 · 6 min read
Placement Prep

Tokens in C: Keywords, Identifiers, Constants, and Operators Explained

Every C program breaks down into six token types. Here is what each one does, the rules that govern each, and the mistakes that trip up students in placement tests.

17 May 2026 · 9 min read
Placement Prep

Variables and Keywords in C: A Complete Reference

Learn the rules for naming variables in C, all 32 reserved keywords by category, storage classes, scope, and the interview traps that trip up placement candidates.

17 May 2026 · 7 min read
Placement Prep

Area of Circle in Python: Program Guide with math.pi

Three Python programs to calculate circle area: hardcoded π, math.pi, and numpy.pi. Covers input handling, edge cases, and verified outputs for r=5.

11 May 2026 · 5 min read
Placement Prep

Armstrong Number in Python: 3 Easy Programs

Python programs to check Armstrong numbers: while loop, list comprehension, and a range finder. Verified digit-power derivations for 153, 370, 371, 407, and 9474.

11 May 2026 · 7 min read
Placement Prep

Assignment Operators in Python: Complete Guide with Examples

All 8 Python assignment operators with code examples: = and the 7 augmented forms (+=, -=, *=, /=, %=, **=, //=), walrus :=, and placement test traps.

11 May 2026 · 5 min read
Placement Prep

Python Logical Operators: and, or, not With Examples

Python's and, or, not keywords evaluate conditions, short-circuit expressions, and power the default-value idiom. Truthy/falsy, bitwise differences, and common bugs.

11 May 2026 · 8 min read
Placement Prep

Check if Two Arrays Are Disjoint: C, C++, Java and Python

Four approaches to check if two arrays share no common elements: nested loops O(m×n), sort plus two-pointer, and hash set O(m+n), with C, C++, Java, and Python code.

11 May 2026 · 9 min read
Placement Prep

Commonly Asked C Technical Interview Questions (with Answers)

The seven concept areas C interviewers test most: pointers, memory, strings, storage classes, preprocessor, structs, and undefined behavior, with worked examples.

11 May 2026 · 6 min read
Placement Prep

Count the Number of Ways to Reach the Nth Stair

Staircase problem solved four ways: naive recursion, memoized DP, tabulation, and O(1) space. Python code, verified Fibonacci values, and k-step variation.

11 May 2026 · 6 min read
Placement Prep

Python Decorators: @syntax, functools.wraps, and Practical Examples

Learn Python decorators step by step: @decorator syntax, functools.wraps, parametrized decorators, class-based decorators, and placement interview examples.

11 May 2026 · 5 min read
Placement Prep

Modular Exponentiation in Python: pow(b, e, n) Explained

Compute b^e mod n without overflow using Python's three-argument pow(b, e, n) or the square-and-multiply algorithm. Worked example included.

11 May 2026 · 6 min read
Placement Prep

Find All Ancestors of a Node in a Binary Tree

Find all ancestors of a node in a binary tree with recursive and iterative Python solutions. Includes complexity analysis and placement interview patterns.

11 May 2026 · 6 min read
Placement Prep

Min and Max of Arithmetic Expression with + and * (Interval DP)

Find the minimum and maximum of a + and * expression by placing parentheses, using interval DP with a step-by-step worked example.

11 May 2026 · 5 min read
Placement Prep

Shortest Path Between Two Vertices in an Undirected Graph

BFS-based shortest path in undirected graphs: adjacency-list representation, parent-tracking, path reconstruction, and Python + C++ code.

11 May 2026 · 6 min read
Placement Prep

Check if a Character is a Vowel or Consonant in C

Three C programs classify any character as a vowel, consonant, or non-alphabet input using if-else with tolower(), switch-case, and a strchr() lookup table.

11 May 2026 · 7 min read
Placement Prep

Print All Distinct Elements in an Array in C

Three C programs to print all distinct elements in an array: nested-loop O(N²), sorting, and count-array, with complexity trade-offs and placement interview tips.

11 May 2026 · 6 min read
Placement Prep

Technical Round Self-Study System: 2026 Engineer's Guide

A practical guide for building a self-study technical-round prep system covering DSA, OS, CN, DBMS, and programming: free and low-cost resources included.

11 May 2026 · 5 min read
Placement Prep

Python Conditionals: if, if-else, elif, and Nested if Explained

Python's if, if-else, elif, and nested if statements control program flow. Syntax, worked examples, and truthiness edge cases for 0, '', [], and None.

11 May 2026 · 7 min read
Placement Prep

C Command Line Arguments Set 2: 5 Placement Programs

Five C programs using argc/argv for placement interviews: sum of CLI args, even/odd count, string reverse, safe atoi parsing, and multi-arg processing.

11 May 2026 · 7 min read
Placement Prep

Multithreading in Python: threading Module Complete Guide

Python multithreading with the threading module: create threads, use Lock, RLock, and Semaphore, understand the GIL, and pick the right concurrency tool.

11 May 2026 · 6 min read
Placement Prep

Check if a Graph is a Tree: Three Algorithms in Python

Three algorithms to check if an undirected graph is a tree: DFS with parent tracking, Union-Find, and edge-count plus BFS. Python code for each, O(V+E) analysis.

11 May 2026 · 7 min read
Placement Prep

Count Common Subsequences of Two Strings

Count common subsequences of two strings using DP: derive the recurrence, trace a 4x4 table, implement in Python, and cut space to O(min(m,n)) with a rolling array.

11 May 2026 · 5 min read
Placement Prep

Minimum Number of Jumps to Reach End of an Array

Greedy O(n) and DP O(n²) solutions for the minimum jumps problem, with worked examples verified from scratch and C, Python, Java programs.

11 May 2026 · 9 min read
Placement Prep

Matrix Row and Column Sums: Find the Greatest

Find the sum of each row and column of a matrix, then identify which row and column has the greatest sum. Algorithm, C, Java, Python code, complexity.

11 May 2026 · 7 min read
Placement Prep

Frequency of Each Array Element: 3 Approaches

Count how often each element appears in an array using nested loops, sorted sweep, and hash map. Python and C++ code with complexity analysis and edge cases.

11 May 2026 · 7 min read
Placement Prep

Find Greatest of Two or Three Numbers: C, Python, and Java

If-else, ternary, and built-in approaches to finding the max of 2 or 3 numbers in C, Python, and Java, with N-numbers loop and edge cases.

11 May 2026 · 6 min read
Placement Prep

Kth Maximum Element in a Binary Search Tree

Reverse inorder traversal finds the k-th maximum in a BST in O(H+k) time. Worked example with a 7-node tree, C++, Java, and Python code, plus edge cases.

11 May 2026 · 8 min read
Placement Prep

Median of Two Sorted Arrays: Brute Force and Binary Search

Find the median of two sorted arrays using the merge approach and the O(log min(m,n)) binary search partition. Verified Python code included.

11 May 2026 · 8 min read
Placement Prep

Saddle Point of a Matrix: C, C++, Java, and Python Programs

A saddle point is the minimum in its row and the maximum in its column. Learn the O(M×N) two-pass algorithm with working code in C, C++, Java, and Python.

11 May 2026 · 8 min read
Placement Prep

Sum of Numbers in a Range: Naïve, Formula, Prefix Array

Three approaches to the range sum problem: O(n) loop, Gauss O(1) closed-form, and prefix-sum array for repeated queries. Verified examples in C, Java, and Python.

11 May 2026 · 8 min read
Placement Prep

Program to Remove Spaces from a String: Python & C

Remove all whitespace from a string in Python and C: two-pointer, build-new-string, and library one-liners, with complexity analysis and edge cases.

11 May 2026 · 6 min read
Placement Prep

Reverse Every Word in a Sentence: C, Java, Python

Two-pointer algorithm and code in C, Java, and Python to reverse every individual word in a sentence while keeping word order unchanged.

11 May 2026 · 7 min read
Placement Prep

Python Command Line Arguments: sys.argv and argparse

Learn to read Python command line arguments with sys.argv and argparse. Covers basic usage, named flags, type conversion, and practical script patterns.

11 May 2026 · 6 min read
Placement Prep

Python Inbuilt Looping Functions: A Complete Guide

Python's nine built-in iteration helpers: range, enumerate, zip, map, filter, sorted, reversed, iter, and next, with code examples for placement coding rounds.

11 May 2026 · 6 min read
Placement Prep

Python Input: input(), Type Conversion, and Multiple Values

Learn how Python's input() function works, how to convert strings to int or float, read multiple values with split() and map(), and handle EOFError in placement tests.

11 May 2026 · 6 min read
Placement Prep

Regular Expressions in Python: A Complete Guide

Python's re module: core syntax, API functions (search, findall, sub, split), compiled patterns, and real-world email and log examples for placement coding rounds.

11 May 2026 · 8 min read
Placement Prep

Sort All Elements of a Matrix in Ascending Order

Sort every element of an M×N matrix in ascending order: flatten-sort-refill algorithm, worked 3×3 example, row-wise variant, and edge cases explained.

11 May 2026 · 7 min read
Placement Prep

Spiral Matrix Printing: Print a 2D Matrix in Spiral Order

Print a 2D matrix in spiral order with the boundary-shrink approach. Python and Java solutions with traced examples for 3×3, 3×4, and edge cases.

11 May 2026 · 6 min read
Placement Prep

Python operator Module: Operators as First-Class Functions

Python's operator module turns every built-in operator into a callable: add, mul, itemgetter, and more. Faster than lambdas in tight loops.

11 May 2026 · 7 min read
Placement Prep

10 Technical Interview and Aptitude Questions: Set 6 (Solved)

Solved Set 6: arrays vs lists, OOP pillars, macros vs functions, Floyd's cycle detection, and swap-without-temp in C, ten questions campus drives test.

11 May 2026 · 7 min read
Placement Prep

Python Ternary Operator: One-Line if-else with Examples

Python's ternary operator compresses if-else into one line. Learn the syntax, practical examples, nested chaining, and when to stick with if-elif instead.

11 May 2026 · 5 min read
Placement Prep

Python Arrays: Operations, Patterns, and Placement Tips (2026)

Learn Python arrays with the array module, lists vs arrays, common operations, time complexity, and classic placement patterns like rotation and two-sum.

11 May 2026 · 8 min read
Placement Prep

Static Functions in C: Scope, Linkage, and Examples

A static function in C restricts a function to its own source file via internal linkage. Learn scope, name-collision avoidance, and see a two-file worked example.

11 May 2026 · 7 min read
Placement Prep

Add Two Numbers in Python: 5 Methods with Code

Five Python methods to add two numbers: + operator, function, f-string one-liner, float input, and bitwise XOR. Code, output, and when to use each.

10 May 2026 · 8 min read
Placement Prep

Advantages and Features of Python Programming (2026 Guide)

Python's advantages include readable syntax, 700K+ PyPI packages, cross-platform portability, and first-class AI/ML support. Honest look at the trade-offs too.

10 May 2026 · 5 min read
Placement Prep

Merge Sort Algorithm in C, C++, and Java with Examples

Step-by-step merge sort implementation in C, C++, and Java. Covers divide-and-conquer logic, O(n log n) complexity, stability, and comparison with quicksort.

10 May 2026 · 7 min read
Placement Prep

AMCAT Automata Question Bank: LRU Cache and Circular Linked List

Practice set for the AMCAT Automata coding round: LRU cache miss count and sorted circular linked list insertion, with traced test cases and grader notes.

10 May 2026 · 8 min read
Placement Prep

Bitwise Operators in Python: Truth Tables, Idioms, and Examples

Learn Python's 6 bitwise operators (AND, OR, XOR, NOT, left shift, right shift) with truth tables, placement idioms, and worked examples verified from first principles.

10 May 2026 · 6 min read
Placement Prep

Bubble Sort in C, C++, and Java: Code and Complexity

Bubble sort implemented in C, C++, and Java with step-by-step trace, optimised early-exit variant, and O(n²) complexity analysis. Placement-interview ready.

10 May 2026 · 7 min read
Company Corner

C Programs Using Command Line Arguments: Worked Examples

Worked C programs that read input via argc and argv: covers atoi, strtol, and common off-by-one bugs students hit in TCS coding rounds.

10 May 2026 · 7 min read
Placement Prep

Capitalize First and Last Letter of Each Word: Python, C, Java

Capitalize the first and last letter of each word in a string. Covers word-boundary detection, edge cases, and complete code in Python, C, and Java.

10 May 2026 · 6 min read
Placement Prep

Check if a Substring Exists in a String in Python

Five ways to check if a substring exists in a Python string: in operator, find(), index(), count(), and re.search(). Edge cases and KMP included.

10 May 2026 · 5 min read
Placement Prep

Python Closures: Lexical Scope, Late Binding, and Decorators

Learn how Python closures work: nested functions, lexical scope, the nonlocal keyword, the late-binding loop trap, and how decorators use closures under the hood.

10 May 2026 · 6 min read
Placement Prep

Common C Programming Errors: 10 Mistakes to Fix Before Interviews

Syntax errors, off-by-one array indexing, and missing semicolons are the C mistakes that derail placement coding rounds. Here is how to fix every one of them.

10 May 2026 · 6 min read
Placement Prep

break, continue, and pass in Python: A Practical Guide

Learn how break, continue, and pass work in Python loops, with verified code examples, the for-else pattern, and placement exam edge cases.

10 May 2026 · 6 min read
Placement Prep

Factorial in Python: Three Methods for Placement Tests

Three ways to write a factorial in Python: for loop, recursion with the correct base case, and math.factorial, with placement aptitude context.

10 May 2026 · 6 min read
Placement Prep

Guess the Number Game in Python: Code, Logic, and Variants

Build a number-guessing game in Python using random, input(), and while loops. Includes a basic version, a max-attempts variant, and higher-or-lower hint logic.

10 May 2026 · 5 min read
Placement Prep

Python Data Types Explained: int, str, list, dict, tuple

Python determines a variable's type from its value, not a declaration. This guide covers int, float, str, list, tuple, set, and dict with placement-round examples.

10 May 2026 · 6 min read
Placement Prep

exit(), abort(), and assert() in C: When to Use Each

exit() cleans up buffers and calls atexit() handlers; abort() raises SIGABRT with no cleanup; assert() crashes debug builds on false conditions. Learn which to use when.

10 May 2026 · 10 min read
Placement Prep

Exception Handling in Python: Complete Guide

Python exception handling: try, except, else, finally, the exception hierarchy, custom exception classes, raise from chaining, and ExceptionGroup (Python 3.11+).

10 May 2026 · 7 min read
Placement Prep

Find All Triplets With Given Sum: Three Approaches

Solve the find-all-triplets problem three ways: O(n^3) brute force, O(n^2) two-pointer, O(n^2) hashing. Worked trace and Python code.

10 May 2026 · 8 min read
Placement Prep

Array Subset Check in C, C++, Java and Python

Four methods to check if an array is a subset of another, with C, C++, Java and Python code. Time complexity and duplicate handling for placement interviews.

10 May 2026 · 7 min read
Placement Prep

Find the Power of a Number: C, C++, Java, Python

Three approaches to computing the power of a number: iterative O(n), fast O(log n), and library calls. Code in C, C++, Java, and Python with edge-case notes.

10 May 2026 · 7 min read
Placement Prep

Sum of Minimum Absolute Differences in an Array

Sort the array once to find each element's nearest neighbour in O(n log n) time. Python, C++, and C implementations with a worked example and edge case analysis.

10 May 2026 · 7 min read
Placement Prep

Find the Total Number of Islands Using DFS

Count connected-component islands in a binary grid using DFS grid-coloring. Includes O(M×N) complexity proof, edge cases, and working C++, Java, Python code.

10 May 2026 · 5 min read
Placement Prep

Vertical Sum in a Binary Search Tree: Algorithm and Code

Calculate the vertical sum of a BST by grouping nodes at the same horizontal distance. DFS and hashmap approach in Python and C++, with complexity analysis.

10 May 2026 · 6 min read
Placement Prep

Functions in Python: Practical Examples for Placement Prep

Functions in Python with examples: def keyword, arguments vs parameters, return values, recursion, *args/**kwargs, and the placement-test patterns interviewers reuse.

10 May 2026 · 8 min read
Placement Prep

Python Generators: Generator Functions and Expressions with Examples

Learn how Python generators work, how yield differs from return, and why lazy evaluation matters in placement coding rounds and production pipelines.

10 May 2026 · 6 min read
Placement Prep

Hello World in Python: Your First Program (2026)

Run print("Hello World") in Python 3.13, understand why the Python 2 print statement breaks in Python 3, add an f-string variant, and spot three errors beginners make.

10 May 2026 · 5 min read
Placement Prep

Hello World in Python: Your First Program Explained

Learn to write and run a Hello World program in Python 3.14 using print(). Covers single quotes, double quotes, triple quotes, f-strings, and common beginner errors.

10 May 2026 · 5 min read
Placement Prep

Variable Scope in C: Block, File, and Storage Class Rules

C has four kinds of variable scope. This guide covers block scope, file scope, storage classes, and the output puzzles that appear in placement tests.

10 May 2026 · 9 min read
Placement Prep

How to Reverse a String in Python: Two Simple Methods

Reverse a string in Python with two methods: the slice idiom s[::-1] and an explicit while loop. Code, output, complexity, and the interview-grade choice.

10 May 2026 · 6 min read
Placement Prep

Inheritance in Python: Types, MRO, and Working Examples

Python supports 5 inheritance types. This guide covers single, multiple, multilevel, hierarchical, and hybrid inheritance with MRO, super(), and placement-round patterns.

10 May 2026 · 6 min read
Placement Prep

Insertion Sort in C, C++, Java: Code, Trace, Time Complexity

Insertion sort explained with a worked trace, full C, C++, and Java implementations, and the time complexity recruiters actually ask about.

10 May 2026 · 9 min read
Placement Prep

Lambda Functions in Python: Syntax, map, filter, and Pitfalls

Learn Python lambda syntax, how to use it with map(), filter(), and sorted(), when to prefer def, and the late-binding pitfall that catches most beginners.

10 May 2026 · 5 min read
Placement Prep

Numbers in Python: Integer, Float and Complex Types

Python's three numeric types are int, float, and complex. Code examples cover each type, type conversion rules, and built-in math functions.

10 May 2026 · 6 min read
Placement Prep

Opening and Closing Gates Validation Algorithm

Validate opening and closing gate pairs using a stack or counter to determine if people are safe. Python and C++ solutions with O(n) time complexity.

10 May 2026 · 4 min read
Placement Prep

Polymorphism in Python: Complete Guide

How Python implements polymorphism through duck typing, method overriding, operator overloading, and abstract base classes, with code examples for technical interviews.

10 May 2026 · 6 min read
Placement Prep

Pointers and Arrays in C: How They Differ and Where They Don't

Arrays and pointers in C are not the same type, but they decay into each other in most expressions. Here is what that means in placement code.

10 May 2026 · 8 min read
Placement Prep

Print n-th Term of Fibonacci Series in C, C++, and Java

Compute the n-th Fibonacci number in C, C++, and Java using iteration, recursion, DP, and matrix exponentiation. Full code with complexity notes.

10 May 2026 · 10 min read
Placement Prep

Check If All Array Elements Can Be Made Equal (Multiply by 2 or 3)

Given an array, check whether all elements can be made equal by multiplying any element by 2 or 3. O(n log max) solution with code in C, C++, Java, and Python.

10 May 2026 · 5 min read
Placement Prep

Program to Find Array Type (Even, Odd, or Mixed)

Single-pass algorithm to classify an array as all-even, all-odd, or mixed, with working C, C++, Java, and Python implementations and edge-case analysis.

10 May 2026 · 5 min read
Placement Prep

Longest Subarray with Average ≥ k: O(n) Prefix-Sum Solution

Transform average ≥ k to sum ≥ 0, then use prefix sums and monotonic stack for O(n) time. Includes brute-force baseline, math derivation, and C++/Python code.

10 May 2026 · 8 min read
Placement Prep

Toggle Each Character in a String: C, C++, Java, Python

C, C++, Java, and Python programs to toggle each character in a string. Covers the ASCII XOR bit-flip trick, isalpha() guard, and edge cases for placement coding tests.

10 May 2026 · 6 min read
Placement Prep

Trace All Paths in a Directed Graph: DFS with Backtracking

Find every path between two nodes in a directed graph using DFS with backtracking. Python and C code included, with complexity analysis.

10 May 2026 · 6 min read
Placement Prep

Python Built-In Modules: Key Ones for Placement Coding Rounds

Python's standard library ships over 200 modules accessible via import. Learn the five that appear most in placement coding rounds, with working code examples.

10 May 2026 · 6 min read
Placement Prep

How to Install Python on Windows, Linux and macOS (2026)

Step-by-step Python 3.13 installation for Windows, Linux (apt, dnf, pacman), and macOS (Homebrew, official installer). Covers PATH setup and version verification.

10 May 2026 · 5 min read
Placement Prep

Generate Random Numbers in Python: randint, choice, seed

Python's random module covers seven functions used in placement tests and projects. Covers randint, choice, sample, shuffle, uniform, seed, and the secrets module.

10 May 2026 · 5 min read
Placement Prep

Recursion in Python: Concept, Examples, and Common Pitfalls

How recursion works in Python: base case, recursive case, call-stack mechanics, classic examples (factorial, Fibonacci, sum), depth limits, memoisation, and pitfalls.

10 May 2026 · 7 min read
Placement Prep

Remove Duplicates from a Linked List: Sorted and Unsorted

Remove duplicates from sorted and unsorted linked lists. Covers single-pass O(n)/O(1) for sorted, HashSet and nested-loop for unsorted, with C++ and Python code.

10 May 2026 · 6 min read
Placement Prep

Solving Sudoku Using Backtracking

Learn to solve Sudoku with backtracking in C++ and Python. Covers the is_safe() check, recursive solver structure, O(9^m) time complexity, and MRV optimisation.

10 May 2026 · 7 min read
Placement Prep

Sort a Stack Using a Temporary Stack and Recursion

Two ways to sort a stack using only push and pop: the temp-stack method (iterative) and recursion (sortStack + insertSorted). Both O(n²). C++ and Python code.

10 May 2026 · 8 min read
Placement Prep

Sum of Natural Numbers in Python: 3 Methods Explained

Three ways to calculate the sum of natural numbers in Python: the O(1) Gauss formula, sum() with range(), while loop, and recursion. Working code for each.

10 May 2026 · 5 min read
Placement Prep

10 Technical Aptitude Questions: Set 3 (Solved)

Set 3 of solved technical aptitude questions covering data structures, DBMS, OS, networking, and OOP: the mix campus drives test most often.

10 May 2026 · 7 min read
Placement Prep

Abstraction in Python: Abstract Classes and the ABC Module

Use Python's ABC module to create abstract classes that enforce method contracts. Includes working code, a common error walkthrough, and placement-round tips.

9 May 2026 · 6 min read
Placement Prep

Program to Add Two Fractions: C, C++ and Java with GCD

C, C++ and Java programs to add two fractions and display the sum in reduced form. Algorithm, Euclidean GCD, integer overflow handling, and verified examples.

9 May 2026 · 5 min read
Placement Prep

Add Two Fractions and Display Simplest Form: Python Guide

Python program to add two fractions and reduce to simplest form using math.gcd. Algorithm, code, three verified examples, and edge cases for placement coding rounds.

9 May 2026 · 5 min read
Placement Prep

Arithmetic Operators in Python: All 7 Explained with Examples

Python's 7 arithmetic operators explained with code examples, operator precedence rules, and the edge cases most placement-exam candidates miss.

9 May 2026 · 5 min read
Placement Prep

5 C Programs Asked in Placement Tests: Factorial, Even/Odd, Swap

Factorial, even/odd check, and three swap methods: five C programs that appear across TCS, Infosys, and aptitude platforms. Annotated code with complexity notes.

9 May 2026 · 6 min read
Placement Prep

C Programs for You: Set 3, Pointers, Recursion, and Linked Lists

Eight C programs with full solutions and output traces covering pointers, recursion, array algorithms, and linked-list operations.

9 May 2026 · 8 min read
Placement Prep

Check If Two Strings Are Anagrams: C, C++, Java, Python

Count array and sort-then-compare: two anagram check approaches in C, C++, Java and Python with O(n) and O(n log n) complexity analysis.

9 May 2026 · 7 min read
Placement Prep

Check Whether a Character is an Alphabet: C, C++, Python, Java

Programs in C, C++, Python, and Java to check if a character is an alphabet, covering ASCII range logic, isalpha(), Unicode edge cases, and placement test traps.

9 May 2026 · 9 min read
Placement Prep

Classes and Objects in Python: Syntax, Examples, and OOP Basics

Learn how Python classes and objects work: class syntax, __init__, instance vs class attributes, and how OOP questions appear in placement rounds.

9 May 2026 · 5 min read
Placement Prep

How to Read Complicated Declarations in C

The right-left rule decodes any C declaration in a predictable sequence. Step-by-step examples for pointers, arrays, and function pointers, with cdecl cross-checks.

9 May 2026 · 7 min read
Placement Prep

Constructors in Python: __init__, Default, and Parameterised

How Python constructors work: __init__ syntax, default vs parameterised patterns, the mutable-default-argument pitfall, and placement assessment context.

9 May 2026 · 5 min read
Placement Prep

Binary to Octal Conversion in C, C++, Java and Python

Convert binary to octal using the group-of-3 method. C, C++, Java, and Python code with worked examples, edge-case handling, and O(n) complexity analysis.

9 May 2026 · 8 min read
Placement Prep

Decimal to Binary Conversion in C, C++, Java, and Python

Four implementations to convert decimal to binary in C, C++, Java, and Python, with the algorithm, worked examples, and complexity analysis.

9 May 2026 · 5 min read
Placement Prep

Octal to Binary Conversion in C, C++, Java and Python

Step-by-step octal to binary conversion with two methods, worked examples, and ready-to-run code in C, C++, Java and Python.

9 May 2026 · 7 min read
Placement Prep

Decimal to Octal Conversion in C, C++, Java, and Python

Step-by-step decimal to octal conversion in C, C++, Java, and Python: division algorithm, built-in functions, and where this appears in placement coding tests.

9 May 2026 · 6 min read
Placement Prep

Binary to Decimal Conversion: Algorithm, Code, and Edge Cases

Positional weighting, three verified worked examples, and C, Python, Java implementations, including built-in functions and signed-number edge cases.

9 May 2026 · 6 min read
Placement Prep

Count Number of Digits in an Integer: 3 Methods

Three approaches to count digits in an integer: loop, recursion, and O(1) logarithm. Compare time complexity, edge cases, and what placement tests expect.

9 May 2026 · 6 min read
Placement Prep

N-Digit Numbers with Non-Decreasing Digits: Two Approaches

Count n-digit sequences with non-decreasing digits using C(n+9,9). Stars-and-bars proof, DP solution, Python code, and worked examples for n=1 through n=5.

9 May 2026 · 5 min read
Placement Prep

Conceptual C MCQs for Placement Interviews

Five essential C programming MCQs on pointers, static variables, struct sizing, and token counting, with step-by-step traces for placement tests.

9 May 2026 · 6 min read
Placement Prep

Diamond Pattern in Python: Two Programs Explained

Two Python programs to print full diamond and half-diamond star patterns, with the loop logic and space-count formula explained for placement prep.

9 May 2026 · 4 min read
Placement Prep

range vs xrange in Python: What Changed in Python 3

Python 2 had both range() and xrange(). Python 3 removed xrange() and made range() lazy. This guide covers memory behaviour, indexing gotchas, and when to use list().

9 May 2026 · 6 min read
Placement Prep

Python Dictionaries: Operations, Methods, and Examples

Learn how Python dictionaries store key-value pairs: how to create, access, modify, delete, and iterate over them. Includes dict comprehensions and placement examples.

9 May 2026 · 6 min read
Placement Prep

Count Vowels in a Character Array Using Pointers in C

Step-by-step C program to count vowels in a character array using pointer arithmetic. Algorithm, traced output, case-insensitive variant, and complexity analysis.

9 May 2026 · 5 min read
Placement Prep

Find All Missing Elements of a Range: 3 Approaches Ranked

Three approaches to find all missing elements of a range: from O(n) hashing to in-place marking, with complexity tables and placement interview context.

9 May 2026 · 6 min read
Placement Prep

Find All Nodes at K Distance from Root in a Binary Tree

Two methods to print every node exactly k edges from the root: recursive reduction and BFS level-tracking, with complexity analysis and placement context.

9 May 2026 · 7 min read
Placement Prep

Quadratic Equation Roots in C, C++, Java, and Python

Algorithm, discriminant logic, and working code to find all roots of a quadratic equation in C, C++, Java, and Python, covering real, equal, and complex root cases.

9 May 2026 · 8 min read
Placement Prep

Area of a Circle in C, C++, Java and Python

Step-by-step programs to find the area of a circle in C, C++, Java and Python, with sample output and common coding-round pitfalls.

9 May 2026 · 6 min read
Placement Prep

Array Subset Check: 4 Methods in C++, Java, Python

Check if an array is a subset of another using four methods: two loops, binary search, sort-merge, and hashing. C++, Java, and Python code with time complexity.

9 May 2026 · 8 min read
Placement Prep

Find Repeating Elements in an Array: Three C++ Approaches

Three C++ methods to find duplicate elements in an array: brute-force O(n²), sorting O(n log n), and hashing O(n). Code, complexity table, and placement interview tips.

9 May 2026 · 6 min read
Placement Prep

Find Prime Numbers in a Given Range: C, C++, Java, and Python

Complete programs to find prime numbers in a given range in C, C++, Java, and Python. Covers trial division, sieve approach, and edge case analysis.

9 May 2026 · 7 min read
Placement Prep

Find the First Non-Repeating Character in a String

Solve the first non-repeating character problem: O(n²) brute force and O(n) hash map with worked examples in Python, C, and Java.

9 May 2026 · 5 min read
Placement Prep

Find the Largest Element in an Array Using Python

Four Python methods to find the largest element in an array: loop, max(), sorted(), and NumPy. Includes time complexity notes for campus placement coding rounds.

9 May 2026 · 5 min read
Placement Prep

Count Ways to Reach a Score in a Game: DP Approach

Count unordered ways to reach a target score with DP. Verified recurrence, step-by-step trace, Python and C code, time and space complexity for placement rounds.

9 May 2026 · 6 min read
Placement Prep

Decode Ways: Count All Decodings of a Digit Sequence

Count all valid letter strings a digit sequence can represent, using recursion, memoization, and dynamic programming, with worked examples and edge-case handling.

9 May 2026 · 6 min read
Placement Prep

Find the Product of All Leaf Nodes in a Binary Tree

Step-by-step guide to finding the product of all leaf nodes in a binary tree using recursive DFS. Python, Java, and C++ code with O(n) complexity analysis.

9 May 2026 · 6 min read
Placement Prep

Find the Smallest Element in a Python List

Find the smallest element in a Python list using a for loop or the built-in min(). Covers linear search algorithm, edge cases, and O(n) complexity.

9 May 2026 · 5 min read
Placement Prep

Sum of All Odd Frequency Elements in an Array

Find the sum of elements with odd frequency in an array using hash maps. C++, Java, and Python code with worked example, trace, and O(n) complexity analysis.

9 May 2026 · 7 min read
Placement Prep

Find the Sum of Natural Numbers With and Without Recursion

Formula, iterative, and recursive programs to find the sum of N natural numbers, with C and Python code, time-space trade-offs, and placement-test context.

9 May 2026 · 6 min read
Placement Prep

Find the Second Smallest Element in an Array: 3 C++ Approaches

Three C++ methods to find the second smallest array element: sort, two-pass, and single-pass. Complexity table, edge cases, and placement interview tips.

9 May 2026 · 6 min read
Placement Prep

For Loop in Python: Syntax, range(), and Worked Examples

Learn how Python's for loop iterates over lists, strings, and ranges. Covers range(), break, continue, nested loops, and placement coding patterns.

9 May 2026 · 6 min read
Placement Prep

Function Overloading in C: Why It Fails and What Works

C does not support function overloading natively. Learn why, and explore C11 _Generic, stdarg.h, and function pointers as the standard workarounds.

9 May 2026 · 5 min read
Placement Prep

Function Prototype in C: K&R Style, ANSI Syntax, Header Files

Learn C prototype syntax: the ANSI form, the K&R legacy style, the void vs empty-parentheses trap, and how to structure header files correctly.

9 May 2026 · 8 min read
Placement Prep

Functions in Python with Examples: Complete Guide

Learn to define, call, and use Python functions with examples covering parameters, return values, lambda, and recursion for placement interview prep.

9 May 2026 · 5 min read
Placement Prep

GCD of Two Numbers: Iterative, Recursive, and Python

Learn three methods to find the GCD of two numbers: iterative loop, Euclidean algorithm, and Python's math.gcd, with code examples and complexity.

9 May 2026 · 6 min read
Placement Prep

Function Arguments in Python: 5 Types Explained

Learn all five Python argument types: positional, keyword, default, *args, and **kwargs, with code examples and the ordering rules that placement tests check.

9 May 2026 · 5 min read
Placement Prep

Heap Sort in C, C++, and Java: Step-by-Step Guide

Heap sort runs O(n log n) in every case. Guide covers max-heap construction, heapify traced on a 6-element array, working C/C++/Java code, and complexity comparison.

9 May 2026 · 7 min read
Company Corner

Competitive Coding and Placements: Skills That Land Tech Jobs

Competitive coding builds the DSA fluency tech interviews test. Here is what transfers, which platforms to use, and how to build a visible record.

9 May 2026 · 6 min read
Placement Prep

How to Approach a Competitive Programming Question

A structured five-step approach to competitive programming questions: from reading constraints to testing edge cases, built for placement coding rounds.

9 May 2026 · 6 min read
Placement Prep

Height of a Binary Tree: Recursive and Iterative Methods

Calculate binary tree height using recursive (O(h) stack) and iterative BFS (O(w) queue) methods in C++, with trace-through examples and complexity trade-offs.

9 May 2026 · 6 min read
Placement Prep

String Length Without strlen() in C: 3 Placement-Ready Methods

Three C programs that find string length without strlen(): loop scan, pointer arithmetic, and recursion, with traced outputs for TCS NQT and AMCAT rounds.

9 May 2026 · 6 min read
Placement Prep

Generate Binary Numbers 1 to N: Queue and Arithmetic Methods in Java

Two Java methods to generate binary numbers from 1 to N: arithmetic division and queue-BFS. Includes Java code, complexity analysis, and placement interview context.

9 May 2026 · 5 min read
Career Roadmap

How to Get Placed in Top IT Companies: 2026 Roadmap

Three tiers of top IT companies, eligibility benchmarks, and a 12-month DSA-plus-build-project prep roadmap for Indian engineering students.

9 May 2026 · 6 min read
Placement Prep

How to Reverse a String in Python: 5 Methods Explained

Five ways to reverse a string in Python: slicing, reversed(), loop, recursion, and word-by-word, with code, complexity, and placement-round tips.

9 May 2026 · 5 min read
Placement Prep

Global and Static Variables in C: Initialization Rules

Global and static variables in C are zero-initialized by default. Learn storage-class rules, BSS vs. data segment, and placement MCQ patterns for TCS NQT and AMCAT.

9 May 2026 · 7 min read
Placement Prep

Python In-Place Operator Functions: iadd, isub, imul and More

Python's operator module exposes iadd, isub, imul and 7 more in-place functions. Traced examples show what changes between mutable lists and immutable ints.

9 May 2026 · 7 min read
Placement Prep

Internal and External Linkage in C: With Code Examples

The static keyword restricts a C identifier to one translation unit; extern exposes it across files. Learn the rules, see the code, and know what interviewers test.

9 May 2026 · 7 min read
Placement Prep

Python itertools for Placements: 7 Functions That Matter

Master Python's itertools module with verified examples covering chain, permutations, combinations, product, groupby, count, and cycle for placement coding rounds.

9 May 2026 · 7 min read
Placement Prep

Leap Year Program in Python: 3 Methods with Code

Three Python methods to check if a year is a leap year: calendar module, nested if statements, and a single boolean condition. Verified code and edge cases included.

9 May 2026 · 6 min read
Placement Prep

C/C++ Line Splicing: Backslash, Macros, and Traps

Line splicing in C and C++ joins lines ending with a backslash before compilation. Covers comments, macros, and placement test tricky-output traps.

9 May 2026 · 5 min read
Placement Prep

Python Loops: for, while and Nested Loops

Learn Python for loops, while loops and nested loops with syntax, worked examples and placement test patterns. Covers break, continue and pass.

9 May 2026 · 5 min read
Placement Prep

Merge Two Sorted Arrays: C, C++, Java and Python

Three approaches to merge two sorted arrays in C, C++, Java, and Python: two-pointer, concatenate-and-sort, and min-heap, with time and space complexity.

9 May 2026 · 7 min read
Company Corner

Microsoft Interview Questions for Freshers: Technical and HR

Round-by-round question patterns for Microsoft's fresher technical and HR interviews: DSA topics, CS fundamentals, project deep-dives, and 2026 prep strategy.

9 May 2026 · 7 min read
Company Corner

Microsoft Placement Papers: Sample Questions and Prep Guide

Real sample problem types from past Microsoft OAs, classified by topic with approach hints, plus a four-week prep plan for the 2-problem format.

9 May 2026 · 6 min read
Placement Prep

Minimum Sum Partition: DP Table, Worked Example, and Code

Partition an integer array into two subsets with the smallest sum difference. DP table formulation, step-by-step worked example, and Python code for placement prep.

9 May 2026 · 5 min read
Placement Prep

Python Modules: Create, Import, and Use Them Right

A practical guide to Python modules: what they are, three import styles, built-in modules for placement tests, and the __name__ guard with working code.

9 May 2026 · 5 min read
Placement Prep

Nested Loops in Python: Types, Syntax, and Examples

Four types of nested loops in Python with working code and placement-round examples. Covers for, while, mixed variants, and break/continue control.

9 May 2026 · 7 min read
Company Corner

Opening and Closing Gates Problem: Wipro Coding Walkthrough

The opening and closing gates problem is a Wipro coding round question based on balanced parentheses. Algorithm, worked solution, and test cases all in one place.

9 May 2026 · 6 min read
Placement Prep

Operator Overloading in Python: Magic Methods with Examples

How Python maps +, -, == and other operators to dunder methods like __add__ and __lt__. Covers the full magic-method table plus two worked placement-style examples.

9 May 2026 · 5 min read
Company Corner

Persistent Systems Placement Papers 2026: Test Pattern and Solutions

Persistent Systems' 60-question online test covers technical CS and aptitude. Full 2026 test pattern, section syllabus, and verified worked sample questions.

9 May 2026 · 8 min read
Placement Prep

Python Program to Print Prime Numbers in a Range

Step-by-step Python programs to print prime numbers in a range. Covers trial division, Python's for/else idiom, and the Sieve of Eratosthenes.

9 May 2026 · 6 min read
Placement Prep

Armstrong Numbers in a Range: C, C++, Java, Python

Programs to print Armstrong numbers between two intervals in C, C++, Java, Python. Traced algorithm, integer-power fix, and time complexity.

9 May 2026 · 7 min read
Placement Prep

Print an Array in Zigzag Order in Python

Step-by-step guide to rearranging a Python list in zigzag order. Covers the O(n) swap algorithm, traced examples, edge cases, and CRT placement patterns.

9 May 2026 · 5 min read
Placement Prep

Printing Variables in Python: Single, Multiple, Formatted

Four Python 3 methods to print variables with text: commas, % operator, .format(), and f-strings. Includes working code, common error fixes, and a comparison table.

9 May 2026 · 6 min read
Placement Prep

Program to Add Two Matrices in C, Java, and Python

How to add two matrices in C, Java, and Python: algorithm, worked example, O(m×n) time and space complexity, and common placement coding test mistakes.

9 May 2026 · 7 min read
Placement Prep

Check if Two Arrays Are Equal: 3 Approaches Explained

Three approaches to check if two arrays are equal: sort-and-compare, frequency count, and direct match, with working code and complexity analysis.

9 May 2026 · 6 min read
Placement Prep

Abundant Number Program: C, Java and Python with √n Check

An abundant number has a proper-divisor sum greater than itself. Code in C, Java, and Python using the O(√n) loop, with worked examples for 12, 18, and 20.

9 May 2026 · 6 min read
Placement Prep

Count Edges in an Undirected Graph: Algorithm and Code

Learn how to count edges in an undirected graph using the Handshaking Lemma. Step-by-step algorithm, Python and C++ code, and complexity analysis included.

9 May 2026 · 6 min read
Placement Prep

Count Even and Odd Elements in an Array

Single-pass O(n) algorithm to count even and odd elements in an array. Working code in C, C++, Python, and Java, with complexity analysis and edge cases.

9 May 2026 · 5 min read
Placement Prep

Count Vowels, Consonants, Digits and Special Characters in a String

Programs in Python, C, and Java to count vowels, consonants, digits, and special characters in a string. Algorithm, code, and traced outputs included.

9 May 2026 · 6 min read
Placement Prep

Lower Triangular Matrix Check: Programs in C, Java, Python

A square matrix is lower triangular when all entries above the main diagonal are zero. Programs in C, C++, Java, and Python with traced example and complexity analysis.

9 May 2026 · 8 min read
Placement Prep

Find All 0(1+)0 Patterns in a String: C & Python Guide

Count every 0(1+)0 occurrence in a binary string using a linear scan. C and Python code included, plus edge cases and O(n) complexity explained for placement rounds.

9 May 2026 · 7 min read
Placement Prep

Check if a Matrix Is Upper Triangular: Code and Complexity

Verify whether a square matrix is upper triangular: the below-diagonal condition, verified C, Python, and Java code, and O(n²) complexity analysis for placement rounds.

9 May 2026 · 6 min read
Placement Prep

Find Duplicate Elements in an Array: 5 Approaches

Five approaches to find duplicates in an array: O(n²) nested loops, sort-and-scan, hash set, XOR trick, and Floyd's cycle detection, with C, C++, and Python code.

9 May 2026 · 8 min read
Placement Prep

Kth Smallest Element in an Unsorted Array: 4 C++ Approaches

Four C++ methods to find the Kth smallest element in an unsorted array: sort, QuickSelect, max-heap, and nth_element, with complexity trade-offs and placement tips.

9 May 2026 · 8 min read
Placement Prep

ASCII Value of a Character: C, C++, Java, Python

Programs to find the ASCII value of a character in C, C++, Java, and Python. Key ASCII ranges, worked examples, and interview variants for placement tests.

9 May 2026 · 6 min read
Placement Prep

The Handshakes Problem: Formula, Derivation, and Code

Derive the handshakes formula step by step, verify worked examples, and implement the solution in Python and C. A combinatorics guide for placement aptitude rounds.

9 May 2026 · 6 min read
Placement Prep

Maximum Product Subarray: Algorithm, Code, and Dry Run

Find the maximum product subarray using the max-min tracking method. Algorithm steps, dry run table, Python and C code, complexity analysis, and placement context.

9 May 2026 · 6 min read
Placement Prep

Find Min and Max in Each Row of a Matrix

C and Python programs to find minimum and maximum elements in each row of a matrix. Includes algorithm, complexity analysis, and placement test variations.

9 May 2026 · 5 min read
Placement Prep

Program to Find Minimum Scalar Product of Two Vectors

Find the minimum dot product of two integer arrays by sorting one ascending and the other descending. Algorithm, proof, worked example, and C/C++/Java/Python code.

9 May 2026 · 8 min read
Placement Prep

Days in a Given Month: Python, Java, C and C++ Programs

Python, Java, C, and C++ programs to find days in a given month and year. Covers the leap year rule, if-elif, array lookup, and standard library approaches.

9 May 2026 · 8 min read
Placement Prep

Find the Quadrant of Given Coordinates: C Program and Explanation

Find the quadrant of any coordinate pair using a C program. Covers all four quadrants, origin, x-axis and y-axis cases, and O(1) complexity analysis.

9 May 2026 · 5 min read
Placement Prep

Sum of All Numbers in a String: 4 Language Solutions

Step-by-step programs in Python, Java, C, and C++ to extract every number from a string and return their sum, with worked examples and complexity notes.

9 May 2026 · 6 min read
Placement Prep

Sum of Array Elements: C, C++, Java, and Python

Find the sum of elements in a given array using loop-based programs and built-in functions in C, C++, Java, and Python, with examples and complexity analysis.

9 May 2026 · 5 min read
Placement Prep

Sum of Perfect Square Elements in Array: C, C++, Java, Python

Find the sum of perfect square elements in an array in C, C++, Java, and Python. Algorithm, floating-point safety, traced example, and complexity analysis.

9 May 2026 · 6 min read
Placement Prep

Sum of Boundary Elements of a Matrix: C, C++, Java, Python

Two complete approaches: O(N+M) optimised and O(N×M) check-each, to find the sum of boundary elements of a matrix, in C, C++, Java, and Python.

9 May 2026 · 7 min read
Placement Prep

Program to Remove All Non-Alphabet Characters from a String

Step-by-step algorithm and verified C, C++, Java, and Python code to remove all non-alphabet characters from a string, with edge cases and O(n) complexity analysis.

9 May 2026 · 6 min read
Placement Prep

Remove Duplicate Elements from an Array: Python, C++, Java

Remove array duplicates: two-pointer for sorted arrays (O(n), O(1) space); HashSet for unsorted (O(n), O(n) space). Code in Python, C++, and Java.

9 May 2026 · 7 min read
Company Corner

Program to Replace a Substring in a String

Manual algorithm plus working code in Python, Java, and C to replace every occurrence of a substring, with Wipro placement context and edge cases.

9 May 2026 · 8 min read
Placement Prep

Find Nth Node from End of a Linked List: Two Approaches

Two methods to return the Nth node from the end of a linked list: the length-based two-pass approach and the single-pass two-pointer technique.

9 May 2026 · 5 min read
Placement Prep

Reverse a Number in C, C++, Java and Python

Iterative and recursive approaches to reverse a number in C, C++, Java, and Python. Step-by-step trace, working code, and complexity analysis.

9 May 2026 · 7 min read
Placement Prep

Reverse an Array: 4 Methods in C, Python, and Java

Four methods to reverse an array: print-from-end, auxiliary array, in-place swap, and recursion. Working code in C, Python, and Java with complexity analysis.

9 May 2026 · 6 min read
Placement Prep

Swap Two Numbers Without a Third Variable

Three ways to swap two numbers without a third variable, with C code: arithmetic, XOR, and multiply-divide. Covers trade-offs, overflow risk, and what interviewers ask.

9 May 2026 · 6 min read
Placement Prep

Function Prototype in C: Declaration, Syntax, and Why It Matters

A function prototype tells the C compiler the return type, argument count, and argument types before the function is defined. Learn what happens when you skip it.

9 May 2026 · 6 min read
Placement Prep

Pyramid Pattern Programs Using Numbers: C, Python, Java

C, C++, Java, and Python code for seven number-pyramid variants, including Floyd's triangle and Pascal's triangle, with verified output for height 5.

9 May 2026 · 12 min read
Placement Prep

Pyramid Star Patterns in C, C++, Java, and Python

Six pyramid star patterns with C, C++, Java, and Python code: right-angled, centered, inverted, hollow, and diamond. Loop logic and sample output for n=5.

9 May 2026 · 13 min read
Placement Prep

Python Matrix Multiplication: Programs and Examples

Learn matrix multiplication in Python with nested loops and NumPy. Verified programs, step-by-step examples, and CRT placement test patterns for engineering students.

9 May 2026 · 6 min read
Placement Prep

Python Nested Dictionaries with Example Programs

Create, access, modify, and iterate Python nested dictionaries with worked code examples. Covers .get() safety and patterns from placement coding rounds.

9 May 2026 · 5 min read
Placement Prep

Types of Operators in Python: All 7 Types with Examples

Python has 7 operator types: arithmetic, comparison, logical, bitwise, assignment, identity, and membership. Learn each with code examples and placement tips.

9 May 2026 · 6 min read
Placement Prep

Python print() Function: How to Print Output in Python

Complete guide to Python's print() function: syntax, sep, end, file, flush parameters, f-strings, and output formatting patterns for placement coding rounds.

9 May 2026 · 5 min read
Placement Prep

Python Program to Remove Duplicate Characters from a String

Three Python methods to remove duplicate characters from a string: simple loop, set-based O(n), and dict.fromkeys(). Covers verified outputs and time complexity.

9 May 2026 · 5 min read
Placement Prep

Swap Two Variables in Python: All Four Methods

Four ways to swap two variables in Python: tuple unpacking, temp variable, arithmetic, and XOR, with code examples, derivations, and placement test context.

9 May 2026 · 5 min read
Placement Prep

Python: Remove a Character from a String (3 Methods)

Three Python methods to remove a character from a string: str.replace(), list comprehension with join(), and str.translate(). Code examples and edge cases included.

9 May 2026 · 5 min read
Placement Prep

Rat in a Maze: Backtracking Algorithm with C++ Code

Solve the rat in a maze problem using backtracking in C++. Step-by-step algorithm, traced 4×4 example, and time and space complexity for placement interviews.

9 May 2026 · 6 min read
Placement Prep

Python String Length: 5 Programs to Find Length of a String

Five methods to find string length in Python: len(), for loop, recursion, non-whitespace count, and Unicode code points vs grapheme clusters.

9 May 2026 · 6 min read
Placement Prep

Regular Expressions in Python: Complete Guide

Python's re module explained: metacharacters, special sequences, and pattern-matching methods. Includes worked examples for phone validation and email extraction.

9 May 2026 · 5 min read
Placement Prep

Python Comparison Operators: All 6 With Examples

Python has six comparison operators that each return True or False. This guide covers ==, !=, >, <, >=, and <= with examples for numbers, strings, and chaining.

9 May 2026 · 5 min read
Placement Prep

Remove All Non-Alphabet Characters from a String in Python

Three Python methods to strip digits, spaces, and symbols from a string, keeping only letters. Covers isalpha(), regex, and translate() with worked examples.

9 May 2026 · 5 min read
Placement Prep

Remove Vowels from a String in Python: 4 Methods

Four Python methods to remove vowels from a string: for loop, list comprehension, filter(), and regex. With time complexity and placement coding round patterns.

9 May 2026 · 5 min read
Placement Prep

Replace Array Elements with Their Rank: Two Approaches

Two approaches to replace each array element with its rank: O(n log n) HashMap and O(n²) brute force, with C++, Python, and Java code.

9 May 2026 · 5 min read
Placement Prep

How to Return Multiple Values from a Function in C

C functions return one value by default. This guide covers four methods: pointers, structs, arrays, and malloc, with working code examples for placement test prep.

9 May 2026 · 8 min read
Company Corner

Sapient Interview Questions for Freshers: 2026 Hiring Guide

Publicis Sapient recruits freshers through an AMCAT-based online test followed by two interview rounds. Here is what to expect and how to prepare.

9 May 2026 · 7 min read
Placement Prep

Selection Sort in C, C++, and Java with Code Examples

Selection sort code in C, C++, and Java with a step-by-step trace, O(N²) complexity analysis, stability notes, and a bubble sort comparison.

9 May 2026 · 7 min read
Placement Prep

Python Sets Explained: Create, Modify, and Use Set Operations

Python sets store unique elements and check membership in O(1) time. Covers creation, set methods, operations, and placement coding patterns with examples.

9 May 2026 · 7 min read
Placement Prep

Sort Elements by Frequency in an Array: Three Approaches

Three approaches to sort array elements by frequency: brute force, hash map, and Python Counter, with complexity analysis and worked examples.

9 May 2026 · 6 min read
Placement Prep

Spiral Order Matrix Printing: Step-by-Step Guide with Code

Print a 2D matrix in spiral order using four boundary pointers. Hand-traced 3x4 example, edge-case guards, and verified code in Python, C++, Java, and C.

9 May 2026 · 7 min read
Placement Prep

Stick Game Problem: Solution and Code in Python, C, Java

Stick game on an n x m grid: derive why min(n, m) decides the winner, verify all three sample inputs, and get clean code in Python, C, and Java.

9 May 2026 · 5 min read
Placement Prep

Subset Sum Problem: Dynamic Programming, Code, and Complexity

Solve the subset sum problem using dynamic programming: step-by-step algorithm, tabulation walkthrough, Python and Java code, and time/space complexity.

9 May 2026 · 6 min read
Placement Prep

Sum of Elements in Zigzag Sequence of a Matrix

Matrix zigzag traversal explained: scan each anti-diagonal in alternating directions, why the sum equals the total matrix sum, with code in Python, C++, and Java.

9 May 2026 · 6 min read
Company Corner

TCS Coding Test Questions with Solutions (2026 Pattern)

The TCS coding round tests 2 problems in 45 minutes. Covers question patterns, worked solutions in Python, and how test-case scoring works in TCS campus drives.

9 May 2026 · 7 min read
Placement Prep

10 Technical Interview and Aptitude Questions: Set 4

Ten solved questions on C pointer arithmetic, double pointers, scanf bugs, linked-list traversal, binary search, SQL filtering, first normal form, and FCFS scheduling.

9 May 2026 · 8 min read
Placement Prep

10 C Programming Aptitude Questions with Answers

Ten C programming aptitude questions covering array out-of-bounds, pointer declarations, operator evaluation, and linkage types, with worked answers.

9 May 2026 · 7 min read
Placement Prep

Python Ternary Operator: One-Line if-else with Examples

Write Python if-else logic in one line using the conditional expression. Syntax, five patterns, placement test output questions, and when to avoid nesting.

9 May 2026 · 7 min read
Placement Prep

Treasure and Cities Problem Using Dynamic Programming

Solve the Treasure and Cities problem with a verified DP recurrence. Includes step-by-step trace on the canonical example, Python code, and O(n²) complexity analysis.

9 May 2026 · 6 min read
Placement Prep

Tuples in Python: Definition, Methods, and Code Examples

Master Python tuples with clear examples covering creation, indexing, slicing, immutability, and the 2 built-in methods tested in placement drives.

9 May 2026 · 6 min read
Placement Prep

Python Variables: Declare, Assign and Redeclare

Python creates a variable the moment you assign a value to it. Covers naming rules, four assignment patterns, redeclaration across types, scope, and PEP 8 conventions.

9 May 2026 · 6 min read
Company Corner

Capgemini Most-Asked Interview Questions 2026

Top Capgemini technical and HR interview questions for 2026 freshers: DBMS, Java, C programming, and how the AI-ready hiring shift affects your prep.

9 May 2026 · 7 min read
Placement Prep

Python Strings: Indexing, Slicing, and Key Methods

Python strings are immutable sequences of Unicode characters. Learn indexing, slicing, split, join, replace, format(), and f-strings with working code examples.

9 May 2026 · 6 min read
Placement Prep

Python Indentation: What It Is and Why It Matters

Python uses indentation instead of curly braces to define code blocks. Learn PEP 8's four-space rule, common IndentationErrors, and how to fix them.

9 May 2026 · 5 min read
Placement Prep

Python `while` Loop: Syntax, Use Cases, and Common Patterns

Learn how Python's while loop works, when to use it over a for loop, and how break, continue, and the else clause shape its behavior.

9 May 2026 · 6 min read
Placement Prep

Why Python Is So Popular in 2026 and Is It Easy to Learn?

Python has topped developer rankings four years running. Here is why it dominates in 2026, and how Indian students can get placement-ready fast.

9 May 2026 · 7 min read
Placement Prep

Word Break Problem: Dynamic Programming Solution with Code

The word break problem asks if a string can be split into dictionary words. DP table approach, Python and C++ code, and full complexity analysis.

9 May 2026 · 6 min read
Company Corner

Amazon Recruitment Process for Freshers: SDE and CSA Guide 2026

Amazon recruits for SDE and CSA roles through a written test, three technical rounds, and an HR interview. Here is the 2026 pattern and prep approach.

8 May 2026 · 6 min read
Placement Prep

Array Programs in C, C++ and Java: Most Asked Questions

Master the 6 core array patterns tested in AMCAT, TCS NQT, and company placement tests. Solutions in C, C++ and Java with time complexity.

8 May 2026 · 8 min read
Placement Prep

Wildcard String Matching: Recursive and DP Solutions

Wildcard matching with ? and * using memoised recursion and a full DP table. Worked trace of pattern 'g*ks' matching 'geeks', plus time and space complexity.

8 May 2026 · 9 min read
Placement Prep

Vowel or Consonant Check: Programs in C, C++, Python, Java

Programs in C, C++, Python, and Java that check if a character is a vowel, consonant, or neither, with algorithm traces and full edge-case coverage.

8 May 2026 · 7 min read
Placement Prep

Prime Number Program in C, C++ and Java

Three implementations to check if a number is prime in C, C++, and Java. Covers the for-loop, function-based, recursive approach, and sqrt optimisation.

8 May 2026 · 6 min read
Placement Prep

Check Whether a Number is Palindrome or Not

How to check whether a number is palindrome or not, with iterative and recursive programs in Python, C, and Java, plus complexity analysis.

8 May 2026 · 7 min read
Company Corner

Cognizant Interview Questions for Freshers: 2026 Guide

Cognizant technical, coding, and HR interview questions for freshers in 2026. GenC and GenC Elevate rounds, AMCAT Automata Fix, and preparation tips.

8 May 2026 · 6 min read
Placement Prep

Decimal to Binary in Python: 3 Methods Explained

Convert decimal numbers to binary in Python using bin(), format(), and a custom loop. Verified step-by-step algorithm, edge cases, and placement test tips.

8 May 2026 · 5 min read
Placement Prep

Diamond Number Patterns in C, C++, Python, and Java

Three diamond number patterns: repeated-digit, star-separated, and consecutive, with working C, C++, Python, and Java code, loop traces, and placement-test context.

8 May 2026 · 7 min read
Placement Prep

Diamond Pattern Using Stars: C, Python and Java

Four diamond star patterns (solid, hollow, half, palindromic) with loop traces, space formulas, and C, Python, and Java code for n=5.

8 May 2026 · 10 min read
Placement Prep

Encapsulation in Python: Access Modifiers and Name Mangling

Python encapsulation explained: private, protected, public members, name mangling, and getter/setter methods with code examples.

8 May 2026 · 5 min read
Company Corner

FactSet Written Test and Interview Experience 2026

FactSet campus process: MCQ written test with negative marking, pen-and-paper coding screen, two technical rounds, and HR. Full 2026 pattern and prep guide.

8 May 2026 · 5 min read
Placement Prep

Fibonacci Series in Python: Loop, Recursion, Memoization

Three Python programs to print the Fibonacci series: iterative, recursive, and memoized. Complexity analysis for placement coding rounds.

8 May 2026 · 5 min read
Placement Prep

Find Factors of a Number in C, C++, Java and Python

Two approaches to find all factors of a number in C, C++, Java, and Python: O(n) brute-force and O(√n) optimised, with complexity comparison and placement context.

8 May 2026 · 6 min read
Placement Prep

Min and Max Element in Each Matrix Column

Column-wise minimum and maximum in a 2D matrix: algorithm, worked example, and complete programs in C, Java, and Python with complexity analysis.

8 May 2026 · 7 min read
Placement Prep

Noddy's Largest Plot: Histogram Rectangle in Python

Solve the Noddy Toyland land puzzle with a monotonic stack in O(n). Step-by-step trace for [2, 1, 5, 6, 2, 3], Python code, and complexity analysis.

8 May 2026 · 6 min read
Placement Prep

Integers with Exactly 9 Divisors in a Range

A positive integer has exactly 9 divisors only in two forms: p^8 or p^2 × q^2. This guide proves why, then shows a sieve-based Python solution with verified examples.

8 May 2026 · 6 min read
Placement Prep

GCD of Two Numbers in Python: 4 Methods Explained

Four methods to find GCD in Python: while loop, recursion, Euclidean algorithm, and math.gcd. Includes code, dry runs, and placement round tips.

8 May 2026 · 5 min read
Company Corner

HCL Interview Questions: Technical and HR Rounds

What HCLTech's technical and HR rounds test, with real question examples, the 2026 salary gap between standard and AI-skilled tracks, and a stage-by-stage prep guide.

8 May 2026 · 7 min read
Placement Prep

Check Odd or Even Without Modulus: 3 Python Methods

Three Python approaches to check odd or even without the modulus operator: bitwise AND, integer division, and flag toggling, with runnable code.

8 May 2026 · 5 min read
Placement Prep

Introduction to C Programming: Basics and Fundamentals

C programming fundamentals for engineering students: Hello World breakdown, variables, data types, the compilation pipeline, and two worked programs.

8 May 2026 · 5 min read
Company Corner

KPMG Interview Questions and Process: 2026 Fresher Guide

KPMG India's campus recruitment runs two interview rounds: technical (Java, DBMS, data structures) and HR. Here's what gets asked and how to prepare.

8 May 2026 · 6 min read
Placement Prep

Leap Year Program in C, C++ and Java

Leap year logic in C, C++, and Java with three implementation styles: basic conditional, function-based, and stdlib. Code, edge cases, and placement context.

8 May 2026 · 5 min read
Placement Prep

Python Tutorial for Beginners: Hello World to Functions

Start Python in 2026: write Hello World, learn variables, types, control flow, and functions, then build FizzBuzz. Covers placement DSA and AI prep.

8 May 2026 · 7 min read
Company Corner

MAQ Software Interview Questions: Complete 2026 Guide

Three-round MAQ Software interview: written test, technical round covering OOP and data structures, and HR. Preparation checklist for CSE and IT freshers.

8 May 2026 · 7 min read
Company Corner

Microsoft Interview Questions for Freshers: 6 Worked Examples

Six worked Microsoft fresher interview questions: graphs, DP, tries, system design, behavioral STAR, and project deep-dive, each with solutions and complexity analysis.

8 May 2026 · 7 min read
Placement Prep

Pattern Printing in C: 9 Interview Programs Explained

Nine pattern printing programs for C technical interviews: star, number, and letter types with verified code, output traces, and complexity notes.

8 May 2026 · 8 min read
Placement Prep

Most Commonly Asked Java Interview Questions, Set 2

ArrayList vs Vector, runtime polymorphism, multiple inheritance via interfaces, servlet lifecycle, and finalize(). Core Java interview Set 2 topics for freshers.

8 May 2026 · 6 min read
Company Corner

PayPal Interview Questions and Interview Experience Guide

PayPal's campus interview covers an online coding test, two technical rounds, and HR. Here's what the process looks like and the questions that come up most.

8 May 2026 · 6 min read
Placement Prep

Prime Number Program in Python: Primes in a Range

Three Python algorithms to check and find prime numbers in a range: trial division, 6k±1 optimisation, and Sieve of Eratosthenes, with manual traces.

8 May 2026 · 7 min read
Placement Prep

Integers with Exactly 9 Divisors: C++, Java, Python

C++, Java, and Python programs to count integers from 1 to N with exactly 9 divisors. Two-case sieve algorithm, O(sqrt(N)) complexity, verified sample I/O.

8 May 2026 · 7 min read
Placement Prep

Program to Print Pascal's Triangle in C, Python, and Java

Step-by-step guide to printing Pascal's triangle in C, Python, and Java, with row construction logic, O(n²) complexity, and placement interview context.

8 May 2026 · 7 min read
Placement Prep

Reverse a String in C, C++, Java and Python

String reversal in C, C++, Java and Python: in-place two-pointer swap, std::reverse, StringBuilder.reverse, and Python slice notation, with complexity analysis.

8 May 2026 · 7 min read
Placement Prep

Python 2 vs Python 3: Which Should You Learn in 2026?

Python 2 reached its end-of-life in January 2020. The five key differences, why every placement platform runs Python 3, and how to verify your setup.

8 May 2026 · 5 min read
Placement Prep

Rearrange Positive and Negative Numbers in an Array

Three approaches to rearranging positive and negative numbers in an array: partition, order-preserving, and alternating, with C++ and Python code.

8 May 2026 · 6 min read
Placement Prep

Sort Array by Order Defined by Another Array

Two methods to sort array A by the sequence in array B: binary search in O(n log n) and hashing in O(n + m). Worked examples plus code in Python and Java.

8 May 2026 · 6 min read
Company Corner

Summer Placement Prep: Aptitude and Technical Training Guide 2026

How to prepare for campus placements during summer, covering TCS NQT aptitude sections, technical interview topics, and an 8-week schedule for both.

8 May 2026 · 6 min read
Company Corner

TCS CodeVita Mock Questions and Preparation Guide 2026

TCS CodeVita contest structure, practice problems with step-by-step solutions, and a topic-by-topic preparation plan for engineering students targeting the 2026 season.

8 May 2026 · 8 min read
Company Corner

TCS Digital Interview Questions: Technical Round Guide 2026

TCS Digital (₹7.0 to 7.5 LPA) tests harder than Ninja. Six worked questions cover DSA, OS, DBMS, networking, system design, and the project deep-dive round.

8 May 2026 · 10 min read
Placement Prep

Two-Player Coin Game Using Dynamic Programming

Greedy fails the two-player coin game. Learn the parity-based optimal strategy, the DP recurrence, and working Python code: placement-interview ready.

8 May 2026 · 7 min read
Placement Prep

Evaluation Order of Function Parameters in C

The C standard leaves function argument evaluation order unspecified. Learn what C11 says, how compilers differ, and how to write portable C code.

8 May 2026 · 6 min read
Placement Prep

31 Most-Asked C Programming Interview Questions (with Code)

The 31 C programs that appear most in product-company and service-company technical rounds, with verified code and recruiter-level explanations.

7 May 2026 · 10 min read
Placement Prep

Arranging Flower Sticks in a Bouquet: Sorting Problem

Solve the flower sticks bouquet problem with Python, C++, and Java. Covers split-sort algorithm, step-by-step walkthrough, complexity analysis, and edge cases.

7 May 2026 · 6 min read
Company Corner

Bank of America Interview Questions for Freshers

Bank of America's three interview rounds for freshers in India: telephonic screening, technical (Java, OOP, DSA), and HR questions with STAR preparation tips.

7 May 2026 · 6 min read
Placement Prep

C Coding Questions: Practice Set 1 for Placement Prep

10 C MCQs covering pointer passing, double pointers, structures, strings, and memory allocation with full explanations and a corrected code trace.

7 May 2026 · 8 min read
Placement Prep

Calculator Program in Python: Two Methods Explained

Build a simple calculator in Python using an if-elif chain and a function-based design. Covers the divide-by-zero edge case that placement coders get wrong.

7 May 2026 · 5 min read
Placement Prep

Check If a Number Is Sum of Two Primes (C, C++, Java, Python)

Step-by-step guide to checking if N = p+q where p and q are both prime. Trial division and Sieve approaches with code in C, C++, Java, and Python.

7 May 2026 · 8 min read
Placement Prep

Check Whether a String Is a Palindrome

Three approaches to check if a string is a palindrome: two-pointer O(n), reverse-and-compare, and recursive. Code in C, C++, Java, and Python with edge cases.

7 May 2026 · 6 min read
Company Corner

CoCubes Programming Questions: 2026 CS Test Prep Guide

Prepare for the CoCubes CS section with 2026 pattern questions on C pointers, data structures, OOP, and DBMS, with verified solutions and a study plan.

7 May 2026 · 6 min read
Placement Prep

Encrypt a Secret Code with Two Key Values: C++ and Python

Encrypt a secret code S using key values N and M via last-digit cycles and modular exponentiation. C++ and Python code, worked examples, and an edge-case fix.

7 May 2026 · 7 min read
Placement Prep

Fibonacci Series up to N Value in C, C++, Java and Python

Print all Fibonacci numbers ≤ n using iterative, recursive, and memoization approaches. Full working code in C, C++, Java, and Python.

7 May 2026 · 7 min read
Placement Prep

Find the Equilibrium Index of an Array

Step-by-step guide to finding the equilibrium index of an array using O(n²) and O(n) prefix-sum methods, with working code in C, C++, Python, and Java.

7 May 2026 · 8 min read
Placement Prep

Noddy's Largest House: Solving the Max-Gap Problem

Solve the Noddy house-numbers problem: sort houses by position, scan for the largest gap, return the flanking pair. Worked example and Python code.

7 May 2026 · 7 min read
Placement Prep

Generate Binary Numbers from 1 to N: 3 Python and C++ Methods

Three methods to generate binary numbers from 1 to N: queue BFS, bit-shift loop, and Python built-ins. Code with trace examples and a complexity table.

7 May 2026 · 6 min read
Placement Prep

Greatest of Three Numbers in Python: 3 Methods

Three Python methods to find the greatest of three numbers: if-else comparison, built-in max(), and a custom function. Sample runs and edge-case handling included.

7 May 2026 · 5 min read
Placement Prep

Half Pyramid Pattern in Python: 5 Variants with Code

Learn five half pyramid patterns in Python with asterisks, same numbers, incrementing, decrementing, and alphabets. Each variant includes code and verified output.

7 May 2026 · 6 min read
Company Corner

HP Placement Papers: 2026 Test Pattern and Sample Questions

HP's campus placement test spans three sections: Quantitative Aptitude, Verbal Ability, and Technical. Pattern breakdown and solved sample questions for 2026 drives.

7 May 2026 · 7 min read
Company Corner

Infosys Technical Interview Questions 2026

OOP, DBMS, OS and DSA questions asked in Infosys SE, SP and Power Programmer technical rounds, with answers for 2026 freshers.

7 May 2026 · 6 min read
Placement Prep

LCM of Two Numbers in Python: 3 Methods Explained

Three Python methods to compute LCM: brute-force loop, GCD formula (Euclidean algorithm), and the math.lcm builtin (Python 3.9+). Worked examples and N-number extension.

7 May 2026 · 7 min read
Company Corner

MAQ Software Interview Questions: Technical and HR Rounds

MAQ Software interviews span an online test, two technical rounds, and an HR round. This guide covers the 2026 pattern, common questions, and prep checklist.

7 May 2026 · 5 min read
Placement Prep

Matrix Addition in Python: Step-by-Step with Code Examples

Four approaches to matrix addition in Python: nested loops, list comprehension, zip, and NumPy. Includes dimension validation and traced outputs.

7 May 2026 · 6 min read
Company Corner

Microsoft Placement Papers: 2026 Test Pattern and Syllabus

Microsoft campus hiring has 2 coding problems and no aptitude filler. 2026 test pattern, topic-by-topic syllabus, and a 6-week DSA prep roadmap.

7 May 2026 · 6 min read
Placement Prep

Most Asked Java Interview Questions, Set 1

Core Java interview questions for freshers: JDK vs JRE, == vs .equals(), overloading vs overriding, abstract class vs interface, exception handling, and collections.

7 May 2026 · 6 min read
Placement Prep

Most Commonly Asked Java Interview Questions

Java interview questions freshers face most: OOP, collections, exception handling, JVM memory, and threading, with verified code examples and concise answers.

7 May 2026 · 6 min read
Placement Prep

C Programming Questions: Must-Solve List for Beginners

Must-solve C programming questions for beginners, covering control flow, recursion, strings, arrays, and matrix operations with working code examples.

7 May 2026 · 9 min read
Placement Prep

Must-Know Technical Interview Questions for CSE/IT Freshers

The 18 most common technical interview questions across DSA, operating systems, databases, OOP, and networking, with concise answers for campus placement.

7 May 2026 · 7 min read
Placement Prep

Must-Solve Conceptual C Questions for Placement Interviews

Eight conceptual C questions on pointers, undefined behavior, sizeof, and switch fall-through, with answers, C standard citations, and output traces.

7 May 2026 · 6 min read
Placement Prep

Number to Words: Python Program and Algorithm

Convert any integer to its English-word equivalent in Python. Step-by-step algorithm, verified worked examples, and complete code for number-to-words conversion.

7 May 2026 · 6 min read
Placement Prep

Palindrome Pyramid Pattern Using Numbers: C, Python, Java

Step-by-step code and loop trace for the palindrome number pyramid in C, C++, Python, and Java, with centered and half-pyramid variants.

7 May 2026 · 9 min read
Placement Prep

Pascal's Triangle in Python: Two Approaches With Sample Output

Print Pascal's triangle in Python using two approaches: row-based dynamic computation and math.comb. Both approaches verified for n=5 rows with sample output.

7 May 2026 · 6 min read
Company Corner

PayPal Interview Process: Full Guide for 2026

PayPal campus selection for freshers: eligibility, HackerRank test, two technical rounds, HR interview, CTC bands, and application steps for 2026.

7 May 2026 · 6 min read
Company Corner

PayPal Interview Questions: DSA, Coding, and HR Prep

PayPal campus interviews cover DSA, OOP, and system design across a HackerRank test and two technical rounds. Question patterns and prep approach for 2026.

7 May 2026 · 7 min read
Placement Prep

Find All Symmetric Pairs in an Array

Two approaches to find all symmetric pairs in an array: O(n^2) brute force and O(n) HashMap, with working C++, Python, and Java code.

7 May 2026 · 7 min read
Placement Prep

Amicable Numbers (Friendly Pair): C, C++, Java, Python

Check amicable (friendly pair) numbers in C, C++, Java, and Python. Verified examples with (220,284), O(√n) algorithm, test cases, and placement context.

7 May 2026 · 7 min read
Placement Prep

Find Sum of Digits of a Number: C, C++, Java, Python

Programs to find the sum of digits of a number in C, C++, Java, and Python. Iterative and recursive approaches with step-by-step traced outputs.

7 May 2026 · 7 min read
Placement Prep

Program to Generate Tsunami Report in C, Java and Python

Step-by-step solutions in C, Java and Python for the Tsunami report problem: read three integers, print a numbered report in exact format.

7 May 2026 · 7 min read
Placement Prep

Replace All 0 Digits with 1 in an Integer: Python, C and Java

Three approaches to replace every 0 digit with 1 in an integer: string conversion, digit extraction loop, and edge cases. Code in Python, C, and Java.

7 May 2026 · 6 min read
Placement Prep

Program to Sort a String in Alphabetical Order in Python

Two Python approaches to sort a string alphabetically: the sorted() built-in and a manual loop. Covers time complexity, case handling, and edge cases.

7 May 2026 · 5 min read
Placement Prep

Python Operator Precedence and Associativity Guide

Master Python operator precedence and associativity with a full table, five traced examples, and the right-to-left rule that makes 2 ** 3 ** 2 return 512.

7 May 2026 · 6 min read
Placement Prep

Quick Sort in C, C++, Java and Python: Full Guide

Quick sort tutorial covering Lomuto partition with step-by-step trace, pivot selection, and C, C++, Java, Python implementations with complexity analysis.

7 May 2026 · 8 min read
Placement Prep

Remove Brackets from Algebraic Expressions: C, Java, Python

Stack-based sign-aware algorithm to remove brackets from algebraic expressions. Covers C, C++, Java, Python with hand-traced examples and edge cases.

7 May 2026 · 7 min read
Company Corner

Samsung Interview Questions: Technical and HR Rounds 2026

Samsung R&D India recruits for software roles with a technical bar closer to product companies than IT services. Technical and HR round questions with answers.

7 May 2026 · 9 min read
Placement Prep

Space Complexity of Algorithms: Worked Examples

Space complexity with worked examples: O(1), O(n), O(log n), and O(n²) derivations, the merge sort misconception corrected, and placement test context.

7 May 2026 · 7 min read
Placement Prep

Python String Slicing: Syntax, Examples, and Patterns

Learn Python string slicing: syntax, negative indices, step slices, and string reversal. Includes palindrome and word-reversal patterns for placement coding rounds.

7 May 2026 · 5 min read
Placement Prep

Sum of Array Elements in Python: Three Approaches

Three ways to sum array elements in Python: built-in sum(), a for loop, and functools.reduce(). Code verified from first principles for CRT placement rounds.

7 May 2026 · 5 min read
Company Corner

TCS Coding Questions and Answers (2026 Guide)

Five worked TCS NQT coding problems with hand-traced Python solutions. Covers palindrome check, base-17 conversion, digit sums, prime range, and array reversal.

7 May 2026 · 8 min read
Company Corner

TCS Digital Aptitude and Technical Questions 2026

Practice TCS Digital aptitude questions and technical MCQs with worked solutions. Covers eligibility, Advanced NQT pattern, DSA, DBMS, OS, and coding round.

7 May 2026 · 8 min read
Company Corner

TCS Ninja Programming MCQs: 11 Questions with Verified Answers

Practice 11 TCS Ninja NQT programming MCQs covering C language, pointer mechanics, and data structures. All answers re-derived from first principles for 2026.

7 May 2026 · 7 min read
Company Corner

TCS Programming MCQs: 2026 NQT Pattern and 12 Worked Examples

Practice the TCS NQT programming section with 12 re-verified MCQs covering C language, data structures, and sorting algorithms. Updated for the 2026 exam pattern.

7 May 2026 · 7 min read
Company Corner

TCS Sample Coding Questions: Practice Problems and Worked Solutions

Representative TCS NQT coding problems with verified C and Python solutions. Covers conceptual MCQs, worked coding patterns, and the 2026 track structure.

7 May 2026 · 6 min read
Placement Prep

10 Technical Interview Aptitude Questions: Part 2 (Solved)

Solved set 2: C programming on static variables, pointer arithmetic, bitwise XOR, sizeof, and const, plus quantitative aptitude and logical reasoning.

7 May 2026 · 9 min read
Placement Prep

Transpose of a Matrix in Python: 3 Methods with Examples

Compute the transpose of a matrix in Python using zip(*matrix), nested loops, and NumPy .T. Includes a worked 3x4 example and placement-round guidance.

7 May 2026 · 7 min read
Company Corner

Wipro Interview Questions: Technical and HR Patterns for 2026

Wipro fresher interviews run two rounds. This guide covers the technical and HR questions asked in both, plus what the CoE AI-readiness track adds to the panel.

7 May 2026 · 6 min read
Placement Prep

20 Most Asked Data Structures Interview Questions

The 20 data structures questions most asked in Indian IT technical rounds: arrays, linked lists, trees, graphs, and hash tables, with answers and complexity notes.

2 May 2026 · 10 min read
Placement Prep

Check Character Type in Python: ord() and String Methods

Two ways to classify a character in Python as uppercase, lowercase, digit, or special: ASCII ord() approach and built-in string methods, with worked examples.

2 May 2026 · 5 min read
Placement Prep

Armstrong Number Check: Python, C, C++ and Java Programs

Programs to check if a number is Armstrong in Python, C, C++, and Java. Algorithm walkthrough, verified digit-power examples, and a range-finder.

2 May 2026 · 7 min read
Placement Prep

Data Structures Programs in C, C++, Java and Python

Data structures programs in C, C++, Java, and Python: arrays, linked lists, stacks, queues, and sorting with code and complexity notes for placement prep.

2 May 2026 · 12 min read
Company Corner

Directi Interview Questions: Rounds, Sample Qs, and Prep Tips

Directi's 3-4 round interview process: online coding test, two technical rounds, and an HR round that asks algorithms. Sample questions and a prep checklist.

2 May 2026 · 9 min read
Placement Prep

Find Smallest and Largest Element in an Array

Four C++ approaches to find the min and max in an array: iterative scan, STL, recursive, and sort-based. With code, complexity analysis, and placement interview tips.

2 May 2026 · 7 min read
Placement Prep

Greatest of Two Numbers in Python: 4 Methods with Code

Learn 4 Python methods to find the greatest of two numbers: max(), if-else, ternary operator, and arithmetic subtraction. Code, output, and when to use each.

2 May 2026 · 6 min read
Company Corner

Mphasis Programming Questions 2026: Syllabus and 8 Worked Solutions

Mphasis programming MCQ round: 25 questions, 35 minutes, AMCAT-aligned. Syllabus breakdown and 8 verified worked solutions for data structures, OOP, and complexity.

2 May 2026 · 7 min read
Placement Prep

Insert, Delete, and Search an Element in an Array

Learn to insert, delete, and search elements in an array with working C, Java, and Python code, Big-O analysis, and placement interview tips.

2 May 2026 · 10 min read
Placement Prep

Matrix Operations: Programs in C, C++, Java, and Python

Matrix addition, subtraction, and multiplication programs in C, C++, Java, and Python, with dimension rules, verified worked examples, and time complexity analysis.

2 May 2026 · 11 min read
Placement Prep

Python Basic Programs: Practice with Example Codes

Eleven Python basics with working code: I/O handling, swap, factorial, Fibonacci, prime check, and string operations. Ideal for placement coding round practice.

2 May 2026 · 5 min read
Company Corner

SAP Recruitment Process for Freshers: Selection Rounds and Prep Guide

SAP Labs India's five-round fresher process: online aptitude test, two technical interviews, managerial round, and HR. What each round tests and how to prepare.

2 May 2026 · 8 min read
Company Corner

Soliton Technologies Placement Papers and Interview Questions

Soliton Technologies uses a five-round selection covering physics, C programming, and project interviews. Full test pattern, sample questions, and prep strategy.

2 May 2026 · 9 min read
Placement Prep

10 Technical Interview Aptitude Questions: A Solved Set

Ten solved technical and aptitude questions for campus placement: C programming, number series, speed problems, coding-decoding, and data structures.

2 May 2026 · 10 min read
Placement Prep

Python Program to Check Vowel or Consonant: 5 Methods

Five Python methods to check whether a character is a vowel or consonant, with working code, sample output, edge cases, and placement exam patterns.

2 May 2026 · 7 min read
Placement Prep

AMCAT Automata Test: Questions, Answers, and Scoring Criteria

Two coding questions, a ticking clock, and an automated grader that scores correctness and complexity. Complete AMCAT Automata prep guide with solved examples.

1 May 2026 · 10 min read
Free · No spam

The AI Career Roadmap 2026

Once your DSA is solid, the next layer is AI. Get the free PDF for the projects that recruiters actually credit on a resume.

Download the free PDF
Free AI Roadmap PDF