[video]
[video]
I was given another ONLINE assessment test from a site called http://select2perform.com/. The assessment is from a company called PreVisor ONLINE(Pre Employment Screening, Assessment Testing, Online Personality Test) from http://www.previsor.com/. I will try to go over what I remember. This assessment was way harder than the other one I had taken from Proveit2.com.
HTML_quickform
([0123][0-9])-([01][0-9])-([0-9]{4})
ReflectionClass
odbc_execute
Which function do you use to determine what happens when XML
nodes are parsed by an XML parser?
I am at the Orange County Public Library in Orlando, FL reading “SAMS Teach Yourself PHP in 24 Hours” by Matt Zandstra. A PHP book
copyrighted in 2004. In this book there are many PHP exercises that are useful for those willing to take the ZEND Certification test.
Remember, it is in the easy questions that most of us tend to get wrong.
**************** The Building Blocks ****************
1) Which of the following variables names is not valid?
a) $a_value_submitted_by_a_user
b) $6666666xyz
c) $xvz6666666
d) $____counter_____
e) the first
f) file-name
2) What will the following code fragment output?
$num = 33;
(boolean) $num;
print $num;
3) What will the following statement output?
print gettype(“4”);
4) What will be the output from the following code fragment?
$test_val = 5.4566;
settype($test_val, “integer”);
print $test_val;
5) Which of the following statements does not contain an expression?
4;
gettype(44);
5/12;
6) Which of the statements in question 5 contains an operator?
7) What value will the following expression return, and what data type will the returned value be?
5 < 2
**************** Control Structures ****************
1) Must a control structure’s test expression result in a Boolean value?
2) Must I always surround a code block in a control statement with brackets?
**************** Functions ****************
1) Apart from the global keyword, is there any way that a function can access and change global variables?
2) Can you include a function call within a string, as you can with a variable?
3) True or false: If a function doesn’t require an argument, you can omit the parentheses in the function call.
**************** Arrays ****************
1) I can discover the number of elements in an array, so should I use a for statement loop through an array?
2) Which construct can you use to define an array?
3) Without using a function, what would be the easiest way of adding the element “Susan” to the $users array ($users = array(“Harry”, “Bob”, “Sandy”);)?
4) Which function could you use to add the string “Susan” to the $users array?
5) Which function would you use to merge two array?
6) How would you sort an associate array by its key?
**************** Working with strings ****************
1) Is <pre> tags the best way for formatting plain text on the browser?
2) Which conversion specifier would you use with printf() to format an integer as a double? Write down the full syntax required
to convert the integer 33.
3) How would you pad the conversion you effected in question 2 with zeroes so that the part before the decimal point is four
characters long?
4) How would you specify a precision of two decimal places for the floating-point number you have been formatting in the previous
question?
5) Which function would you use to determine the length of a string?
6) Which function would you use to acquire the starting index of a substring within a string?
7) Which function would you use to extract a substring from a string?
8) How might you remove white space from the beginning of a string?
9) How would you convert a string to uppercase characters?
10) How would you break up a delimited string into an array of substrings?
**************** Objects ****************
1) What is the $this special variable?
2) How would you choose a name for a constructor method?
3) How would you prevent a method from being accessed except from within the current class and child classes?
protected function dontTouchMe() {
// no access outside current class and children
}
4) What should you add to a class definition if you want to make it inherit functionality from another class?
**************** Forms ****************
1) Which $_SERVER array element could you use to determinee the IP address of a user?
2) Which predefined variable could you use to find out about the browser that called your script?
3) What should you name your form fields if you want to find an array in the element $_REQUEST[‘form_array’]?
4) Which superglobal associative array contains all values submitted as part of a GET request and which superglobal array $_POST
contains all values submitted as part of a POST request?
5) What function would you use to redirect the browser to a new page? What string would you pass it?
6) How can you limit the size of a file that a user can submit via a particular upload form?
7) How can you set a limit on the size of upload files for all forms and scripts?
**************** Working with files ****************
1) Will the include() statement slow down my scripts?
2) Should I always end script execution if a file cannot be opened for writing or reading?
3) Which function would you use to find out whether a file is present on your file system?
4) How would you determine the size of a file?
5) Which function would you use to open a file for reading and writing?
6) Which function would you use to read a line of data from a file?
7) How can you tell when you have reached the end of file?
8) Which function you use to write a line of data to a file?
9) How would you open a directory for reading?
10) Which function would you use to read the name of a directory item after you have opened a directory for reading?
[video]
In this post, I will go over question number #2 from http://phpexercises.com/php-simple-array-loop-exercise.html
Please look at my code (what I came up with):
<?php
/*
PHP Arrays Ex. #2: Simple Array Loop
For this exercise, you will use a list of ten of the largest cities in the world.
(Please note, these are not the ten largest, just a selection of ten from the largest cities.)
Create an array with the following values: Tokyo, Mexico City, New York City, Mumbai, Seoul,
Shanghai, Lagos, Buenos Aires, Cairo, London.
Print these values to the browser separated by commas, using a loop to iterate over the array.
Sort the array, then print the values to the browser in an unordered list, again using a loop.
Add the following cities to the array: Los Angeles, Calcutta, Osaka, Beijing. Sort the array
again, and print it once more to the browser in an unordered list.
*/
$list = array(‘Tokyo’ , ‘Mexico City’, ‘New York City’, ‘Mumbai’, ‘Seoul’, ‘Shanghai’, ‘Lagos’, ‘Buenos Aires’, ‘Cairo’, ‘London’);
asort($list);
foreach($list as $key => $value) {
echo $value;
echo ‘, ‘;
}
array_push($list, ‘Los Angeles’, ‘Calcutta’, ‘Osaka’, ‘Beijing’);
echo ‘<br /><br />’;
asort($list);
foreach($list as $key => $value) {
echo $value;
echo ‘, ‘;
}
?>
Now look at their code answer (click on view script):
http://phpexercises.com/php-simple-array-loop-exercise.html
The difference between our codes lies in the function to sort the array. I used asort while they used sort. We both got the same results using different functions. What is the difference though? Let’s check it out. When using sort, new keys are assigned for the elements in the array. For example, if you have ([a] => ‘me’, [b] => ‘you’) it sorts to ([0] => ‘me’, [1] => ‘you’). With asort, the function sorts an array by values. The values keep their original key(index).
This month of June has been a blessing. Not only did I get an interview for a web development career position in Orlando, FL but I also made it through the first round of interviews. I was invited back for a 2nd interview. This is all good news. In this post, I am going to talk about my experience with my latest job interview. Let me start by saying that, in the past, I had been through a few other recruiting companies. So I was well prepared for this interview. So lets go over some points.
Do you know what you are worth? maybe? maybe not? Well, you should known your numbers. My advice to you is not to go looking for work when you don’t know your worth. Do you have a Bachelors Degree but no experience? Well, that is what you are worth. At least for now. With a Bachelors Degree and no experience at hands, ask for no less than 45k after taxes. If you have a Bachelors Degree and years of experience then do NOT settle for less than 75k. If you only have experience but your experience is extensive then settle for no less than 60k. If you are an intermediate like me with just an Associates Degree then settle for no less than 50k. That is your worth. Don’t go asking for 80k or 90k when you are not worth that much. Remember, if you claim to be a senior upfront, that’s how you will be seen in the company. Be prepared for some fire when you bottleneck. People who possess important certifications like the: Zend PHP, MySQL and PayPal certifications can ask for close to 70k. The more education you have, the more credentials you get to prove your worth.
Your recruiter is your first contact. That’s the person who will represent you in your job endeavor. So do your research and make sure that you hire a recruiter that you know is professional, respectful and has work ethics. Think of it as if you were hiring a lawyer for a civil/criminal case. Would hire a bad lawyer? Only if you didn’t know better. The same line of thought applies for recruiters. You, the programmer, must do your research and make sure to hire the right person to represent you. Indeed, a professional recruiter will have time to call you often to discuss the position while being courteous. A good recruiter won’t give you excuses like “I am not at my desk, I don’t have your information” or “Call me tomorrow and we will talk”. Those are red flags. That is not professional. A good recruiter will go straight to the point. Do not settle for just any recruiter. Remember, you wouldn’t settle for just about any lawyer. A good recruiter e-mails you back and forth to make sure that you have all the information you need way before the 1st interview. Now, get this, the BEST recruiter will actually tell you the company name. There is no reason to withhold that information because sooner or later you will have to know the company name anyways. Some recruiters choose not to reveal that info until you sign paperwork. Oh well, what is the problem with doing that? How do you know that the company in which you are about to be interviewed is not a scam? How do you know that it is legit? How do you know if that company is what you are looking for? The only way is to Google it and find out everything that you can about the company. Your time is valuable and you need to make sure that a recruiter values it. You are not begging for a job, you are looking for the ideal fit. Also, make sure to be comfortable with your recruiter. That’s the person who will assist you for the next 6-months probation period in which you are hired through the recruiting company not the actual company that you work for. If anything happens, you have to be comfortable to talk to your recruiter.
Your resume MUST NOT contain any lies or exaggerations. You don’t have to list all the companies that you worked for in the past. You can not make up information. Your resume is sort of like a Diploma. You can not fake it. If you do, a simple “background check” will catch any inconsistencies. If you have done side work then make sure to be clear. Your resume is you. Be real! Be original! Be yourself! If you have any questions, ask your recruiter. They are equipped to help you came up with the best looking resume possible. I went a step further and built my own personal website. On my website(http://www.ravigehlot.com/), recruiters can even log in and see an interactive resume with links. From that member section, they can download my most up-to-date resume. I built that site to e-mail me whenever a recruiter signs in. That way I keep track of whom is downloading my resume. I also have this blog(http://www.ravigehlot.net/).
Got company-name? Google it. Your job is to find out everything and anything that you can about the company in question. You plan to spend your next couple of years working for that company; so make sure that it is what you want. Google is your best friend. If the company has any negative reviews, you will come across it ONLINE. Watch out for companies that are scam. They do exist. A good honest recruiter knows the company they work with. This is where choosing a good recruiter can benefit you on the long run. Do your job, avoid being part of a disaster. Once you know that the company is legit, find out if what they do interests you. Remember, you will spend 40 to 50 week hours working for that company. Do not set yourself up for failure. Make sure that you like what they do.
Your recruiter found you a good paying job. You have already agreed on the annual salary rate and you know that the company is legit. Now you are up against your first interview. My advice to you is BE PREPARED. If you know that your job interview is in 2 days then make sure to follow up with your recruiter immediately. If your recruiter has not sent you detailed instructions then ask for it as soon as possible. You should have a full job description along with other important information like the interviewer’s location and name. Make sure to be at the location 1 hour prior to your interview. I mean, you should always have 1 hour to work any unanticipated events like heavy traffic, blown tire and etc. You must look and feel your best. So make sure that you dress professionally and that you feel comfortable. Be confident. You are trying to score a job but you aren’t meeting the President. You are meeting an ordinary person like you. There is absolutely no reason to be nervous. Make eye contact.
If you made it through the first round of interviews then make sure to take time to thank your interviewer. They will appreciate your acknowledgment. Ask your recruiter to send a thank you letter.
Ravi.
What happens in the follow piece of code?
$a = ‘string’;
$b = 0;
if($a == true && $b == false && $a == $b) {
echo ‘hum rum’;
}
Ravi Gehlot I like PHP way more than ColdFusion. If you know how to program in PHP, you can gain speed(performance) that you would only get it with ColdFusion if you were to get down to JAVA. Also, PHP is more OO.Il y a environ une heure ·
Ravi Gehlot :))Il y a environ une heure ·
Melih Birim I realized that I hate OOP(it is complex, it is not scalable, it is not organizable, it is bull shit when not maintained well).Il y a 58 minutes ·
Ravi Gehlot true. OOP is not for everyone. It’s like school. School isn’t for everybody. It takes years of experience to master it. You have to have knowledge of framework to kind of program OOP in an “organized” way. But I do like it though. I am getting used to it. I will have you look at some of my OO code later.Il y a 57 minutes ·
Ravi Gehlot But you can get work done in Procedural programming as well. Nothing wrong with that. they are 2 different styles of programming. But with languages like JAVA, I can’t see anybody trying procedural. JAVA is OO to the guts man.Il y a 56 minutes ·
Melih Birim I still don’t understand real usage of “Inheritance”. Lets think scripting languages, fe Python, it is both OO and Proce. but you can write your modules and can use it later. Why I need another object has same attributes but different behaviours like the inherited one. If I need an object, with different behaviours I prefer Compositon DP over inheritance. Since in Java you allowed only one inherited class but you can set different behaviours…Il y a 50 minutes ·
Ravi Gehlot In OO you always think real world events. So lets take for instance that your parents want you to inherit their possessions. Well, you can either leave everything that you worked for your entire life for what your parents want to give you or you can just take what your parents gave you and adapt(add) to what you already have. You would inherited their possessions and still kept yours. They are just one inseparable unit after that. You could try to buy a new house of your own and then not accept your parent’s house or you can buy your house and keep theirs. But their house has its own characteristics while yours has its own. The whole purpose of OO is to separate logic.Il y a 45 minutes ·
Melih Birim well thats my point, I know how to use OO and how to delegate login behind it but why I need to separate the behaviours. Probably it is not the best thing to write everything in an object but as I said, this does not mean the software can not be modular. Moduler systems also means separation of concerns, but not every moduler system is OO, and not every OO project is moduler. My concern : Is project scalable? And is it modular?Il y a 39 minutes ·
Ravi Gehlot think of the object as the union of code and data. the object is the MODULAR unit for application development and code reuse. Inheritance has to do with code re-usability. You inherit because it’s the same thing. You just don’t want to have to re-write code. Also, by doing that, all inherited code fetches from one main root. That root(parent class) delegates the other classes. So all you got to change is 1 class. Not all.Il y a 36 minutes ·
Ravi Gehlot It is scalable if you are working on a big project. If you are working on a small project, I would go procedural with functions. OO is good for medium-large size projects.Il y a 34 minutes ·
Melih Birim I know it is scalable, but it is not easy to implement and construct a scalable project. And if it is not constructed well, it means nothing, and means that project will demolish your life and your company, and you will need another project which for the place of current one, and than you start with high expectations another 4 year project… :-)Il y a 29 minutes · · 1 personne
Ravi Gehlot Scalability means that a project is able to keep up with growth. It’s somewhat easy to write classes that inherit from other classes. You already have the prototype in hands but now you just want to scale the application to accommodate growth. Sometimes they even have an interface that you have to use. So all you go to do is write those same methods prefaced in the interface and then inherit the methods/properties from the base class and go from that point on. That’s scalable because it makes it for quick code writing and enables you to move on quick. The thing with OO is that you have got to have some knowledge of frameworks or you will be all over the place with it.Il y a 28 minutes ·
Melih Birim if, mechanical/civil engineers used OOD think about world how could it be? :PIl y a 27 minutes ·
Ravi Gehlot right. I agree with you. That’s why I told you that some framework knowledge is necessary. OO gives you the power to come up with your own framework. So with OO, you do not need a third party framework because you are the framework builder. That’s why they say that it takes a lot of planning to build a successful OO app. You also gotta document your code. That’s why most people choose to adopt an existing framework and use what had been previously developed.Il y a 26 minutes · · 1 personne
Melih Birim seems we are talking about different ways, I am talking about pm side of how OO changes(ruins) your life, at the other side(developer) it is very nice thing to know, your system is OO and it might(!) be scalable and maintainable… But not allow you to design again.Il y a 25 minutes ·
Ravi Gehlot oh I see. You mean, you would have to stick with the original idea. But wouldn’t that apply to procedural programming as well?Il y a 23 minutes ·
Ravi Gehlot With Procedural, after you wrote your hundreds of functions then it makes it hard to change the idea of doing the project a different way. You can’t really change the design unless you were to change the entire project.Il y a 22 minutes ·
Melih Birim think about functional programming, fe, D or Earlang, it is well used by Facebook, Ericssonn and Nortel. You combine similar functions in a module. And can use it later on. just like jars. But the things is java is using functions(methods) as well as other programming languages. and also in functional programming design is not something you want change everyday, the flow of the project might change, so that you can easily write another flow that fits your need. :)Il y a 16 minutes ·
Ravi Gehlot That’s the thing ;) You don’t want to have to change things around too much. Think about your car. Your car is a great example of it. Why you would want to change the design of it when regardless of what you do, the car will continue to run the same methods. It will accelerate and stop. That what cars do. I am not going to try to get under the hood and put an airplane engine there. I could…but I wouldn’t ;) If I were to install an airplane engine on it, it wouldn’t make sense.Il y a 12 minutes ·
http://www.WeLocateRentals.com/ was a project that I started working on in August of 2010. It all began in my apartment complex. I happened to be in the complex office using their computers. I noticed that the guy next to me was having some Internet connectivity issues. So I offered to help him. He asked me what I did for a living and I said web development. That guy, Tim Hyatt, had mentioned that his uncle needed to build a website. His uncle has properties and land over in New Jersey and Philadelphia so he wanted a website to help him rent his own properties and that of his friends. So I took his uncle’s phone number and called it up. At that point, we did not have a clear and concise idea of how we would build the site or what features would be available. What we knew is that we wanted to post properties ONLINE and have people go there to see pictures.
From that idea, we began to develop it into a much bigger idea. Remember, always THINK BIG. Initially, my boss had the vision to build http://www.WeLocateRentals.com/ for the New Jersey area. He wanted it to be localized. I had brought it up to him that if were going to do it for the New Jersey area then why not do it for the other 49 remaining states? We could target it nationwide. That’s when the idea of “Franchisers” came up. We would still build the website to target local areas but we would set it up in a way that states could function as their own Franchisers. Basically, the idea was to build a search engine that would let people search properties nationwide as well as in specific areas of interest. Each state would work as it’s own Franchiser and each Franchiser would have a designated Agent. Pretty cool. So we have Agents for the state of Florida, New Jersey and Philadelphia. When someone posts a property for any of the aforementioned states, the Agents phone number shows up in the property profile. When a renter finds that property and calls it up, he/she goes through an Agent. That Agent then closes the deal between the landlord and the renter. We get to keep the 1st month’s rent for connecting the landlord with the renter.
We are working to offer more services for paid members. For example, landlords will able to run background checks right from http://www.WeLocateRentals.com/. Landlords will able to fill out lease forms, waivers, renewals and eviction forms right from their accounts. We plan to offer a way for renters to pay their rent dues from our website. There will be automatic e-mail reminders and late fee notices. If the renter needs to be evicted, we will have ONLINE eviction forms ready to be filled out by landlords. There will be a section for suggested lawyers as well. Landlords can also pay an additional fee to have their properties show in the Featured section for a certain period of time. More like Google does with paid links up top. For renters, everything is FREE. They can log in to their accounts and pay their rent dues ONLNE, see a history of all paid rent, due notices, save their preferred properties for later review or even contact landlords like they would in a social network environment. The interesting part of our website is how we let landlords upload their properties and how we let them administer it. They can build a database of properties by filling out a form. Landlords can then upload pictures or choose not too. If a property is rented out, they do not need to delete their property and re-do it again when it becomes available. They just need to check it off the searches. That way, they can enter all their properties and keep it for later exposure. On the landlords page, they can choose default picture and delete specific ones.
We also have plans to offer a section for Property Management people to upload their properties in bulks. Many property management businesses have rentals available. They usually advertise up front on the board.