Skip to content

Instantly share code, notes, and snippets.

@MWins
Last active January 27, 2017 20:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save MWins/0602ca53c1428cd36454 to your computer and use it in GitHub Desktop.
Save MWins/0602ca53c1428cd36454 to your computer and use it in GitHub Desktop.
general-Dev Question

Questions asked by someone on reddit

  • deleted post because they didn't want to answer. Freebie work.

Question: You are committing a file with bug fixes to the SVN, there is an issue with a conflict in the file what does this mean? How do you solve it?

Means files being committed are in danger of being over written. http://svnbook.red-bean.com/en/1.7/svn.ref.svn.c.resolve.html

Question: How would you find out what files were out of date within SVN and commit those specific files into a revision with a log message via the command line?

Not sure if this is asking how to update working files or if it's a specific issue to SVN. Anyway, answer : use git :)

Question: How do you use memcached to optimize mysql queries?

Again, unclear question. memcached doesn't optimize queries, it optimizes the retrieval of specific queries.

Question: How do you iterate an array in smarty?

I don't use smarty but pretty sure google has this one : https://www.google.com/?gws_rd=ssl#q=+iterate+an+array+in+smarty

Question: PHP errors are not displaying on the page you are developing. You only have SFTP Access to change files. How do you display the errors?

Turn on error reporting and display errors.

Question: What is better and more efficient in development time for a large scale enterprise PHP / MySQL application. Using packages and open source classes or developing your own solutions?

Impossible to answer. In some cases it will make more sense to use composer based packages (most) and others developing your own will be practical.

Question: What are the risks of using user inputted data in SQL queries and how to eliminate this risk ?

They can input incorrect data. They can input malicious data. Prepared statements or sanitizing the data.

Question: You have been given a specification and been briefed on a project. The specification included work that was already completed for the project but there are many bugs and you did not write this code. What do you do?

Send it over to QA and tell them to log the errors. No QA? Fine, open up tickets for each bug.

Question: There is a bug in your code, what do you do?

Fix it ?

Question: Recently users are complaining they are being logged out of the site. The site uses sessions and php. Also recently a new webserver was added, bringing the total to 2. What could be causing this and how would it be solved?

Sessions aren't being shared. Switch to database based sessions or http://stackoverflow.com/questions/16243450/share-a-session-across-multiple-servers-with-different-domains

Question: You need to create a search function for a website with over 2.000 searches per second on a record set of 100.000.000 text records. How would you do this assuming data source is in MySQL?

Use SOLR ? http://lucene.apache.org/solr/

Question: You need to integrate an external website's data that does not have a API - describe this process.

Scrap the site for data. No I'm not describing it.

Question: You've written a news service in PHP that needs to used by many external websites. How would you allow those websites to use your functions to display the news on their site ?

Provide an API. Provide an RSS feed.

Question: You want to create an AJAX suggestion box that displays in real time suggestions related to the content of the search textfield. Describe how this process would work.

Search for a tutorial and paraphrase the code.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment