Monday, December 14, 2015

The Revolution is the Wire

http://www.imdb.com/title/tt3488710/


elthawrah heyah el estemraryah, where everyone who believes in it excels in what he does best. I am talking here about cs people and how they can make the revolution work. Movie makers how can they help it, photographers. Everyone.

Saturday, December 12, 2015

Google Interview Preperation

All interviews:
1. yet3araf 3alik, w ye2om raza3lak el process
2. 1st phone interview.
3. 2nd phone interview.
4. el onsite, 5 interviews, 4 ds/algos + 1 sys. design.

aboelkheir problems:
1. el corner cases by2fesho 3aliha.
--- test your code with some testcases
--- how to handle corner cases in an effecient way.
--- use datastructures that make things easier e.g. vectors instead of arrays.
--- think of empty arrays, empty strings, size of input, overflows.
--- codility and leetcode pay great attention to corner cases.
--- adhocs usually has lots of corner cases
--- recrusive style problems like segment trees, BST ... etc
2. getting the path in dp using recursion is not a good idea.
--- solve dp problems about getting the path using iteration.
3. mutation on the trees, insert in a weird location, all ways of traversing trees, balanced binary search trees.
--- implement binary search tree, (red-black tree, splay tree).
--- impelement iterators
--- implement caching
--- make a binary act as a list.
4. getting a good time sleep before the interview, because it is really long.
--- nam koayes w matfsha5sh nafsak elyoum elly 2ablo.
5. system design, be aware of response time, data structures, scalability, how to retrieve info in a db, and how to update the info.
--- read about google file system
--- read about hadoop
--- read about mapreduce
--- read about big tables
--- read about google log system
--- https://github.com/checkcheckzz/system-design-interview
--- http://grouplens.org/blog/preparing-for-a-google-technical-interview/
6. probability preperation - reservoir sampling
--- solve probability problems on topcoder/cf...etc

Tips:
1. Attitude
2. they rely on the interviewers feedback heavily, try to impress all of them.
3. code on the computer in the interview room (in the onsite).
4. take snacks with you to the interview to eat and be energetic.
5. 5alik baya3ha
6.

---
usually tell me about a difficult-situation questions should be answered by how you behaved in order to show how you acted before in such situations.

Wednesday, December 9, 2015

