Sunday, March 26, 2017

Microsoft Interview preparation and CV Preparation - Suggested by Masud Karim Khan Sir

Videos:
  1. https://www.facebook.com/ndcins/videos/727021087448808/

Some tips on writing good resume


  1. One page resume is the best. Up to two page it’s good. Too big resume  they will think – “It’s going to take too much time, I will read the shorter ones first and come back to this later”. That "later" unfortunately hardly happen, they get lots of resume.
  2. Format is very important. There are several good way to organize the information. One example:
    • Header – Your name, phone number, email address and physical address. Don’t mention your date of birth or Father’s name kind of info. I have seen people doing it!
    •  
    • Objective – What are you looking for? Full time/part time, what kind of role (dev/PM/test etc.). Make it one liner.
    •  
    • Highlights – Few bullet points that tells your skills. Try to make them quantifiable. Bad example: “Strong C++ coding skill”. Good example: “3 years of experience writing codes in C++”.
    • Work Experience (Only if you worked in industry) – One section for each job you held. Write the job title, company name and start-end date. Few bullet points explaining your role. Don’t disclose any non-public info such as you working on a feature that’s nobody outside of your org supposed to know yet. This is important, they don’t want same to happen to their company either. If you have completed any professional training as part of your job, mention that too. In this section, while writing about your role, highlight what your achievements were, or how your your work helped the product/team/clients/overall quality and try to add some numbers and technical info (not jargons) about the work. Example: "Worked on the web service to handle customer requests" might be written as "Designed and implemented a distributed web service in Java that can serve x requests/per sec to handle customer requests from legacy systems". Another example "Implemented a multi threaded data access layer in C# that increased performance by 60%".
    • School projects (Only if you are a fresh grad, skip this if you have a reasonable amount of industry experience to write a good section on “Work Experience”) – Mention several team projects you have worked on. Write a line or two summarizing each projects, what was your role in the team etc. Individual projects are not that important to mention but you can mention couple of challenging ones if you have. Your thesis goes in this section too.
    • Education – This is important. You don’t need to mention your SSC or HSC information. Start from first professional degree, which would be Bachelor’s degree. One line per degree – name of the degree & major, university name, GPA and year graduated.
    •  
    • Skills – This is different from Highlights. Totally non descriptive section, just mention the keywords. One line per skill set. Example skills: OS, Programming Languages, Test tools, Applications, Any version control tools etc.
    •  
    • Activity/Honor – One line per activity/honor. Here you can mention if you won any scholarship, competed in a programming contest etc. It’s not necessary to have all activities related to programming/CS. If you have organized a picnic, led a debating club, president of student organization, this is the place to brag about it. Recruiters want to see a leader in you, not a back office programmer.
    •  
    • References – This is optional. You might put couple of names who might recommend you if contacted by recruiters. You can skip this in resume, they have their way to verify if you provided any false info.
    •  
  3. If you don’t have a particular skill, don’t mention it in the resume just to make it look good. For example you don’t know perl but mentioning it might end up they will ask a question on it during interview even though that company doesn’t do any perl scripting. Bottom line, don’t try to oversell yourself by putting a lie in the resume.
  4. In big orgs they get 100s of resume daily. First level of review is done by recruiters in that case, who may not have enough technical knowledge. They will just look for matching keywords, such as C++, Java, Embedded software etc. and forward the resume to appropriate team. That’s why “Highlights” and “Skill” section is important.
  5. Have the resume ready in both Word/PDF version and also in simple text version. Many companies ask to copy the content of the resume in their online application. Text version helps in that case, copying from word doc most likely will mess up all the alignments.

 Books for data structure and algorithm:

Introduction to Algorithm - by Thomas H. Cormen is one good book. Also, for quick preparation for software developer interview, Programming Interview Exposed - by John Mongan is very effective.

5 years details in microsoft life of Masud Karim Khan Sir: here 

মাইক্রোসফট - ইন্টারভিউ পর্ব

 

Monday, March 20, 2017

Which Gradle commands do which things?

To get started you only need to know a couple of tasks.
  1. gradlew clean
  2. gradlew test
  3. gradlew build
You may have noticed that after you ran gradlew build, a new directory was created in your project's root directory named 'build'. This directory contains all of the artifacts resulting from building your project.
  • build/classes - The compiled Java classes
  • build/test-results - The raw results of your unit tests
  • build/reports - An html report displaying the results of your unit tests
  • build/libs - The java-quickstart.jar library for your project
