Interview Questions & Puzzles

Today, I want to share with all of you my little experience in Interview Questions for Software Engineer position .. and also some interesting puzzles.

Let’s start with questions

Questions

  • What’s the 4 major OOP Principles ?! and What’s the definition of each one of them ?!
  • What’s class ?! and What’s the difference between it and object ?!
  • What’s abstract class ?! and What’s the difference between it and interface ?!
  • What’s final variable, final method, and final class ?!
  • What’s overloading, and overriding ?! and What’s the difference between them ?!
  • What’s types of access modifiers ?! and What’s the difference between them ?!
  • To prevent class from being inherited what keyword we use in C#, and in Java ?! and Why we may do that ?!
  • What’s the difference between Vector and ArrayList in Java ?!
  • What’s serialization in Java ?! and What is its usage ?!
  • What’s managed and unmanaged code in C# ?!
  • What’s checked and unchecked exceptions in Java ?!
  • What’s reusability ?!
  • Why SQL cursors are slow ?!
  • Does C# or Java supports multiple inheritance ?!
  • Why C# or Java doesn’t support multiple inheritance ?!
  • Why we can’t initiate object from abstract class ?!
  • What’s index in SQL ?!
  • What’s indexers in C# ?!
  • Why garbage collection is important ?! and How GC knows that we don’t need that variable any more ?!
  • I have a SQL table with two columns one called empID and the other called managerID, and i want to get all the managers for this employee. How ?! (Hint: use recursion in SQL)

Now it is the time for puzzles 🙂

puzzles

  • What’s the angle between hour hand “عقرب الساعات”, minute hand “عقرب الدقائق” when it is 3:15 PM ?!
  • I have two non-homogeneous ropes, and each one of them needs 1 hr to be burned .. How can i calculate using those two ropes 45 minutes ?!
  • A man has 2 childrens one of them was girl, What’s the probability that the second one is girl ?! ( Hint: it is not 1/2 😀 )
  • I have a customer class that contains the customer age and name .. and I have the following code .. And this code throws exception what is it ?! and Why it throw that exception ?!

code

  • Will the following code throw exception ?! if yes, then When ?!sum
  • I have an array that contains 11 integer number .. and the range of number in this array is from 1 to 10, there is only one number repeated and i want to know which number ?! (Don’t use the systematic way by taking the first number and comparing it to other elements and so on, because i want the solution in O(N) 😛 )
  • I have N elements sorted array of integers, and i want to know if there are summation of two numbers = 1200 How ?! (Also here i don’t want the systematic way)
  • I have a linked list with odd number of nodes, and i want to get the middle of this list without knowing its length. How ?!
  • How to swap 2 numbers without using temp variable ?!
  • How to swap 2 numbers using pointers and without using temp ?!
  • I have 9 balls, and one ball is heavier than the others, and i have somthing to weight with but we are allowed to use it only twice. How can we know the ball of different weight ?!

If anyone has any other interview experience .. Share it here with us 🙂

Are You Optimistic Person ?

Today, after setting with some people … I found how much i’m rich .. I have things that doesn’t exist in others life, I have FAITH, HOPE, and OPTIMISM

Yeah, sure i consider myself as the richest person in the world. Do you know what that means if you are hopeless ?! it means that you really don’t know your GOAL and don’t search for it !! 😦

The other people consider me that i am a mad girl, because i always say “I love being a Software Engineer, I love coding and it flows in my veins” … I believe in Allah, Then myself “Allah Will Guide Me In The Right Way, I TRUST Him”.

What’s the difference between us and Mr. Mark Zuckerberg ?! (Who is now not having a Facebook account ?)

Mark-Zuckerberg

What’s the difference between us and Mr. Bill Gates ?! (How much users have Microsoft products today ?)

bill_gates

What’s the difference between us and Mr. Steve Jobs ?! (How much users have Apple products today ?)

Steve-Jobs

Actually there is a big difference between THEM and US.

Even Mr. Mark or Mr. Bill, or Mr. Steve not only has a creative idea, but also he has a self-confidence, passion and a belief that he can do it .. and “Yes He Did It” 😀 .. all of them considered as a successful persons. And our world have a lot of other successful persons too.

Why not to be one of them ?! Why we just lose hope and give up ?!

“I have not failed. I’ve just found 1,000 ways that won’t work”  Thomas Edison

He tried 1,000 times until he created the light bulb .. How much we try to give up ?

I consider that as a SHAME on us, We always have excuses for giving up !!

We need to decide with ourselves that we need to change, that we need to always try and work hard .. and no way for giving up. Let us make our REMARKABLE mark in our world. Let us IMPRESS the world with our EFFECTS, and let our skills SHINE. 🙂

“Believe in Allah, Allah will show us the RIGHT WAY .. and never lose FAITH and HOPE

And don’t forget Keep Moving Forward ^_^

What Changed My Life !!

Change

Today, I’m not going to talk about a technical topic. I’m going to talk about the thing that changed my life, make me OPTIMISTIC, fill me with HOPE, and changed my point of view to the work, future and the whole world. Today, I’m going to talk about my college and colleagues … and how each of them changed me.

When I was in my first year in college, I have no clear GOAL in my life (in other words “I have no life” 😦 ). I used to go to my college and take lectures and labs and go back to my home. I depend on lecture slides in my study, and that’s all what I do in my life (miserable life 😦 )

In the second semester of my first year, I began to realize that ALLAH put me in this college for a reason. And I start concentrating in subjects that I am interested in it (like Programming, Math, Probability & Statistics, Compilers, Image Processing, Neural Networks … etc).

I start working to improve myself especially in programming that I adore 🙂 , and also tried to improve my problem solving skills (which make me feel the challenges ^_^).

I knew some people who really motivated me; some of them are Teaching Assistants and the others are colleagues older than me. I learned from them that:-

1- Science is important.

2- We should do our best because ALLAH create us for constructing the earth.

3- We should do our work well because Prophet Mohammed told us that “Allah loves that whenever any of you do something, do it well” (“إن الله يحب إذا عمل أحدكم عملا أن يتقنه”)

4- We should be self-motivated, creative, and thinking outside of the box.

5- As a developer, I learned how to write code. And the wisdom I learned is “Think more, Write less” which means think a lot in a solution and then write less code 🙂

I should say that all those people are the ones who really I respect and admit that they do a favor for me because they changed my mind.

Thankful

I believe that in your work it is not important how much money you get, but it’s important to ask yourself some questions:-

  • Do you really love your WORK?
  • Do you really think that you exist for a reason?
  • What’s your GOAL in your WORK? And in your LIFE in general?
  • What makes you DIFFERENT from others?
  • Do you really BELIEVE in yourself?
  • Do you have the CURIOSITY for learning more?
  • Do you love teaching others what you have learned (in another words … Are you good in knowledge transfer)?

The last thing I want to say to all those people who changed me “I am very thankful to all of you, Meeting people like you are the best thing happened to me. I will never forget your advises” :D.”You are my LIGHTS in the Dark

Light