Are you a candidate looking to sharpen your skills? Try our practice tests or view sample interview questions & Get hired by the best. Click Here×

Yii Online Skills Assessment Test

Topics Covered

  • Cookies
  • Sessions
  • Models
  • Controllers
  • Caching
  • Assets
  • Controllers
  • Installation

Useful for hiring

  • Yii Developer
  • PHP Web Developer
  • Full-Stack Web Developer

Start hiring job-fit candidates using this assessment


"Our recruiters no longer rely only on the telephonic interviews. We shortlist candidates based on assessment reports. The detailed test reports provide skill wise analysis of each candidate. This has helped our clients reduce their time to hire by 60%."

Vipin Sharma, Mobile Programming,
General Manager HR & Recruitement

Suppose you are using the CMemCache class for creating a cache of your YII application's data. How can you make your class use the memcache extension for the caching service?

    • Set the $useMemcache property to True.

    • Set the $extension property to "memcache".

    • Set the $extension property to "memcached".

    • Set the $useMemcached property to be false.


You stored the value of a variable $myVar in a cache for 45 seconds by implementing a caching technique using CCache class of the Yii framework. If this cache must be invalidated as soon as the "memData.php" file changes then, select the option that shows the correct implementation of the same.

    • Yii::app() -> cache -> set('var1', $myVar, 45, new CFileCacheDependency('memData.php'));

    • Yii::app() -> cache -> set('var1', $myVar, 45);
      Yii::app() -> cache -> setFileDependency('memData.php);

    • Yii::app() -> cache -> set('var1', $myVar, 45, setFileDependency('memData.php'));

    • Yii::app() -> cache -> set('var1' = $myVar, new);
      Yii::app() -> cache -> CFileCacheDependency('memData.php', validity = 45);


You have created a cache for your Yii application using the CCache class and stored a variable into it. You also set a dependency for the cache on a particular file. What will happen if you try to access (via get()) the cached variable after the dependency file gets modified?

    • The older value of the cache will be returned with a warning to reload the data.

    • The dependency and cache get automatically refreshed, and the new value of the variable is returned.

    • False boolean value is returned as the dependency data needs to be refreshed manually.

    • The actual value from the database will be retrieved as the cache becomes invalid.

Good News! You can customize this test as per your requirement

  • Choose and add questions from Interview Mocha question libraries

  • Add your own set of questions

  • Customize test settings like duration, number of questions, passing score, web proctoring and much more

  • Mail us at to create a custom test

Looking for a tailor-made test, to suit your assessment needs?

Get in touch

Global companies using Mocha assessments

  • altran
  • credit suisse
  • sephora
  • nielsen
  • capgemini
  • akamai

How Mocha assessments are brewed

Speed up your IT recruitment with Interview Mocha

  • 500+ IT skill tests
  • 20+ coding languages
  • 50+ domain knowledge tests
  • 100+ digital 2.0 skill tests
  • Customer focus aptitude tests
  • Enterprise ready features & more...

Why hiring managers and recruiters across the globe love Interview Mocha

Take your first step to hire job fit candidates