In order to clean up the files generated by the build process run the following command:
gradlew clean
This should result in the 'build' directory being deleted. At this point your project is back to its initial state.
Next try running this command:
gradlew test
This command instructs Gradle to compile your Java source files, execute your unit tests, and generate the test report. If all of your tests passed you should see a 'BUILD SUCCESSFULL' message.
Finally, run the build command again:
gradlew build
This command will instruct Gradle to compile your Java source files, execute your unit tests, generate a test report, and assemble your jar. You may notice that the some of the steps in the build output are labelled 'UP-TO-DATE'. Gradle is smart enough to keep track of what steps it has already executed and only execute them again if something has changed.
Now try to execute this command:
gradlew clean build
The result of running this command is the same as when you just the gradlew build command. However, notice that most of the build steps in the console's output no longer are marked as 'UP-TO-DATE'. This is because you told Gradle to clean up the build directory before running the build. This means that Gradle had to recompile the sources, rerun the tests, regenerate the test report and finally generate the jar.
A Basic Workflow
To start developing your library, you can follow the simple workflow described below.
  1. Develop a new feature with unit tests
  2. gradlew test
  3. If tests fail, fix the code and go back to step 2
  4. If you need to add more features, go back to step 1
  5. gradlew clean build
At the end of this workflow you should have a unit tested version of 'java-quickstart.jar' that is ready for use.

Resource Link:
  1. https://kchard.github.io/java-quickstart/

Multi module Gradle project with IDE support


  1. http://touk.pl/blog/2012/11/26/muliti-module-gradle-project-with-ide-support/

Here’s how Rich Seller, a StackOverflow user, describes Gradle:
Gradle promises to hit the sweet spot between Ant and Maven. It uses Ivy’s approach for dependency resolution. It allows for convention over configuration but also includes Ant tasks as first class citizens. It also wisely allows you to use existing Maven/Ivy repositories.

Sunday, March 19, 2017

Algorithm lists. You have to know

Even though we are the same codeforces color >.<, i still have valuable advice to provide. My red friends on codeforces have stuck to this method. I have used this also to make the gold division in USACO.
Step 1: Learn and Practice Algorithms
Start from some simple and basic algorithms and practice them thoroughly:
-Sorting
-Scanline (Sweep line)
-traversals
-binary search
-MST/shortest paths
-DP
-Simple data structures:
-dsu, sets, map, heap, queue, stack, deque
Then proceed on to more devious and complex algorithms:
-Greedy
-DAGs, SSCs, Bi-connected compnents
-DP + caching previous results
-compression
-Convex Hull
-Complex Data structures:
-segment trees, linked list, BIT, Trie, Splay, Suffix Trees
-KMP/String hashing/string algorithms
-mincut/maxflow/maxmatching
Step 2: Look at Problems, Know what type of problem it is
I suggest you turn off the tags for unsolved problems so you can try to decide what type of problem you are solving.
At this step, you should try to: -know how to turn this problem into something familiar, into a graph? How will you handle updates? queries?
-know how to handle constraints of the problem. Do you need to add more states?
-Make observations about the problem, if the problem gives huge constraints like 10^6 and then suddenly gives a small constraint of 10, you should take advantage of that. Of course there are many different observations that you can make to help you solve problems.
Note at this step you do not need to necessarily code up the solution, you just need to form a clear approach in your mind.
Step 3: Implementation
Here is when you need to not only recognize the type of problem, but also know how to implement it. This is what I am bad at. My suggestions are:
  1. order the codeforces problemset by solved and burn through the first 4~5 pages. I have finished the first 3 already.
  2. Practice problems that require more than a direct approach. These problems can combine algorithms like dp with complex data structures, here is an example: http://www.usaco.org/index.php?page=viewproblem2&cpid=365