Microsoft In-Person Interview Preparation

  • Understand every aspect in your resume so well
  • interviewbit.com for interview questions
  • pramp.com for mock interviews
  • Solve lots of programming problems that are more like brain teasers (I don't know if such thing exists, but they ask questions of this type)
  • Prepare answers for questions like:
    • Why work for Microsoft?
    • What is your preferred role?
    • Where is your preferred location?

Wednesday, October 21, 2015

Microsoft HR Interview Preparation

I have passed this interview twice before, once in 2012 and the second time in 2014.


  • What is the difference between Java and C++?

C++
Java
Allows procedural programmingfunctional programming (since Java 8) and generic programming (since Java 5), but strongly encourages the object-oriented programming paradigm. Includes support for the creation of scripting languages.
Runs as native executable machine code for the target instruction set(s).
Runs in a virtual machine.
Has multiple binary compatibility standards (commonly Microsoft (for MSVC compiler) and Itanium/GNU (for virtually all other compilers)).
Has a single, OS- and compiler-independent binary compatibility standard.
Supports native unsigned arithmetic.
No native support for unsigned arithmetic.
Pointers, references, and pass-by-value are supported for all types (primitive or user-defined).
All types (primitive types and reference types) are always passed by value.[1]
Memory management can be done manually through new / delete, automatically by scope, or by smart pointers. Supports deterministic destruction of objects. Garbage collection ABI standardized in C++11, though compilers are not required to implement garbage collection.
Automatic garbage collection. Supports a non-deterministic finalize() method whose use is not recommended.[2]
Operator overloading for most operators. Preserving meaning (semantics) is highly recommended.
Operators are not overridable. The language overrides + and += for the String class.
Single and Multiple inheritance of classes, including virtual inheritance.
Single inheritance of classes. Supports multiple inheritance via the Interfaces construct, which is equivalent to a C++ class composed of abstract methods.
Compile-time templates. Allows for Turing complete meta-programming.
Generics are used to achieve basic type-parametrization, but they do not translate from source code to byte code due to the use of type erasure by the compiler.
Function pointers, function objects, lambdas (in C++11), and interfaces.
References to functions achieved via the reflection API. OOP idioms using Interfaces, such as Adapter, Observer, and Listener are generally preferred over direct references to methods.
No standard inline documentation mechanism. Third-party software (e.g. Doxygen) exists.
Extensive Javadoc documentation standard on all system classes and methods.
  • What do you know about our organization?
check wikipedia
  • Why do you want to work for us? 
Benefits especially real health insurance program. High standards of code.
  • What do you find most attractive about this position? What seems least attractive about it?
  • Why should we hire you? 
dedicated, goal oriented, and achiever.
  • What do you look for in a job? 
challenges and learning opportunities.
  • How long would it take you to make a meaningful contribution to our firm? 
3 months learning your underlaying system, choosing a team, and getting familiar with the work environment. Then I will be on fire.
  • How long would you stay with us? 
As long as I am being challenged.
  • What is your management style?
Trust my team abilities, and regular feedback cycles.
  • Are you a good manager? Can you give me some examples? Do you feel that you have top managerial potential?
Managing a small team in extend-info
  • What do you look for when you hire people?
Communication skills, teamwork, and learning curve.
  • Have you ever had to fire people? What were the reasons, and how did you handle the situation? 
I did something similar. I was training a group of students for the ACM contest, and I decided to kick out anyone who is not committed. First I send a thank you email to them similar to interviews rejection emails, and then I remove them from any mailing group regarding the training.
  • What do you think is the most difficult thing about being a manager or executive? 
Making decisions.
  • What important trends do you see in our industry?
Cloud Computing, Big Data Analytics, Internet of Things, 3D Printing, Smart Machines that can learn,
  • Why are you leaving (did you leave) your present (last) job? 
I don't have a job currently, I want to try a different culture.
  • How do you feel about leaving all your benefits to find a new job? 
I don't have a job.
  • In your current (last) position, what features do (did) you like the most? The least? 
PunnyLol, phabricator, tasks, internal groups, Arc,
  • What do you think of your boss? 
He was a good developer, but very bad at managing with no clear target about the project as I was not convinced with his requirements and had to consult with a couple of teammates. 
  • Why aren't you earning more at your age? 
I am working on increasing my skill set so I can move to better places.
  • What do you feel this position should pay? Salary is a delicate topic. We suggest that you defer tying yourself to a precise figure for as long as you can do so politely. You might say, "I understand that the range for this job is between Rs.______ and Rs.______. That seems appropriate for the job as I understand it." You might answer the question with a question: "Perhaps you can help me on this one. Can you tell me if there is a range for similar jobs in the organization? 
  • What are your long-range goals?
...
  • How successful do you you've been so far?
I think I am in good shape.
  • Tell me something exciting about yourself. 
I belive that if you want to be someone or to live somewhere else you have to act like in your current environment. For example in my country people tend to through garbage in the middle of the street, I don't I can keep it in my back pocket until a find a garbage disposal.
  • What's wrong with Microsoft?
People are moving away from desktop to mobile devices. 
  • Tell me one thing that Microsoft has done recently that has impressed you.
Hololens
  • What is Microsoft's current stock price?
48.72 USD
  • Who is the CEO?
Satya Nadella
  • Who are our main competitors?
answer based on product.
  • Tell me about a time when you solved a problem creatively?
Chess Tournament

  • Give examples from your own experiences which show your leadership and initiative skills.
AUC ACM Training
  • Microsoft Products
    • Windows
    • Office
    • Servers
    • Xbox
    • SQL Server
    • System Center
    • Unified Communications (Exchange)
    • SharePoint
    • Developer Tools (Visual Studio)
    • Dynamics (ERP & CRM)
    • Online Advertising (display & search)

                      End of watching TV Shows, Movies, Anime and all the likes Wednesday, October 21, 2015 at 18:30:52

                      For how long? ...

                      What are the alternatives? ... lets figure this out.

                      Booking In-person Interview Preparation

                      Travelling to Holland Woohoo


                      • Coursera: mining of massive datasets

                      URL: https://class.coursera.org/mmds-003/lecture
                      Shaco:
                      Week #1: Due October 23 (shaco done)
                      Week #2: Due October 24 (shaco here)
                      Week #3: Due October 25
                      Week #4: In Progress
                      Week #5: In Progress
                      Week #6: In Progress


                      Dante:
                      Week #1: Due October 23
                      Week #2: Due October 24
                      Week #3: Due October 25



                      • Map reduce
                      • Design Patterns


                      • GLASSDOOR (Dante done)
                      • Check Quora for system design and scalability questions
                      • Scalable systems and Design Questions: (Shaco done) (Dante done)
                      http://www.hiredintech.com/system-design/system-design-intro/
                      https://www.youtube.com/watch?v=-W9F__D3oY4

                      • Memcached technique of Facebook
                      • How is google search so fast?
                      • Sql vs nosql
                      • System design
                      • Regular expressions
                      • Some OS concepts like race conditions and dead locks
                      • Business Side questions (Revenue models masalan) (Dante here) (Shaco here)
                      • How would you improve booking.com website ??
                      • Review SQL, especially its main concepts like triggers, indexing, joins ... etc
                      Some questions on glassdoor:
                      - Given a list of words, group them by anagrams of each other. 
                      - Retweet twitter tweets if newer one is an anagram of older one. 
                      - What is the difference between the merchant model and agent model?
                      - How will you implement auto-complete ? Follow up, how to get the results sorted by most frequent rather than alphabetical order (using trie)
                      - Find how many moves it takes from point A in a maze to point B. (ghoo solved it using DP but there's a maths solution using combinatorics)

                      IMPORTANT BLOG: http://highscalability.com/ (new)






                      Monday, October 12, 2015

                      Booking.com Technical Interview Preparation

                      Questions: 
                      • parsing xml using function
                      http://stackoverflow.com/questions/6325436/algorithm-for-parsing-an-xml 
                      • find the smallest common element in two arrays 
                      https://www.quora.com/How-do-I-find-the-lowest-common-duplicate-in-two-large-integer-arrays-with-minimum-time-complexity 
                      • Tokenize a string of words and print the top 10 most frequent terms

                      • Given a list of words, group them by anagrams of each other.  
                      http://stackoverflow.com/questions/18476512/find-common-elements-in-two-unsorted-array 
                      • Given 2 arrays find common elements
                      • Sort a big file
                      • Recommendation process
                      • .a. Given an unlimited stream of characters, that can only be read one character at a time, using a specific function (e.g. getChar()), and a list of patterns (e.g. "cat", "dog", "man"), write an algorithm to find all the occurrences of the patterns in the stream.
                      • .b. Perform a "test run" of the algorithm in order to assess strong points, weak points and, eventually bugs. 
                      • .c. Give an estimate of the temporal complexity of the proposed algorithm (e.g. O(x))  
                      • Solve as much as possible at interviewbit.com

                      Tuesday, September 29, 2015

                      Quora Interview

                      Quora interview was not different than other companies interviews. He asked an easy question in the beginning of the interview about generating all anagrams of a given string. Ok generate them using next_permutation. How to write next_permutation function, I implemented it using 2 pointers. I don't really know why I failed this interview, the only possible reason was that he was passing 'const string&' to the function and i was trying to modify the string within this function, and I did not notice that.

                      IBM Egypt Interview Preparation

                      Answer the following questions:

                      • What do you know about IBM?
                      Things to consider while researching:
                      • Find out about IBM’s history. (Your starter for ten: IBM celebrated its 100th birthday in 2011; it began life as the Computing-Tabulating-Recording Company in 1911, through the merger of three other companies.)
                      • Research and development is a major growth area – IBM regularly receives more US patents than any other company. The technology industry moves fast, so keep tabs on IBM’s press releases to make sure you’re up to date.
                      • IBM originally focused mainly on hardware but has shifted towards consultancy and software. It’s important to show that you know about its products and services.
                      • Invests a lot of money on R&D
                      • IBM acquired 150 companies since 2000, big data and cloud computing.
                      • Why do you want to work for us?
                      I came from an ACM background where IBM is the main sponsor to the event,, support for innovation, challenges, solving big problems in the MENA region, learning opportunities.
                      • Tell me one thing that IBM has done recently that has impressed you.
                      Smarter Planet, Smarter Cities
                      IBM Smarter Cities[23] is an initiative of IBM Smarter Planet, created to provide hardware, middleware, software and service solutions for city governments and agencies. The solutions implement existing IBM technology such as IBM cloud computing, analytics, mobility and social business.
                      To date, Smarter Cities serves thousands of cities around the world in all areas of management[24] including public safety, health and human services, education,[25] infrastructure,[26] energy, water, and environmental. IBM Smarter cities also include citizen participation through People4SmarterCities.com,[27] so they can be part of the technological advances transforming their cities.
                      Examples of major cities around the world using IBM Smarter Cities technology:[28]
                      1) Year 2010, Rio de Janeiro, Brazil implemented an emergency response solution using IBM technology in anticipation of hosting the 2016 Olympics and 2014 World Cup.
                      2) Year 2013, New Taipei City Police, implemented an IBM solution to enhance police productivity and ensuring public safety.
                      3) Year 2013, Tucson, Arizona, implemented a water conservation solution with IBM focused on smart metering and water leak detection.
                      4) Year 2013, Digital Delta transforms Dutch water management system using Big Data.

                      • What is IBM's current stock price?
                      ~144.4 USD
                      IBM net worth is around $47.9 billion.
                      • Who is the CEO?
                      Ginni Rometty
                      Amr S.Talaat
                      • Who are our main competitors?
                      Microsoft, HP, Intel, Apple, Oracle, EMC, HP ENTERPRISE SERVICES, LLC
                      three major divisionshardware, software and services.  The former is organized by product lines: x (based on x86), i, p (powerPC based), and z (the mainframes). The software division has five pillars: Lotus (email, groupware), Rational (development tools), DB2 (database), Tivoli (enterprise management),Websphere (middleware). Services has Global Technology Services (IT consulting), and Global Business Services (business and strategy consulting). 
                      • Why are you applying to this role?
                      • Why should we pick you?
                      Hire me for a month and see for yourself.
                      • What was the most challenging part of your previous job? How did you deal with this?
                      debugging.
                      • What would you do if you won a million pounds?

                      • Is there anything else you'd like us to know?
                      • What is your approach to leadership?
                      • How many petrol stations are there in the UK?
                      • Tell me about a time when you solved a problem creatively?
                      chess tournament.
                      • Give examples from your own experiences which show your leadership and initiative skills.
                      ACM training for AUC Teams.
                      • How do you feel about having a job which requires you to travel frequently?
                      Cool
                      • How do you feel about having a job that requires you to spend a lot of time away from home?
                      Cool

                      Booking.com HR Interview

                      Questions:

                      • Why are you interested in Booking.com?

                      1. Working on scalability problems, that are tough and represent a huge learning opportunity. 
                      2. Moving around for the first 12 months, and getting exposed to different teams and project is really awesome for learning, experience sharing and knowing new people.
                      3. The idea of each team as a small startup is great, because it has a huge space for innovation.
                      4. 
                      • What is the most challenging task you have faced?
                      Google maps like project.
                      • What is it like to work at Booking.com?
                      Check Quora for the answer.



                      • Who are the founders of booking.com?

                      The founder of Bookings dot nl was Geert-Jan Bruisma. His business model included a number of resellers, the largest of which bought him out and took over the company. The team around Kees Koolen and Arthur Kosten took over the company and grew it a lot. Geert-Jan left the company and pursued other activities.



                      In 2006, Kees and his management team sold the company to Priceline, in order to finance growth. Before aquiring Bookings, Priceline aquired a UK hotel company, Active Hotels, and later integrated them into Bookings, renaming the resulting company Booking dot com.

                      Priceline decided to leave the management of the new Booking to Kees Koolen, who managed to grow the business between 50 and 70 percent year-on-year. What has been less than 3 percent of the total Priceline group of companies in 2006 is now over ninety percent of the current, much larger Priceline Group. Good for William Shatner, one of the Priceline investors. 

                      Geert-Jan has since returned to Booking and is currently holding a position in IT.
                      source: https://www.quora.com/Who-are-the-founders-of-booking-com 

                      • Who is the CEO?
                      Darren R. Huston

                      General Preperation:

                      • Model answers for booking.com behavioral interview questions
                      • Coding test preparation
                      • Business questions always say we need data to make decisions
                      • SQL databases
                      • Search for people who work there using linkedin
                      • Expect a design question

                      • How booking make money

                      Takes commission from the hotels on each reservation

                      Direct Advertising on the website

                      Deals and offers
                      Booking reserve rooms for a period of time from the hotels and resell these rooms and it takes the risk of not selling these rooms
                      They sell data and reports to market based on their analytics

                      Saturday, September 19, 2015

                      Pramp Quest

                      Doing 10 Mock Interviews:

                      1. Completed. Tuesday September 22 at 9 pm.
                      2. Completed. Wednesday September 23 at 8 pm.
                      3. Completed. Thursday September 24 at 8 pm.
                      4. Completed. Friday September 25 at 7 pm.
                      5. Completed. Saturday September 26 at 7 pm.
                      6. Completed. Sunday September 27.
                      7. Completed. Monday September 28.
                      8. Completed. Tuesday September 29.
                      9. Completed. Friday October 2.
                      10. Completed. Monday October 12.
                      Completed~~!

                      Friday, September 18, 2015

                      Amazon Coding Test and First Interview

                      # Coding Test
                      Amazon coding test was an average test (my hardest ever was Codility test for Codility which I thankfully passed). It consisted of 3 problems all easy to solve, but with tricky corner cases. It was on Codility were you can lock a problem after you finish it, or not and leave to the end, all up to you. My advice is do not lock the problems just leave it the end. I locked a problem then I figured out there was a subtle bug in my code, it would make my solution fail for most of the cases. Anyway I passed this test and moved the first interview. I think at Amazon they take both your coding test and the interview together to determine if you will pass to the next phase or not, that is why I did the interview although failing drastically in the coding test.

                      Lessons learnt:
                      1. Avoid over confidence.
                      2. Write test cases before submitting your code, imagine this code is going for production wouldn't you do so?

                      # Interview
                      The interview was really hard, he asked question about system design, algorithms, behavioral, knowledge, scalability, lots of aspects. Here are the list of questions:

                      1. A question about My pattern analysis course? He was so detailed oriented.
                      2. Did you dive deep before? How?
                      3. What is the difference between an abstract class and an interface?
                      4. What is a static method?
                      5. How do you use static method?
                      6. What is the difference between Public, Private, and Protected?
                      7. What happens you write an address in the address bar, until you load the page?
                      8. How to make the DNS so fast?
                      9. How to make sure your cache is valid? How to make it fast?
                      10. Why a system might be in an inconsistent state?
                      11. Give an example of a system that is available but not necessary consistent.
                      12. What is the complexity of inserting into a hash function?
                      13. What is the worst case scenario?
                      14. What to use instead the linked list within the hashmap?
                      15. What will be the complexity of that?
                      16. Given about 50M Resume remove the duplicates?
                      Lessons Learnt:
                      1. Sometimes the question is really simple like what is the complexity of inserting into a hashmap, do not over estimate the problem just give the answer O(length of input)
                      2. Do not just say things you know, say things related to the question.
                      3. You will be asked really tough questions about everything you have in your resume, so be mindful about what you write there.
                      4. Design questions should be answered in a specific way: a) Determine the use cases and the constraints b) Abstract Design c) Understanding Bottlenecks d) Scaling your design.
                      5. The interviewer should be treated as a co-worker not an interrogator, so be friendly.
                      6. Ask questions don't jump into answers without clear definition of the question.
                      7. RULE OF THUMB, imagine every question you are being asked is a problem you face at work, for example if it was a design question, imagine it will be your project for the quarter.
                      8. Do not say unrelated, unnecessary shit, as the interviewer will most probably ask about it.

                      Tips:
                      Amazon looks for experienced developers rather than competitive programmers, so in order to get there go work for a year or so then apply again.

                      Twitter Coding Test

                      Twitter coding test a very weird coding test, it consisted of 2 questions. The first one was so easy, I did it in under 5 minutes. The second one I thought it was also easy but I coded in around 10-15 minutes. The problem is I did not fully understand the problem, and it turns out to be one of the hardest problems I have ever seen in coding tests (generally they should be easy in comparison with ACM problems). When I figured that out I was only left with 20 minutes, now I have to figure out a solution, write it, and test it. To be honest it took me some time to figure out the idea, but finally I got it. I wrote it down, but there was a bug with my code, I did not manage to fix within the time frame of the test, that is way I ended up with only 1 problem solved, so I received the 'thank you' hated email the next day.

                      Lessons learnt:
                      1. Verify your f***** idea before implementing.
                      2. Read the problem clearly.
                      3. Avoid over confidence.
                      4. Brush up your algorithmic knowledge before indulging into such tests.

                      The good thing is I can apply again in 6 months, but online.

                      Tip:
                      I think at twitter they want to see your contribution to the open source community, so fill your resume with your great contributions.

                      Introduction

                      The goal of this blog is to share the full experience of getting an offer at Google.

                      Current State:
                      1. Having a contact with recruiter there, might start interviewing by November.
                      2. Did an internship at Facebook last summer.
                      3. Failing a couple of coding tests although being an ACM ICPC World Finalist (will address these failures in separate posts).
                      4. Failing a screening interview, although doing an internship at Facebook (will address this in a separate post).
                      5. Can not pass screening process of lots companies although doing an internship at Facebook, and winning the champion of Africa and Middle East in the last ACM ICPC World Finals (will address this in a separate post).
                      6. Joining the open source community but not committing as expected (will address this in a separate post).
                      7. Last year masters student.


                      Problems I should work on:
                      1. Communication
                      2. Saying unnecessary shit during the interview
                      3. Having no social life (Is this related?)
                      4. Not Following interviewing guidelines, especially in design questions.
                      5. Develop something people actually use to increase my self-confidence, something for the public not for a company (related to open-source).





                      This blog will be a timeline of all the effort I make facing my current problems, and trying to fix them until I can get that Google offer.

                      Note: I will do my best to keep this blog organized and to the point (not guaranteed).