Niroshan Rajadurai

  • Increase font size
  • Default font size
  • Decrease font size
Programming Challenges

A good collection of programming questions and challenges to assess someone's technical skill level.



Is it a Palindrome

E-mail Print PDF

Write a method to determine if a given string is a palindrome (e.g. "Madam I'm Adam", or "A man, a plan, a canal, Panama").

 

  1. provide an implementation for: bool is_palindrome(char const * str)
  2. what assumptions does your code make?
  3. did you use a computer to do this?
  4. how long did it take to do this question?

 

Comments (0)
Last Updated on Monday, 24 January 2011 12:28
 

Linked List

E-mail Print PDF

Write a C/C++ function that reverses a doubly-linked list. Do not use any STL.

 

  1. provide an implementation for: void reverseDList(Node*& head)
  2. what assumptions does your code make?
  3. did you use a computer to do this?
  4. how long did it take to do this question?

 

Comments (0)
Last Updated on Monday, 24 January 2011 12:28
 

Binary Tree

E-mail Print PDF

Suppose you have a binary tree containing N nodes. Each node has a Name, a LeftChild and a RightChild. Write a C++ function to print the tree by levels. Print the root first, then all the children of the root, then all the grandchildren of the root, etc.Your algorithm must take O(n) time.

 

  1. Provide an implementation for: void printNodes(const Node * root);
  2. What assumptions does your code make?
  3. Did you use a computer to do this?
  4. How long did it take to do this question?

 

Comments (0)
Last Updated on Monday, 24 January 2011 12:28
 

Anagram Solver

E-mail Print PDF
User Rating: / 1
PoorBest 

Write a C++ Anagram Solver that generates all permutations for a given word (or phrase) and compares these permutations to a dictionary. Assume you have access to a file containing a list of dictionary words. Assume C++ design and readability are more important than execution speed.

Please write your own permutation algorithm – do not use stl next_permutation.

 

  1. Provide an implementation for a program that takes characters from argv[1] and outputs to stdout a list of anagrams.
  2. Would you have written the implementation differently if execution speed was most important?
  3. What other useful features could you add to this program?
  4. What was the most difficult part of completing this question?
  5. If you’d like to: provide an alternative implementation in your favourite language.
  6. Did you use a computer to do this?
  7. How long did it take to do this question?

 

Comments (0)
Last Updated on Monday, 24 January 2011 12:28
 

Unix Interview Questions

E-mail Print PDF

1) Difference between symlinks and hardlinks

2) What is a zombie process

3) What is SIGKILL? Can you give other signal names ?

4) How do you catch signals in C ?

5) What returns the fork() C function ?

6) What is the difference between TCP and UDP ?

7) Also revise against the attached job specs whilst paying special attention to C++, socket programming, STL, multithreading, UNIX and exceptions.

8) Unix architecture (file system, piping, stdin, stdout, stderr, etc)

9) Explain how Unix permissioning works

10) Name and describe some Unix System Calls that a typical multi-threaded application would use?

11) What does fork do?

12) What is a zombie proces?

13) How would you implement a socket based session manager which handles 10,100,1000 connections?

Comments (0)
Last Updated on Monday, 24 January 2011 12:28
 
  • «
  •  Start 
  •  Prev 
  •  1 
  •  2 
  •  Next 
  •  End 
  • »


Page 1 of 2

Related Articles