Other Tips:
When doing codeforces problems, if you get a wrong answer during practice, try not to scroll through the test data to see what you got wrong. Try to test your code again and see if you can fix your bug, this really helps during a contest. This is how I can recover from hacks. Do not only do codeforces (although I think codeforces's problemset is the best), do other sites that have even more archive of problems like POJ, SPOJ, USACO / USACO Training Gateway, etc.

Hope this helps! Trust me, this is how I got into USACO Gold! Just follow this list!

Resource Link: http://codeforces.com/blog/entry/2332#comment-176240

For Algorithm learning, which things I should know ?

We should learn first for beginners:

  • Reading in data from standard input (the console), or from a file. You must learn how to do this, since that's how interaction with the program is done.
  • Basic arithmetic operations with integer numbers as well as real numbers.
  • Basic operations with strings, like extracting a substring or reversing the string entirely.
  • Arrays, iterating over an array, updating elements in an array
  • .As you get more experience, you can learn about more advanced data structures. Vector, priority queue, map, and set are some of them. 
Resource Link: https://www.quora.com/For-an-ACM-ICPC-beginner-how-should-I-start

Friday, March 17, 2017

PHP training

BASIS:
---------
Bangladesh Association of Software and Information Services (BASIS) BDBL Bhaban (5th Floor - West), 12 Kawran Bazar, Dhaka -1215
Phone: +880 96 12322747; +880 2 58151196; +880 2 8144708-09
Fax: +880 2 58151197
Email: secretariat@basis.org.bd

http://www.basis.org.bd/index.php/contact


IBCS-primax
-----------------

Developing Dynamic Web Application Using PHP & MySQL

Course Name: PHP and MY SQL Course
Starts: March 19, 2017 7:00 pm
Duration: 90 hours
Days: Sunday & Tuesday
Fees: Tk.17900/-
Venue: IBCS-PRIMAX Software (Bangladesh) Ltd, Rd No. 10A, Dhaka, Bangladesh
For further query please contact @ 01713397567-8

http://ibcs-primax.com/education/course/php-mysql/

Tuesday, March 14, 2017

Palindrome Algorithm Details

Analysis

This problem can be trivially solved by looping through each character and checking it against the character on the opposite side. There is a problem with this though because half the work being done is redundant as it’s checking all characters two times. Consider the palindrome "madam", this algorithm would make the following comparisons:
m ↔ m
a ↔ a
d ↔ d
a ↔ a
m ↔ m
All that needs to be compared to prove it’s a palindrome are the first two characters against the last two since the middle one does not need to be checked:
m ↔ m
a ↔ a
This leads us to our initial solution:
function isPalindrome (text)
  if text is null
    return false
  left ← 0
  right ← text.length - 1
  while (left < right)
    if text[left] is not text[right]
      return false
    left ← left + 1
    right ← right - 1
  return true
 
Resource Link:
 http://www.growingwiththeweb.com/2014/02/determine-if-a-string-is-a-palindrome.html 
2. http://www.growingwiththeweb.com/2012/11/big-o-notation.html

Wednesday, March 8, 2017

Space Complexity

List of Algorithm

Best Time Complexity Calculation

What are some easy ways to understand and calculate the time complexity of algorithms?


You'd already be aware of Big-O and Theta notations. Big O gives the upperbound - the worst possible execution time of an algorithm. And is the converse of O, ie, the lowest estimate. is somewhere inbetween.

Big O is the most commonly used term. Most of the time we want to find the maximum time an algorithm would take. Let me show some examples.



= = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =

Understanding Time Complexity

Let us consider there's a small piece of code (maybe just a single line) that takes one second on a slow computer. This piece of code will be used on a list of items for processing; something like an array waiting to be searched or sorted.

If you have designed an algorithm that is O(1), it means,
If the array contains just a single item, it will take 1 second.
If array has 10 items, it will still take 1 second to finish with all of them.
If it has 100, again 1 second only.
You see, the algorithm you designed is great even for the large arrays.

Let's proceed to quite larger and practical time complexities. Now you have created a similar algorithm, but in O(n) this time.
If array has one item, it will take 1 second. Still seems okay.
If we have 10 items, it will take 10 seconds. Did you see the difference?
Now it we have 100 items, it will take 100 seconds. Going damn bad.
What will happen to the longer lists?

You would have seen, or even designed many algorithms that are of O(n^2) order.
Again, to process a single item, you take 1 second.
With 10, it will take 100 seconds to process the whole array.
And what if you have 100? It'll take 10000 seconds.
In practical cases we may have really big arrays containing millions of items. Such algorithms may make you wait an eternity.

= = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =

Calculating Time Complexity

If there is a single iteration, and the iterative variable is incrementing linearly then it's O(n) e.g.
for(i=0;i<n;i++) //O(n)

for(i=0;i<n;i = i + 4) // still O(n)

If the iterative variable is incremented geometrically, then it's O(log n)
e.g
for(i=1;i<n;i = i * 2) //O(log n)

Note that, the implementations don't have to be using loops, they maybe implemented using recursion.

If there is nested loop, where one has a complexity of O(n) and the other O(logn), then overall complexity is O(nlogn);
e.g
for(i=0;i<n;i++) // O(n)
{
   for(j=1;j<n;j=j*3) // O(log n)
}
//Overall O(nlogn)

This is only a finger cross guideline. In general, you have to have good concept to derive the complexity.



= = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =

In the definition we say,  f(x) ∈ O(g(x)) as there exists c > 0 (e.g., c = 1) andx0 (e.g., x0 = 5) such that f(x) < cg(x) whenever x > x0. You can have a look at the graph above (from wikipedia). Till point x0, we may not have the straightforward behavior. We are to notice larger numbers. So we keep such a limit.

A small comparison of time complexity orders is in this graph below. You can see how bad the higher orders go. Notice the Y axis is a log scale.


= = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =

A great explanation is given by various writers to answer a related question in Stack Exchange. You'll find it interesting.
http://stackoverflow.com/questio...
You should also have a look at
How does one know which notation of time complexity analysis to use?
Graph Reference : http://n0b3l1a.blogspot.in/2010/01/bigo-time-complexity.html
Time Complexity Explanation Reference : http://stackoverflow.com/questio...


All credit goes to Aditya Joshi

Tuesday, March 7, 2017

How to create a “save” menu item in java. I have created the “save as ” menu item but don't know how to create the “save” menu item

Big-O notation explained(Time Complexity)

1. So setting a counter to zero is a constant time operation.

total = 0;
==> O(1)



2. If it's 75, we do 75 operations. In mathematical terms, this means that the time it takes to do something increases linearly with its input. We use a variable to represent the size of the input, which everyone in the industry calls n. So the "loop over the list" function is O(n) where n represents the size of a_list.

for element in a_list:
==> O(n)

3. Checking whether an element is equal to 1 is an O(1) operation

if element == 1:
==> O(1)


4. Next, we increment total by 1. This is like setting total to zero (but you have to do addition first). Addition of one, like equality, is also constant time.

total += 1
==> O(1)

So, For all 4,
--------------
(O(1) + O(n) * (O(1) + O(1))
                         ^^^^^^^^^^^^
(O(2n) + O(1))


In big O, we only care about the biggest "term" here. "Term" is the mathematical word that means "portion of an algebraic statement".

in calculating Big-O, we're only interested in the biggest term: O(2n). Because Big-O only deals in approximation, we drop the 2 entirely, because the difference between 2n and n isn't fundamentally different.


Resource Link:
==============
compare the graph of x^2 vs 2x vs x.

  1. http://www.wolframalpha.com/input/?i=plot+x%5E2,+x%5E3,+x%5E4+from+x%3D0+to+10  
  2. https://justin.abrah.ms/computer-science/big-o-notation-explained.html


Thursday, March 2, 2017

Codility Question and preparation details

Some tips for codility:

  1. https://arkofmind.wordpress.com/2012/10/06/doing-a-test-with-codility/
  2. http://dev.tasubo.com/2012/09/tips-for-tasks-on-codility.html
  3. https://ilovefoobar.wordpress.com/2012/12/13/codility/

 Java Code Example:

  1. https://github.com/jmornar/codility-java-solutions
  2. https://codesays.com/category/java/
  3. https://github.com/mkleine/codility-examples/blob/master/equi/src/main/java/Equi.java
  4. https://github.com/jmornar/codility-java-solutions/blob/master/src/timecomplexity/TapeEquilibrium.java

Blogs:

  1. http://codility-test-questions.blogspot.com/2013/01/my-experience-with-codility-test.html
  2. https://codility.com/programmers/lessons/1-iterations/
  3. http://www.elvishsu.com/2013/12/my-codility-test-experience.html#.WLhTN1dVYdc
  4. https://www.martinkysel.com/codility-solutions/
  5. http://stackoverflow.com/questions/12417383/programming-test-codility-dominator 

The Heroes of Java: Angelika Langer

Java Executor Service