Simple Programming Questions-1

Simple Programming Questions-1





Certainly, here's a set of programming questions without specifying any particular programming language:

**Question 1:**
Write a function to find the factorial of a non-negative integer.

**Question 2:**
Implement a function that checks whether a given string is a palindrome (ignoring spaces, punctuation, and letter casing).

**Question 3:**
Create a program that generates the Fibonacci sequence up to a given number `n`.

**Question 4:**
Write a program to reverse a linked list.

**Question 5:**
Implement a function to find the largest element in an array of integers.

**Question 6:**
Create a class representing a basic stack data structure with `push`, `pop`, and `peek` methods.

**Question 7:**
Implement a program to perform a binary search in a sorted array.

**Question 8:**
Write a function that takes a list of integers and returns a list of unique values (removing duplicates).

**Question 9:**
Create a program that reads a file, counts the number of words in it, and prints the result.

**Question 10:**
Implement a function that checks if two strings are anagrams of each other.

**Question 11:**
Write a program to find all prime numbers within a specified range.

**Question 12:**
Create a function to flatten a nested array (i.e., convert a multi-dimensional array into a one-dimensional array).

**Question 13:**
Implement a class representing a basic queue data structure with `enqueue`, `dequeue`, and `isEmpty` methods.

**Question 14:**
Write a program to solve the Tower of Hanoi puzzle for `n` disks.

**Question 15:**
Implement a program to find the shortest path between two nodes in a directed graph using breadth-first search (BFS).

These questions are language-agnostic, allowing candidates to choose the programming language they are most comfortable with to solve them. You can adjust the difficulty level as needed for your specific hiring requirements.


Contact us for software training, education or development










 

Post a Comment

0 Comments