Interview Questions

Q:

Would I use print "$a dollars" or "{$a} dollars" to print out the amount of dollars in this example?

Answer In this example it wouldn’t matter, since the variable is all by itself, but if you were to print something like "{$a},000,000 mln dollars", then you definitely need to use the braces.
Report Error

View answer Workspace Report Error Discuss

Subject: PHP

0 3715
Q:

So if md5( ) generates the most secure hash, why would you ever use the less secure crc32( ) and sha1( )?

Answer Crypto usage in PHP is simple, but that doesn’t mean it’s free. First off, depending on the data that you’re encrypting, you might have reasons to store a 32-bit value in the database instead of the 160-bit value to save on space. Second, the more secure the crypto is, the longer is the computation time to deliver the hash value. A high volume site might be significantly slowed down, if frequent md5() generation is required.
Report Error

View answer Workspace Report Error Discuss

Subject: PHP

0 2901
Q:

With a heredoc syntax, do I get variable substitution inside the heredoc contents?

Answer Yes
Report Error

View answer Workspace Report Error Discuss

Subject: PHP

1 3259
Q:

What’s the difference between accessing a class method via -> and via ::?

Answer :: is allowed to access methods that can perform static operations, i.e. those, which do not require object initialization.
Report Error

View answer Workspace Report Error Discuss

Subject: PHP

0 3662
Q:

When are you supposed to use endif to end the conditional statement?

Answer When the original if was followed by : and then the code block without braces.
Report Error

View answer Workspace Report Error Discuss

Subject: PHP

0 4324
Q:

What are your weaknesses?

Answer

What are your weaknesses?


This is a very common interview question for many jobs across industries. Most people feel Answering strengths is easy but weaknesses is difficult. If approached the right way this question will give you chance to build trust. You have 3 options/approaches to answer this question. 


1. Deny having any weaknesses. This approach is least common and surely not the way to go.


2. Spin a Weakness into a strength. Like, "I'm a perfectionist" or "I care too much"


Note - This is very common approach and some interviewers think you are not being honest. 


3. Give an honest answer (Recommended). Answer the question honestly without shooting yourself in the foot. 


E.g. My weakness is public speaking, I am working on it. Ofcourse make sure this is not the primary requirement of the job. 

Report Error

View answer Workspace Report Error Discuss

3 2035
Q:

What are your strengths?

Answer

What are your strengths?

Purpose - The question is asked by the interviewer to understand your key selling point and get to know if it is relevant and helpful to handle the responsibilities that the person will handle if hired.

Note - All Most all Interviewers/Hiring people in management who assign tasks and responsibilities feel that a person is productive in work if his strength matches to the responsibilities of the role. So expect this question in most interviews. Also, be aware Strengths give clues on your interest.

Approach - Pick 2 or 3 strengths and give examples for each 1 to demonstrate how you used it in the previous job or in life. You can identify Some of your strengths from below list.
Continuous learning
Problem solving
Multi-tasking
Self learning
Flexible
Team Player
Hard working
Like Challenges
Quick Learner
Self Motivated
Communication, Oral and Written
Process Oriented
Analytical

Pre-work -Understand the job requirement in detail and get to know in advance what are the responsibilities the role you are applying and accordingly pick your strength that is relevant to the role. It would be advantageous to know the problems are issues the company is facing and what was the reason for the opening. You should be prepared for this question. It is one of the most commonly asked interview question.

E.g.: Communication and presentation - Communication and presentation is my strength.
In my previous job, I was given additional responsibilities to present and facilitate project status meetings with executive management and team building activities across departments.

Report Error

View answer Workspace Report Error Discuss

4 1772
Q:

How do you handle stress?

Answer

How do you handle stress?

Wrong approach -
Do not say you are never under stress or I hate stress or you do exercise and meditation to take care of stress. Focus strictly on professional things that you do.

Right approach -
A good response is to say that pressure helps you focus and maintain your drive and like to handle challenges. Explain that some of your best efforts are the result of stress and pressure. Also inform that when pressure gets too intense, you know how to handle it.

Example -
Stress and pressure are a challenging part of the job and i know how to handle it. I handle it by focusing on proper planning and reporting, better time management, open communication, Hard work and prioritization.

Report Error

View answer Workspace Report Error Discuss

2 2208