Live Classes: Upskill your knowledge Now!
Chat NowCreated by - Admin s
A list of top frequently asked Ruby on Rails interview questions and answers are given below.1) What is Ruby on Rails?Ruby on Rails is a server-side web application development framework written in Ruby language. It allows you to write less code than other languages and frameworks. It includes everything needed to create database-backed web applications according to MVC pattern.For more information: Click here2) Explain DRY in Rails?DRY stands for Don't Repeat Yourself. It is a principle of software development which states that "Every piece of knowledge must have an authoritative, unambiguous, single representation within a system. If the same part of the code will not repeat again and again, the code will be more maintainable, extensible and less buggy.Play VideoxFor more information: Click here3) What is the current version of Ruby on rails?Rails 5.0.1 was released on December 21, 2016. It introduced Action cable, Turbolinks 5 and API mode.4) Explain CoC in RailsDRY stands for Convention over Configuration. It provides different opinions on the best way to do many things in a web application.For more information: Click here5) Who developed Rails?Ruby on Rails was created by David Heinemeier Hansson (DHH).For more information: Click here6) What are the three methods to install Ruby on Rails?There are three methods to install Ruby on Rails:Using rbenv (recommended)Using rvmFrom sourceFor more information: Click here7) Name some Rails IDE or editor.Ruby on Rails can be used with either a simple text editor or with an IDE.Some of the Rails IDEs are listed below:TextMateEIntellij IDEANetBeansEclipseHerokuAptana StudioRubyMineKuso IDEKomodoRedcarArcadiaIce CoderFor more information: Click here8) What is Rails script? Name some of them?Rails provide some excellent tools that are used to develop a Rails application. These tools are packaged as scripts from command line.Following are the most useful Rails scripts used in Rails application:Rails ConsoleWEBrick Web ServerGeneratorsMigrationsFor more information: Click here9) Are there any disadvantages of Ruby on Rails? If yes, mention them.Some of the features that are not supported by Ruby on rails are:Linking to multiple databases.Inclusion of foreign keys in database.Establishing connection to various databases at a time.Web services related to Soap.10) What is the use of the super function in Ruby on Rails?The super function in Ruby is used to invoke the original method. It calls the superclass implementation of the current method.11) What is Active Record in Rails?A perfect ORM hides the details of a database's relational data behind the object hierarchy. In Rails, ORM is implemented by Active Record which is one of the most critical components of the Rails library.While using Active Record, you have to no longer deal with database constructs like tables, rows or columns. Your application only deals with classes, attributes, and objects.For more information: Click here12) Who designed Active Record in Rails?Active Record is based on a design pattern created by Martin Fowler. From this design pattern only, the Active Record got its name. Its code works very well even with less number of lines. It is quite easy to use. Active Record Rails application does not need any configuration at all if proper naming schemes are followed in your database and classes.For more information: Click here13) Explain model in Rails?The models are classes in Rails. This subsystem is implemented in ActiveRecord library. This library provides an interface between database tables and Ruby program code that manipulates database records.For more information: Click here14) Which command is used to create a migration?C:\ruby\application>ruby script/generate migration table_name 15) Explain the role of 'defined' operator. The 'defined' operator is used to check whether the expression passed has been defined or not. 16) What is the purpose of the super call? When we make a call to super, the parent method which has the same arguments as child one is invoked. 17) Write the syntax of each iterator. The syntax of each iterator is collection.each do|vairable| code end 18) What are the hashes?A hash is a collection of key-value pairs.19) How are blocks created?The syntax for creation of block is:block_name { ??. ?? } 20) What is the naming convention for variables?The name of the variable is given in the lower case, and an underscore separates the different words within the name.21) What is the main difference between procs and blocks?Procs are objects whereas Blocks are a part of the code.22) The string can be represented in single as well as double quotes. What is the difference between the two?The single quote string representation is not allowed to perform string interpolation and process the ASCII escape codes.23) Explain rails migration.With the help of rails migration, Ruby can make changes to the database schema.24) How would you create a controller for the subject?You have to use the following command to create a controller for subject:C:\ruby\library> ruby script/generate controller subject 25) Explain view in Rails?View represent data in a particular format in an application for the users. This subsystem is implemented in ActionView library. This library is an Embedded Ruby (Erb) based system which define presentation templates for data presentation.For more information: Click here26) Explain the controller in Rails?The Controller directs traffic to views and models. This subsystem is implemented in ActionController library. This library is a data broker sitting between ActiveRecord and ActionView.For more information: Click here27) Explain RVM in Rails?RVM stands for Ruby Version Manager. It is a command line tool which allows you to install, manage and work with different Ruby environments efficiently. With RVM, you can easily install different versions of Ruby and quickly switch between them.Syntax:The basic syntax of RVM is,rvm command_options command ruby_to_act_on For more information: Click here28) What are Gemsets in Rails?Gems in Ruby are used to extend capabilities of core Ruby distribution. They add specific functionalities in programs. Some gems are also installed with Ruby installation to provide specific environments are called gemsets. You can have different versions of the same gem installed in a system.To know all the gems available in Ruby, use the following command:rvm gemset list For more information: Click here29) Write the command to update RVM in Rails.To upgrade RVM, use the following command:rvm et head For more information: Click here30) Explain bundler in Rails.Rails bundler provides a constant environment for applications by tracking suitable gems that are needed.To use bundler, use the following command:gem install bundler For more information: Click here31) Why we use migration in Rails?Migration alters the database schema for an application in a consistent and organized manner by using DSL.Syntax to create a migration file:application_dir> rails generate migration table_name For more information: Click here32) Write the command to run the migration.rake db:migrate For more information: Click here33) How does router work in Rails?The Rails router recognizes URLs and dispatches them to a controller's action. It also generates paths and URLs. Rails router deals with URLs differently from other language routers. It determines controller, parameters, and action for the request.Main purpose of Rails routers is:Connecting URLs to codeGenerating paths and URLs from codeFor more information: Click here34) Explain REST in Rails routes.REST is very beneficial to understand routes in Rails. It stands for Representational State Transfer. Several HTTP methods are used with REST to represent the types of actions performed by the user or application.For more information: Click here35) Explain some features of nested scaffolding.The Nested scaffold is the command that generates a set of correctly working nested resource for Rails 4.2 and 5.FeaturesGenerates a nested child resource with a single commandGenerates a beautifully working bunch of codeAutomatically generates appropriate model associations for ActiveRecordHaml readyFor more information: Click here36) In how many ways you can create Rails layout HTTP response.There are three ways to create an HTTP response from the controller's point of view:Call render to create a full response to send back to the browserCall redirect_to to send an HTTP redirect status code to the browserCall head to create a response to end back to the browserFor more information: Click here37) Explain the importance of yield statement in Rails.The yield statement in Rails decides where to render the content for the action in the layout. If there is no yield statement in the layout, the layout file itself will be rendered, but additional content into the action templates will not be correctly placed within the layout.For more information: Click here38) How many filters are there in Rails.Rails filters are methods that run before or after a controller's action method is executed. Rails support three types of filter methods:Before filtersAfter filtersAround filtersFor more information: Click here39) How can you protect filter methods in Rails?All the Ruby methods have at least one of these protection level.Public: These methods are accessible from any external class or method that uses the same class in which they are defined.Protected: These methods are accessible only within the class in which they are defined and in the classes that inherit from the class in which they are defined.Private: These methods are only accessible within the class in which they are defined.For more information: Click here40) Explain testing in Rails.Rails also use a separate database for testing. Rails use Ruby Test::A unit testing library. Rails application test is usually run using Rake utility.Rails support three types of tests:functionalintegrationunit testsFor more information: Click here41) Explain Rails caching levels.Rails caching is available at three levels of granularity:PageActionFragmentFor more information: Click here42) What are Rails validation used for?Rails validation defines valid states for each of your Active Record model classes. They are used to ensure that only valid details are entered into your database.For more information: Click here43) Explain valid and invalid in Rails?The valid? triggers your validations and returns true if no errors are found otherwise, false.The invalid? is simply the reverse of valid?. It triggers your validations and returns true if invalid otherwise, false.For more information: Click here44) Explain Unobtrusive JavaScript in Rails."Unobtrusive JavaScript" technique is considered as the best technique within the frontend community.For more information: Click here45) What is the Symbol Garbage Collector?Passing symbols opens the possibility of several attacks in your system. The symbol garbage collector collects the symbols which prevent your system from several attacks.46) What is Action Cable?It is a framework which is used to extend Rails via WebSockets to add some functionality. It integrates WebSockets with the rest of the Rails application very smoothly. It allows you to add some real-time features to your app quickly.47) Explain the various IDE's of ruby on rails.TextMate:The TextMate is mainly used for the Mac operating system. It allows you to write extensions to the base environment. The extensions plug into TextMate to add new features to the base editor. These extensions are called Bundles.E:The E-text editor is built just like TextMate editor to work on Windows. It replicates many features of the TextMate and even allows to use the TextMate bundles.IntelliJ IDEA:The IntelliJ IDEA is a commercial IDE made of JetBrains. Earlier, it was also used for Java development. JetBrains version 7.0 has added Rails support to the IntelliJ IDEA.NetBeans:The NetBeans is an IDE from Sun. Earlier, it was used for Java development. Sun version 7.0 has added Rails support to the NetBeans.Eclipse:The Eclipse IDE is the most commonly used IDE today. Using a plug-in RadRails, you can add Rails support entirely to the Eclipse environment.Heroku:The Heroku IDE provides a new and unique way of writing Rails application. It is used entirely online to develop applications. You do not need to install any software on your system to use Heroku. It does not support Internet Explorer.Aptana Studio:A product from Aptana is a stand-alone desktop IDE based on Eclipse project. It is quite similar to Eclipse. The Rails features are packaged as a plug-in to the Aptana Studio environment.RubyMine:The RubyMine IDE is a preferable choice for Rubyists. It provides many extra features than other IDEs. One feature it includes clicks and follows. When you click on a function, it will take you to the function being called. This feature comes in handy when multiple functions share the same name and reside in different files and folder. The other features are Git annotate and Git compare.48) What is the rail console?The Rails console is a command line utility which runs Rails application from the command line. The Rails console is an extension of Ruby IRB. It provides all the features of IRB along with the ability to auto-load Rails application environment, including all its classes and components. It helps you to walk through your application step-by-step.49) What are generators in ruby on rails?The rails include code generator scripts, which are used to generate model and controller classes for an application automatically. Code generation increases your productivity when developing web applications. By running generator command, skeleton files for all your model and controller classes will be generated. It also generates database migration files for each model it generates.50) What is a webrick web server?Rails are configured to use WEBrick server automatically. This server is written in pure Ruby and supports almost all platforms like Windows, Mac or Unix. Alternatively, if you have Mongrel or Lighttpd server installed in your system, Rails uses either of those servers.All the three Rails servers feature automatic reloading of code. It means, when you change your source code, you do not need to restart the server.
More detailsPublished - Tue, 06 Dec 2022
Created by - Admin s
There is given Pascal interview questions and answers that has been asked in many companies. Let's see the list of top Pascal interview questions.1) Explain Pascal.Pascal is an imperative and procedural programming language. It was developed in 1970 by Niklaus Wirth. It follows the basics of structured programming and data structuring.2) Why Pascal is named as Pascal?The name Pascal was given in honor of the French mathematician, philosopher and physicist Blaise Pascal.3) Who was the developer of Pascal language?Pascal is designed by Niklaus Wirth.151A Good Phone Lost in 5G Hype!4) Which was the most influential language in Pascal development?Pascal was mainly influenced by ALGOL W language.5) Which languages are influenced by Pascal most?Pascal influenced the following languages:Ada, Component Pascal, Go, Java, Modula, Oberon etc.6) What are some distinguish features of Pascal?Following are some specific features of Pascal:Structured programming language that uses control structures like if-else, repeat-until statement.Provide simplicity and modular approach for machine implementation.Having different data structures that are included with the records, arrays, files, pointers, etc.Offer extensive error checking.Support object oriented programming.7) Why is it named Pascal?It is named in the honor of a great French mathematician and philosopher Blaise Pascal.8) How do you describe a Pascal set?A collection of same type of elements is called a set. The elements in the set are called members. In Pascal, elements are enclosed in square bracket [].9) What is a datatype? What are the different data types included in Pascal?A datatype specifies a range of values that a variable can store. It also includes the set of operations that are performed on different datatypes.Following are the different datatypes in Pascal:ScalarPointerStructuredImage: Pascal-datatype10) What is pointer in Pascal?In Pascal, a pointer is a dynamic variable which specifies the value of another variable. You must declare a pointer before you use it to store any variable address.11) What are different Pointer concepts in Pascal programming?Following is a list of some important pointer concepts used in Pascal programming:Arithmetic pointers: It specifies four arithmetic operators that can be used on pointers i.e. increment, decrement, +, -Array of Pointers: An array can be defined to hold a number of pointers.Pointer to pointer: Pascal facilitates you to use pointer on a pointer and so on.Return a subprograms in Pascal: Pascal facilitates a subprogram to return a pointer.12) What is IP Pascal?IP Pascal stands for Interplatform Pascal. It supports the following platform in its current configuration:Windows /95/98/ME/NT/2000/XP.Linux/86.13) What is unit in Pascal?Modules of Pascal programs are referred as units. A module or unit contains some code blocks, which contain variables and type declarations, statement procedures etc. There are many built-in units in Pascal.14) What is the reason behind using UNITS in Pascal programming?There are three reasons to use UNITS in programming:Simplicity: It simplifies the use of same code in some other programs to do the same job.Easy to handle: It makes handling easy because some large programs are split into smaller section.Easy to call: Putting codes in UNIT, makes it easy to call and use it again.15) What are the different Pascal standards?The first Pascal standard was documented by the author of the Pascal programming language Niklaus Wirth but it was an unofficial Pascal standard.The first official standard was ISO 7185 issued in 1983. It was followed by the extended standard ISO 10206 in 1990. Another standard Object-Oriented Extension to Pascal was introduced but never completed due to lack of interest.16) What is constant in Pascal? What constants are declared in Pascal?An entity which doesn't change is called constant. It remains unchanged during program execution. Following constants are declared in Pascal:Ordinal typesSet typesPointer types (Only nil value is allowed).Real typesCharString17) Write syntax to declare constants in Pascal.Syntax:const identifier = constant_value; 18) What are the REPORT methods for which the portability is given in Pascal?There are two REPORT methods for portability:Application: It contains a guideline which facilitates you to use implementation and features according to the compiler, to make the application more portable.Compiler: It is used to implement the language that is likely to implement the features like determining of the types compatible with one another.19) How can you define a string in Pascal?A string can be defined in many ways:As a string variablesAs a short stringsAs a character arraysAs a null terminated stringsAs a ansiStrings20) What is the control structure used in Pascal?Pascal uses structure programming language to display the flow of control in a structured manner.Pascal uses the goto statement as a standard statement that allows the control to be given to the main program in a recursive manner.Pascal provides more easy way to represent them without using the semicolon to end the statements written in one line.Pascal uses loops as a control structure to represent the statements and uses assignment operators to assign the values to the variables.21) What is the usage of Extension in Pascal?Extension makes the program more clean and portable to use by providing the interfaces to be used in programs.22) Is Pascal designed to be a teaching language?OrWhy Pascal is called teaching language?It is often said that Pascal is a toy language and not to built for real-world programming. Check, what the father of Python Niklaus Wirth said:"Occasionally, it has been claimed that Pascal was designed as a language for teaching. Although it is correct, its use in teaching was not the only goal. In fact, I don't believe in using tools and formalisms in teaching that are inadequate for any practical task." - Niklaus Wirth from the 1984 ACM A.M. Turing award lecture23) What is the difference between apple Pascal and UCSD Pascal?UCSD Pascal: UCSD Pascal is a Pascal programming language system, run on UCSD p-system a portable, highlymachine-independent operating system.Apple Pascal:Apple Pascal is a language and operating system based on the UCSD Pascal system.24) What is the difference between Turbo and Standard Pascal?The Turbo Pascal uses dynamic variables and pointers to show the standard procedures like new, mark and release. Whereas, standard Pascal doesn't use dynamic variables and uses procedures like new and dispose.Turbo Pascal is more efficient, faster and doesn't require the support code that offers the compatibility factor. Whereas, Standard Pascal doesn't, accept the record specifications for their standard procedures.Turbo Pascal is using the local variables that are handled in the recursion phase and it also passes the recursive calls to others. Whereas, Standard Pascal doesn't, make use of recursion for their subprograms.Turbo Pascal doesn't use the Get and Put methods but instead of that there is a use of Read and write procedures that extend the functionality of the I/O methods. Whereas, it supports the use of get and put methods.Turbo Pascal doesn't implement the standard page procedure as the operating system doesn't define the form-feed character.25) What is the difference between Modern Pascal and Standard Pascal?Standard Pascal is less secure and more ambiguous while programming or coding. Whereas, Modern Pascal provides more securities and fewer ambiguities while programming or coding.Modern Pascal provides backward compatibility by the use of functions and procedures with their parameters. Whereas, standard Pascal doesn't provide this kind approach and doesn't follow the backward compatibility.Modern Pascal provides Var parameters to be used with the procedures and functions and make advancement over the standard Pascal.Modern Pascal provides the definitive type of compatibility with its parameters and the symbols used. Whereas, standard Pascal doesn't provide anything related to the symbols.Modern Pascal allows the removal of the length of the symbol that is limited. Whereas, standard Pascal doesn't remove the symbol length limit.26) What are the different insecurities involved in Pascal?Following are the main insecurities involved in Pascal:Infinite loop: This is an area that makes the program to run for a longer period of time and it becomes hard to control and terminate it.Insecure variants: the variants used should be able to change the pointer to an integer or vise versa this can create errors when writing big programs.27) Is there any Freeware Pascal compiler?Yes. One of the most recent and active freeware Pascal compilers is FPK Pascal. It is a 32 bit Turbo Pascal compatible compiler system for DOS and OS/2.28) What is the Pascal compiler used on HPCVL machines?The Pascal compiler installed on the Sun Fire system of HPCVL is the Gnu Pascal Compiler (GPC). It is a public-domain compiler that has a great deal of extensions and compatibility features built within it. It is portable.
More detailsPublished - Tue, 06 Dec 2022
Created by - Admin s
A list of top frequently asked Memcached interview questions and answers are given below.1) What is Memcached?Memcached is a general-purpose free and open source, high performance, distributed memory object caching system. It is used to speed up database-driven websites by caching data and objects in RAM.In simple words, you can say that Memcached is a component which stores data temporally for 1hour/ 6 hour/ 12 hours/ 1 day, etc. and you can integrate this component with your applications to increase their performance.2) In which language Memcached is written and who is the author?Memcached is written in "C language". It was developed by Brad Fitzpatrick in 2003. Initially, it is developed for LiveJournal, but now it is used by Wikipedia, Twitter, Facebook, Flickr, Netlog, YouTube, etc.Play Videox3) How Memcached works?See the following steps to understand how Memcached works:Memcached first tries to get the detail of the user, and the browser sends the request to the application.An application calls the Memcached for a particular user.If Result found in Memcached, Return the result from Memcached.If Result Not found in Memcached, Application sends the request to the database and save the result in Memcached.Each Memcached have one unique key.Get/Set the data work on behalf of the key.You can also delete one or more keys.You can also assign tags to one/more keys.4) When was the first version of Memcached launched?The first version of Memcached was launched on May 22, 2003.5) What is the usage of Memcached? In which types of websites, it is generally used?Memcached is used to increase the speed of dynamic database driven websites. It caches data and objects in RAM to reduce the execution time.It is generally used:In social networking sites for profile caching.For content aggregation i.e. HTML/Page caching.In E-commerce websites for Session and HTML caching.In location-based services for database query scaling.In gaming and entertainment services for session caching.It can also be used to track cookie/ profile for ad targeting.6) What is the best usage of Memcached?Best usage of Memcached:It is easy to install in Windows as well as in the UNIX operating system.It provides API integration for all the major languages like Java, PHP, C/C++, Python, Ruby, Perl, etc.It enhances the performance of web application by caching.It reduces the burden of the database server.It facilitates you to delete one or more values.It facilitates you to update the values of keys.7) What are the drawbacks/ limitations of Memcached?A list of the limitations or drawbacks of Memcached:Memcached cannot store data persistently and permanently.Memcached is not a database. It stores only temporary data.Memcached cannot cache large objects.Memcached is not application specific.Memcached is not fault-tolerant or highly available.8) In which conditions cache cannot retain the stored information?The cache cannot retain the stored information in following conditions:When the allocated memory for the cache is exhausted.When an item from the cache is deleted.When an individual item in the cache is expired.9) What is the difference between Memcache and Memcached?Difference between Memcache and Memcached:Table:MemcacheMemcachedMemcache module provides handy procedural and object-oriented interface to Memcached.Memcached is a high-performance, distributed memory object caching system.Memcache is an extension that allows you to work through handy object-oriented (OOP's) and procedural interfaces.Memcached is an extension that uses the libMemcached library to provide API for communicating with Memcached servers.The Memcache module provides a session handler (Memcache).The Memcached provides a session handler (Memcached).It is designed to reduce database load in dynamic web applications.It is used to increase the dynamic web applications by reducing database load. It is the latest API.10) Can we share a single instance of Memcache between multiple projects?Yes, we can share a single instance of Memcache between multiple projects because being a memory storage space, Memcache can be run on one or more servers. In Memcache, you can also configure your client to speak to a particular set of instances.We can also run two different Memcache processes on the same host being completely independent and without any interference. If you partition your data, it is important to know from which instance to get the data from or to put into.11) Explain the differences between SAP HANA and Memcached?SAP HANA is an in-memory RDBMS and mostly used for accelerating SAP applications while Memcached is a key/value caching system and used for accessing both RDBMS and NoSQL databases.12) How to connect Memcached server with telnet command?By using telnet hostname portNumber command, you can connect Memcached server with telnet command.Syntax$telnet HOST PORT ExampleThe given example shows that how to connect to a Memcached server and execute a simple set and get command. Let's assume that the server of Memcached is running on host 127.0.0.1 and port 11211.$telnet 127.0.0.1 11211 Trying 127.0.0.1... Connected to 127.0.0.1. Escape character is '^]'. // store data and get that data from server set javatpoint 0 900 9 memcached STORED get javatpoint VALUE javatpoint 0 9 memcached END 13) How to get the value of key?By using the get command, you can get the value of the key.Syntaxget key ExampleIn the given example, we use javatpoint as the key and store Memcached in it with an expiration time of 900 seconds.import net.spy.memcached.MemcachedClient; public class MemcachedJava { public static void main(String[] args) { // Connecting to Memcached server on localhost MemcachedClient mcc = new MemcachedClient(new InetSocketAddress("127.0.0.1", 11211)); System.out.println("Connection to server sucessfully"); System.out.println("set status:"+mcc.set("javatpoint", 900, "memcached").done); // Get value from cache System.out.println("Get from Cache:"+mcc.get("javatpoint")); } } 14) How to set the value of key?By using set command, you can set the value of the key.Syntaxset key flags exptime bytes [noreply] value ExampleIn the given example, we use javatpoint as the key and set value Memcached in it with an expiration time of 900 seconds.set javatpoint 0 900 9 memcached STORED get javatpoint VALUE javatpoint 0 9 Memcached END 15) How to add value in the key?By using add command, you can add value in the key.Syntaxadd key flags exptime bytes [noreply] value ExampleIn the given example, we use "key" as the key and add the value Memcached in it with 900 seconds expiration time.add key 0 900 9 memcached STORED get key VALUE key 0 9 Memcached END 16) How to replace the value of the key?By using replace command, you can replace the value of the key.Syntaxreplace key flags exptime bytes [noreply] value ExampleIn the given example, we use "key" as the key and add the value Memcached in it with 900 seconds expiration time. After this, the same key is replaced with the "redis".add key 0 900 9 memcached STORED get key VALUE key 0 9 memcached END replace key 0 900 5 redis get key VALUE key 0 5 redis END 17) How to append the value of the key?By using append command, you can append the value of the key.Syntaxappend key flags exptime bytes [noreply] value ExampleIn the given example, we are trying to add some data in a key that does not exist. Hence, NOT_STORED is returned by Memcached. After this, we set one key and append data into it.append javatpoint 0 900 5 redis NOT_STORED set javatpoint 0 900 9 memcached STORED get javatpoint VALUE javatpoint 0 14 memcached END append javatpoint 0 900 5 redis STORED get javatpoint VALUE javatpoint 0 14 memcachedredis END 18) How to prepend value of key?By using prepend command, you can prepend value of the key.Syntaxprepend key flags exptime bytes [noreply] value ExampleIn the given example, we are trying to add some data in a key that does not exist. Hence, NOT_STORED is returned by Memcached. After this, we set one key and prepend data into it.prepend tutorials 0 900 5 redis NOT_STORED set tutorials 0 900 9 memcached STORED get tutorials VALUE tutorials 0 14 memcached END prepend tutorials 0 900 5 redis STORED get tutorials VALUE tutorials 0 14 redismemcached END 19) How to delete the key?By using delete command, you can delete the key.Syntaxdelete key [noreply] ExampleIn the given example, we use javatpoint as a key and add the value Memcached in it with 900 seconds expiration time. After this, it deletes the stored key.set javatpoint 0 900 9 memcached STORED get javatpoint VALUE javatpoint 0 9 memcached END delete javatpoint DELETED get javatpoint END delete javatpoint NOT_FOUND 20) How to show the stats?By using stats command, you can show the stats.Syntaxstats Examplestats STAT pid 1162 STAT uptime 5022 STAT time 1415208270 STAT version 1.4.14 STAT libevent 2.0.19-stable STAT pointer_size 64 STAT rusage_user 0.096006 STAT rusage_system 0.152009 STAT curr_connections 5 STAT total_connections 6 STAT connection_structures 6 STAT reserved_fds 20 STAT cmd_get 6 STAT cmd_set 4 STAT cmd_flush 0 STAT cmd_touch 0 STAT get_hits 4 STAT get_misses 2 STAT delete_misses 1 STAT delete_hits 1 STAT incr_misses 2 STAT incr_hits 1 STAT decr_misses 0 STAT decr_hits 1 STAT cas_misses 0 STAT cas_hits 0 STAT cas_badval 0 STAT touch_hits 0 STAT touch_misses 0 STAT auth_cmds 0 STAT auth_errors 0 STAT bytes_read 262 STAT bytes_written 313 STAT limit_maxbytes 67108864 STAT accepting_conns 1 STAT listen_disabled_num 0 STAT threads 4 STAT conn_yields 0 STAT hash_power_level 16 STAT hash_bytes 524288 STAT hash_is_expanding 0 STAT expired_unfetched 1 STAT evicted_unfetched 0 STAT bytes 142 STAT curr_items 2 STAT total_items 6 STAT evictions 0 STAT reclaimed 1 END 21) How to get the versions?By using Version command, you can get the versions.22) How to close the connection?By using the Quit command, you can close the connection.23) How would you update Memcached when data changes?There are two methods to update Memchached when data changes:By clearing the cache proactively: You can update Memcached by clearing the cache while insertion or updation is made.By resetting the cache: It is slightly similar to the first method, but it doesn't delete the keys and wait for the next request for the data to refresh the cache, it resets the values after the insert or update.24) What is Dogpile effect? How can you prevent this effect?If the cache expires, and websites are hit by multiple requests made by the client at the same time, this effect is known as Dogpile effect.This effect can be prevented by using a semaphore lock. In this system when value expires, the first process acquires the lock and starts generating new value.25) What happens to the data stored in Memcached when server accidentally gets shut down?In Memcached, data is not permanently stored. It is not a durable data so, if the server is shut down or restarted, all the data stored in Memcached will be deleted.26) If you have multiple Memcache servers and one of the Memcache servers fails which has your data, will it ever try to get key data from that one failed server?The data in the failed server won't get removed, but there is a provision for auto-failure, which can be configured for multiple nodes. Fail-over can be triggered during any socket or Memcached server level errors and not during normal client errors like adding an existing key, etc.27) How can you minimize the Memcached server outages?Following are the methods to minimize the Memcached server outage:When one instance fails, several of them go down, this situation will put larger load on the database server when the client reloaded the lost data. To avoid this, you should write your code to minimize cache stampedes, and it will leave a comparatively less impact.You can bring up an instance of Memcached on a new machine using the lost machines IP address.The Code is another option to minimize server outages as it gives you the liberty to change the Memcached server list with minimal work.Setting timeout value is another option that some Memcached clients implement for Memcached server outage. When your Memcached server goes down, the client will keep trying to send a request till the time-out limit is reached.
More detailsPublished - Tue, 06 Dec 2022
Created by - Admin s
A list of top frequently asked Go Programming interview questions and answers are given below.1) What is Go programming language?GO is an open source programming language developed at Google. It is also known as Golang. This language is designed primarily for system programming.2) Why should one use Go programming language?Because Go is an open source programming language so, it is very easy to build simple, reliable and efficient software.3) Who is known as the father of Go programming language?Go programming language is designed by Robert Griesemer, Rob Pike, and Ken Thompson. It is developed at Google Inc. in 2009.Play Videox4) What are packages in Go program?Go programs are made up of packages. The program starts running in package main. This program is using the packages with import paths "fmt" and "math/rand".5) Does Go support generic programming?Go programming language doesn't provide support for generic programming.6) Is Go a case sensitive language?Yes! Go is a case sensitive programming language.7) What is a string literal in Go programming?A string literals specifies a string constant that is obtained from concatenating a sequence of characters.There are two types of string literals:Raw string literals: The value of raw string literals are character sequence between back quotes ". Its value is specified as a string literal that composed of the uninterrupted character between quotes.Interpreted string literals: It is shown between double quotes " ". The value of the literal is specified as text between the double quotes which may not contain newlines.8) What is workspace in Go?A workspace contains Go code. A workspace is a directory hierarchy with three directories at its root."src" directory contains GO source files organized into packages."pkg" directory contains package objects."bin" directory contains executable commands9) What is the default value of type bool in Go programming?"false" is the default value of type "bool".10) What is GOPATH environment variable in go programming?The GOPATH environment variable specifies the location of the workspace. You must have to set this environment variable while developing Go code.11) What are the advantages/ benefits of Go programming language?Advantages/ Benefits of Go programming language:Go is fast and compiles very quickly.It supports concurrency at the language level.It has Garbage collection.It supports various safety features and CSP-style concurrent programming features.Strings and Maps are built into the language.Functions are first class objects in this language.12) What are the several built-in supports in Go?A list of built-in supports in Go:Container: container/list,container/heapWeb Server: net/httpCryptography: Crypto/md5 ,crypto/sha1Compression: compress/ gzipDatabase: database/sql13) What is goroutine in Go programming language?A goroutine is a function which usually runs concurrently with other functions. If you want to stop goroutine, you pass a signal channel to the goroutine, that signal channel pushes a value into when you want the goroutine to stop.The goroutine polls that channel regularly as soon as it detects a signal, it quits.Quit : = make (chan bool) go func ( ) { for { select { case For example:'line 1 line 2 line 3 ' 15) What is the usage of break statement in Go programming language?The break statement is used to terminate the for loop or switch statement and transfer execution to the statement immediately following the for loop or switch.16) What is the usage of continue statement in Go programming language?The continue statement facilitates the loop to skip the remainder of its body and immediately retest its condition prior to reiterating.17) What is the usage of goto statement in Go programming language?The goto statement is used to transfer control to the labeled statement.18) Explain the syntax for 'for' loop.The syntax of a for loop in Go programming language is:for [condition | ( init; condition; increment ) | Range] { statement(s); } 19) Write the syntax to create a function in Go programming language?Syntax to create a function in Go:func function_name( [parameter list] ) [return_types] { body of the function } 20) Explain static type declaration of variable in Go programming language?Static type variable declaration is used to provide assurance to the compiler that there is one variable in the given type and name so that there is no need for compiler to know complete detail about the variable for further processing. A variable declaration has its meaning at the time of compilation only, compiler needs actual variable declaration at the time of linking of the program.21) Explain dynamic type declaration of a variable in Go programming language?A dynamic type variable declaration needs a compiler to interpret the type of variable according to the value passed to it. Compilers don't need a variable to have type statically as a necessary requirement.22) How would you print type of variable in Go?You have to use the following code to print the type of a variable:var a, b, c = 3, 4, "foo" fmt.Printf("a is of type %T\n", a) 23) What is a pointer in Go?A pointer is used to hold the address of a variable.For example: var x = 5 var p *int p = &x fmt.Printf("x = %d", *p) Here x can be accessed by *p.24) How a pointer is represented in Go?In Go, a pointer is represented by using the *(asterisk) character followed by the type of the stored value.25) Is it true that short variable declaration := can be used only inside a function?Yes. A short variable declaration := can be used only inside a function.26) How can you format a string without printing?You should the following command to format a string without printing:return fmt.Sprintf ("at %v, %s" , e.When , e.What )27) What is Syntax like in Go programming language?The GO programming language syntax is specified using Extended Backus-Naur Form (EBNF):Production = production_name "=" [ Expression ]Expression = Alternative { "l" Alternative }Alternative = Term { Term }Term = Production_name l token [ "?"token] l Group l Option l RepetitionGroup = " ( "" Expression")"Option = " [ " Expression "" ]"Repetition = " {" Expression "}"28) Does Go programming language support type inheritance?Go programming language doesn't provide support for type inheritance.29) Does Go programming language support operator overloading?Go programming language doesn't provide support for operator overloading.30) Does Go support method overloading?Go programming language doesn't provide support for method overloading.31) Does Go support pointer arithmetics?Go programming language doesn't provide support for pointer arithmetic.32) What will be the output of the following code?package main import "fmt" const ( i = 7 j k ) func main() { fmt.Println(i, j, k) } Ans:777 33) What is Go Interfaces?In GO, interfaces is a way to identify the behavior of an object. An interface is created by using the "type" word, followed by a name and the keyword interface. An interface is specified as two things.A set of methods.Also it is referred as type.34) What is Type assertion in Go? What does it do?A type assertion takes an interface value and retrieves from it a value of the specified explicit type.Type conversion is used to convert dissimilar types in GO.35) What are the different methods in Go programming language?In Go programming language there are several different types of functions called methods. In method declaration syntax, a "receiver" is used to to represent the container of the function. This receiver can be used to call function using "." operator.36) What is the default value of a local variable in Go?The default value of a local variable is as its corresponding 0 value.37) What is default value of a global variable in Go?The default value of a local variable is as its corresponding 0 value.38) What is the default value of a pointer variable in Go?In Go programming language, the pointer is initialized to nil.39) How can you check a variable type at runtime in Go programming language?In Go programming language, there is a special type of switch dedicated to check variable type at runtime. This switch is referred as type switch.40) Is it recommended to use Global Variables in a program that implements go routines?Global variables are not recommended because they may get accessed by multiple go routines (threads) concurrently and this can easily lead to an unexpected behavior causing arbitrary results.41) What do you know about modular programming?Modular programming is a way to divide the program in to sub programs (modules / function) to achieve maximum efficiency.More generic functions definition facilitates you to re-use the functions, such as built-in library functions.
More detailsPublished - Tue, 06 Dec 2022
Created by - Admin s
OpenStack Interview QuestionsA list of top frequently asked OpenStack interview questions and answers are given below.1) Explain OpenStack.OpenStack is an open source and free set of software tools or cloud computing platform which is used for managing and building cloud computing platform for private and public cloud.OpenStack is referred as the future of Cloud Computing.2) What are the modular architectural components of OpenStack?Following is a list of OpenStack modular architectural components:69.1M1.1KHello Java Program for BeginnersDashboardComputeNetworkingObject StorageBlock StorageIdentity serviceImage ServiceTelemetryOrchestrationDatabase Service etc.3) What are the advantages/benefits of using OpenStack?Advantages/Benefits of using OpenStack:OpenStack can be used to develop any software as a service (SAAS) applications, for new developments or to improve existing solutions.It can be used as a strong foundation to deliver self-service storage to IT users.It provides easy to handle storage at lower costs.It can deliver on-demand objective or block storage with higher scalability.An enterprise can save a lot of licensing fees by switching virtual machines running on VMware to OpenStack.4) What is "role" and "tenant" in OpenStack?role: It specifies the authorization level of the user.Tenant: It specifies a group of users.5) What are the storage types allowed by OpenStack compute?OpenStack supports two types of storage:1. Persistent Storage or volume storage2. Ephemeral StoragePersistent Storage / Volume Storage: It is persistent and independent of any particular instance. This storage is created by users. There are three types of persistent storage:Object storage: It is used to access binary objects through the REST API.Block storage: It offers access-to-block storage devices by affixing volumes their current VM instances.Shared File System storage: It provides a set of services to manage multiple files together for storage and exchange with multiple users at one time.Ephemeral Storage: The ephemeral storage specifies a single instance. It is a temporary and short-lived storage that is disappeared once the VM is terminated.6) What is hypervisor? Which type of hypervisors are supported in OpenStack?Hypervisor is a software or hardware tool which is used to create and run a virtual machine. OpenStack supports a variety of hypervisors like VMware, Citrix, and Microsoft etc.7) Which is the most important identity service in OpenStack?Keystone is the most important and preferred Identity Service in OpenStack. It executes the complete OpenStack Identity API.8) What are the different networking options used in OpenStack?The networking options used in Open Stack are:Flat DHCP Network Manager: It is used to fetch IP addresses from the subnet for VM instances but IP addresses to VM are assigned via DHCP (Dynamic Host Configuration Protocol).Flat Network Manager: It is used to fetch IP addresses from the subnet for VM instances, and then injected into the image on launch.VLAN Network Manager: : VLAN provides more secure and separate network to VMs. It has a physical switch to offer separate virtual network and separate IP range and bridge for each tenant. It is more preferable choice.9) Which commands are used to pause and un-pause (resume) an instance?For Pausing: $nova pause INSTANCE_NAMEFor Un-pausing: $novaunpause INSTANCE_NAME10) Where the OpenStack images are stored?Glance is the image manager for OpenStack. So OpneStack images are stored in:Default: /var/lib/glance/images/ 11) What is Token in OpenStack?Token is a type of authentication like password-based validation. It is generated when the user inserts the credential and authenticate as a keystone user then Tokens can be used to access OpenStack services without any revalidation.12) How can you create a Token?Users first need to authenticate their Keystone credentials to create a token.13) Explain is OpenStack Python SDK?Python SDK (Software Development Kit) is used to help users to write applications for performing automation tasks in Python by calling Python objects.It provides a platform to work with multiple OpenStack services at one place.14) Explain is the role of API server in OpenStack?In OpenStack, an API server provides an interface for the external world to interact with the cloud infrastructure.15) What are the commands used to generate key pairs in OpenStack?Commands used to generate key pairs in OpenStack:ssh-keygencd.sshnova keypair-add -pub_key id_rsa.pub mykey16) Which hardware is required for networking in OpenStack?In OpenStack,networking can be done with following hardware:NetworksRoutersSubnetsPortsVendor Plugins17) Which command is used to manage floating IP addresses in OpenStack?nova floating-ip-*18) Explain the usage of Cinder in OpenStack?OpenStack Cinder is used to handle block storage in the context of OpenStack.19) What is the use of $ nova floating-ip-pool-list command in OpenStack?The $ nova floating-ip-pool-list command is used to list IP address information in OpenStack.20) Explain the term "flavor" in OpenStack?The term "flavor" is an available hardware configuration for a server, which defines the size of a virtual server that can be launched.
More detailsPublished - Tue, 06 Dec 2022
Created by - Admin s
1) What is Scala?Scala is a general-purpose programming language. It supports object-oriented, functional and imperative programming approaches. It is a strong static type language. In Scala, everything is an object whether it is a function or a number. It was designed by Martin Odersky in 2004.Scala Program Exampleobject MainObject{ def main(args:Array[String]){ print("Hello Scala") } } For more information: Click here.2) What are the features of Scala?There are following features in Scala:Type inference: In Scala, you don't require to mention data type and function return type explicitly.Singleton object: Scala uses a singleton object, which is essentially class with only one object in the source file.Immutability: Scala uses immutability concept. Immutable data helps to manage concurrency control which requires managing data.Lazy computation: In Scala, computation is lazy by default. You can declare a lazy variable by using the lazy keyword. It is used to increase performance.Case classes and Pattern matching: In Scala, case classes support pattern matching. So, you can write more logical code.Concurrency control: Scala provides a standard library which includes the actor model. You can write concurrency code by using the actor.String interpolation: In Scala, string interpolation allows users to embed variable references directly in processed string literals.Higher order function: In Scala, higher order function allows you to create function composition, lambda function or anonymous function, etc.Traits: A trait is like an interface with partial implementation. In Scala, the trait is a collection of abstract and non-abstract methods.Rich set of collection: Scala provides a rich set of collection library. It contains classes and traits to collect data. These collections can be mutable or immutable.For more information: Click here.24.7M339Triggers in SQL (Hindi)NextStay3) What are the Data Types in Scala?Data types in Scala are much similar to Java regarding their storage, length, except that in Scala there is no concept of primitive data types every type is an object and starts with capital letter. A table of data types is given below.Data Types in ScalaData TypeDefault ValueSizeBooleanFalseTrue or falseByte08 bit signed value (-27 to 27-1)Short016 bit signed value(-215 to 215-1)Char'\u0000'16 bit unsigned Unicode character(0 to 216-1)Int032 bit signed value(-231 to 231-1)Long0L64 bit signed value(-263 to 263-1)Float0.0F32 bit IEEE 754 single-precision floatDouble0.0D64 bit IEEE 754 double-precision floatStringNullA sequence of charactersFor more information: Click here.4) What is pattern matching?Pattern matching is a feature of Scala. It works same as switch case in other languages. It matches the best case available in the pattern.Exampleobject MainObject { def main(args: Array[String]) { var a = 1 a match{ case 1 => println("One") case 2 => println("Two") case _ => println("No") } } } For more information: Click here.5) What is for-comprehension in Scala?In Scala, for loop is known as for-comprehensions. It can be used to iterate, filter and return an iterated collection. The for-comprehension looks a bit like a for-loop in imperative languages, except that it constructs a list of the results of all iterations.Exampleobject MainObject { def main(args: Array[String]) { for( a 7) How to declare a function in Scala?In Scala, functions are first-class values. You can store function value, pass a function as an argument and return function as a value from other function. You can create a function by using the def keyword. You must mention return type of parameters while defining a function and return type of a function is optional. If you don't specify the return type of a function, default return type is Unit.Scala Function Declaration Syntaxdef functionName(parameters : typeofparameters) : returntypeoffunction = { // statements to be executed } For more information: Click here.8) Why do we use =(equal) operator in Scala function?You can create a function with or without = (equal) operator. If you use it, the function will return value. If you don't use it, your function will not return anything and will work like the subroutine.Exampleobject MainObject { def main(args: Array[String]) { var result = functionExample() // Calling function println(result) } def functionExample() = { // Defining a function var a = 10 a } } For more information: Click here.9) What is the Function parameter with a default value in Scala?Scala provides a feature to assign default values to function parameters. It helps in the scenario when you don't pass value during function calls. It uses default values of parameters.Exampleobject MainObject { def main(args: Array[String]) = { var result1 = functionExample(15,2) // Calling with two values var result2 = functionExample(15) // Calling with one value var result3 = functionExample() // Calling without any value println(result1+"\n"+result2+"\n"+result3) } def functionExample(a:Int = 0, b:Int = 0):Int = { // Parameters with default values as 0 a+b } } For more information: Click here.10) What is a function named parameter in Scala?In Scala function, you can specify the names of parameters while calling the function. You can pass named parameters in any order and can also pass values only.Exampleobject MainObject { def main(args: Array[String]) = { var result1 = functionExample(a = 15, b = 2) // Parameters names are passed during call var result2 = functionExample(b = 15, a = 2) // Parameters order have changed during call var result3 = functionExample(15,2) // Only values are passed during call println(result1+"\n"+result2+"\n"+result3) } def functionExample(a:Int, b:Int):Int = { a+b } } For more information: Click here.11) What is a higher order function in Scala?Higher order function is a function that either takes a function as an argument or returns a function. In other words, we can say a function which works with function is called a higher-order function.Exampleobject MainObject { def main(args: Array[String]) = { functionExample(25, multiplyBy2) // Passing a function as parameter } def functionExample(a:Int, f:Int=>AnyVal):Unit = { println(f(a)) // Calling that function } def multiplyBy2(a:Int):Int = { a*2 } } For more information: Click here.12) What is function composition in Scala?In Scala, functions can be composed from other functions. It is a process of composing in which a function represents the application of two composed functions.Exampleobject MainObject { def main(args: Array[String]) = { var result = multiplyBy2(add2(10)) // Function composition println(result) } def add2(a:Int):Int = { a+2 } def multiplyBy2(a:Int):Int = { a*2 } } For more information: Click here.13) What is Anonymous (lambda) Function in Scala?An anonymous function is a function that has no name but works as a function. It is good to create an anonymous function when you don't want to reuse it later. You can create anonymous function either by using ⇒ (rocket) or _ (underscore) wildcard in Scala.Exampleobject MainObject { def main(args: Array[String]) = { var result1 = (a:Int, b:Int) => a+b // Anonymous function by using => (rocket) var result2 = (_:Int)+(_:Int) // Anonymous function by using _ (underscore) wild card println(result1(10,10)) println(result2(10,10)) } } For more information: Click here.14) What is a multiline expression in Scala?Expressions those are written in multiple lines are called multiline expression. In Scala, be careful while using multiline expressions.Exampledef add1(a:Int, b:Int) = { a +b } The above program does not evaluate the complete expression and return b here.For more information: Click here.15) What is function currying in Scala?In Scala, the method may have multiple parameter lists. When a method is called with a fewer number of parameter lists, this will yield a function taking the missing parameter lists as its arguments.Exampleobject MainObject { def add(a:Int)(b:Int) = { a+b } def main(args: Array[String]) = { var result = add(10)(10) println("10 + 10 = "+result) var addIt = add(10)_ var result2 = addIt(3) println("10 + 3 = "+result2) } } For more information: Click here.16) What is a nexted function in Scala?In Scala, you can define the function of variable length parameters. It allows you to pass any number of arguments at the time of calling the function.Exampleobject MainObject { def add(a:Int, b:Int, c:Int) = { def add2(x:Int,y:Int) = { x+y } add2(a,add2(b,c)) } def main(args: Array[String]) = { var result = add(10,10,10) println(result) } } For more information: Click here.17) What is an object in Scala?The object is a real-world entity. It contains state and behavior. Laptop, car, cell phone are the real world objects. An object typically has two characteristics:1) State: data values of an object are known as its state.2) Behavior: functionality that an object performs is known as its behavior.The object in Scala is an instance of a class. It is also known as runtime entity.For more information: Click here.18) What is a class in Scala?The class is a template or a blueprint. It is also known as a collection of objects of similar type.In Scala, a class can contain:Data memberMember methodConstructorBlockNested classSuperclass information, etc.Exampleclass Student{ var id:Int = 0; // All fields must be initialized var name:String = null; } object MainObject{ def main(args:Array[String]){ var s = new Student() // Creating an object println(s.id+" "+s.name); } } For more information: Click here.19) What is an anonymous object in Scala?In Scala, you can create an anonymous object. An object which has no reference name is called an anonymous object. It is good to create an anonymous object when you don't want to reuse it further.Exampleclass Arithmetic{ def add(a:Int, b:Int){ var add = a+b; println("sum = "+add); } } object MainObject{ def main(args:Array[String]){ new Arithmetic().add(10,10); } } For more information: Click here.20) What is a constructor in Scala?In Scala, the constructor is not a special method. Scala provides primary and any number of auxiliary constructors. It is also known as default constructor.In Scala, if you don't specify a primary constructor, the compiler creates a default primary constructor. All the statements of the class body treated as part of the constructor.Scala Primary Constructor Exampleclass Student(id:Int, name:String){ def showDetails(){ println(id+" "+name); } } object MainObject{ def main(args:Array[String]){ var s = new Student(101,"Rama"); s.showDetails() } } For more information: Click here.21) What is method overloading in Scala?Scala provides method overloading feature which allows us to define methods of the same name but having different parameters or data types. It helps to optimize code. You can achieve method overloading either by using different parameter list or different types of parameters.Exampleclass Arithmetic{ def add(a:Int, b:Int){ var sum = a+b println(sum) } def add(a:Int, b:Int, c:Int){ var sum = a+b+c println(sum) } } object MainObject{ def main(args:Array[String]){ var a = new Arithmetic(); a.add(10,10); a.add(10,10,10); } } For more information: Click here.22) What is this in Scala?In Scala, this is a keyword and used to refer a current object. You can call instance variables, methods, constructors by using this keyword.Exampleclass ThisExample{ var id:Int = 0 var name: String = "" def this(id:Int, name:String){ this() this.id = id this.name = name } def show(){ println(id+" "+name) } } object MainObject{ def main(args:Array[String]){ var t = new ThisExample(101,"Martin") t.show() } } For more information: Click here.23) What is Inheritance?Inheritance is an object-oriented concept which is used to reusability of code. You can achieve inheritance by using extends keyword. To achieve inheritance, a class must extend to other class. A class which is extended called super or parent class. A class which extends class is called derived or base class.Exampleclass Employee{ var salary:Float = 10000 } class Programmer extends Employee{ var bonus:Int = 5000 println("Salary = "+salary) println("Bonus = "+bonus) } object MainObject{ def main(args:Array[String]){ new Programmer() } } For more information: Click here.24) What is method overriding in Scala?When a subclass has the same name method as defined in the parent class, it is known as method overriding. When subclass wants to provide a specific implementation for the method defined in the parent class, it overrides a method from the parent class.In Scala, you must use either override keyword or override annotation to override methods from the parent class.Exampleclass Vehicle{ def run(){ println("vehicle is running") } } class Bike extends Vehicle{ override def run(){ println("Bike is running") } } object MainObject{ def main(args:Array[String]){ var b = new Bike() b.run() } } For more information: Click here.25) What is final in Scala?Final keyword in Scala is used to prevent inheritance of super class members into the derived class. You can declare the final variable, method, and class also.Scala Final Variable Exampleclass Vehicle{ final val speed:Int = 60 } class Bike extends Vehicle{ override val speed:Int = 100 def show(){ println(speed) } } object MainObject{ def main(args:Array[String]){ var b = new Bike() b.show() } } For more information: Click here.26) What is the final class in Scala?In Scala, you can create a final class by using the final keyword. A final class can't be inherited. If you make a class final, it can't be extended further.Scala Final Class Examplefinal class Vehicle{ def show(){ println("vehicle is running") } } class Bike extends Vehicle{ override def show(){ println("bike is running") } } object MainObject{ def main(args:Array[String]){ var b = new Bike() b.show() } } For more information: Click here.27) What is an abstract class in Scala?A class which is declared with the abstract keyword is known as an abstract class. An abstract class can have abstract methods and non-abstract methods as well. An abstract class is used to achieve abstraction.Exampleabstract class Bike{ def run() } class Hero extends Bike{ def run(){ println("running fine...") } } object MainObject{ def main(args: Array[String]){ var h = new Hero() h.run() } } For more information: Click here.28) What is Scala Trait?A trait is like an interface with partial implementation. In Scala, the trait is a collection of abstract and non-abstract methods. You can create a trait that can have all abstract methods or some abstract and some non-abstract methods.Exampletrait Printable{ def print() } class A4 extends Printable{ def print(){ println("Hello") } } object MainObject{ def main(args:Array[String]){ var a = new A4() a.print() } } For more information: Click here.29) What is a trait mixins in Scala?In Scala, "trait mixins" means you can extend any number of traits with a class or abstract class. You can extend only traits or combination of traits and class or traits and abstract class.It is necessary to maintain the order of mixins otherwise compiler throws an error.Exampletrait Print{ def print() } abstract class PrintA4{ def printA4() } class A6 extends PrintA4 { def print(){ // Trait print println("print sheet") } def printA4(){ // Abstract class printA4 println("Print A4 Sheet") } } object MainObject{ def main(args:Array[String]){ var a = new A6() with Print // You can also extend trait during object creation a.print() a.printA4() } } For more information: Click here.30) What is the access modifier in Scala?Access modifier is used to define accessibility of data and our code to the outside world. You can apply accessibly to class, trait, data member, member method, and constructor, etc. Scala provides the least accessibility to access to all. You can apply any access modifier to your code according to your requirement.In Scala, there are only three types of access modifiers.No modifierProtectedPrivateFor more information: Click here31) What is an array in Scala?In Scala, the array is a combination of mutable values. It is an index based data structure. It starts from 0 index to n-1 where n is the length of the array.Scala arrays can be generic. It means, you can have an Array[T], where T is a type parameter or abstract type. Scala arrays are compatible with Scala sequences - you can pass an Array[T] where a Seq[T] is required. Scala arrays also support all the sequence operations.Exampleclass ArrayExample{ var arr = Array(1,2,3,4,5) // Creating single dimensional array def show(){ for(a println(element)) } } for more information: Click here.49) What is HashSet in Scala collection?HashSet is a sealed class. It extends AbstractSet and immutable Set trait. It uses hash code to store elements. It neither maintains insertion order nor sorts the elements.Exampleimport scala.collection.immutable.HashSet object MainObject{ def main(args:Array[String]){ var hashset = HashSet(4,2,8,0,6,3,45) hashset.foreach((element:Int) => println(element+" ")) } } For more information: Click here.50) What is BitSet in Scala?Bitsets are sets of non-negative integers which are represented as variable-size arrays of bits packed into 64-bit words. The largest number stored in it determines the memory footprint of a bitset. It extends Set trait.Exampleimport scala.collection.immutable._ object MainObject{ def main(args:Array[String]){ var numbers = BitSet(1,5,8,6,9,0) numbers.foreach((element:Int) => println(element)) } } For more information: Click here.51) What is ListSet in Scala collection?In Scala, ListSet class implements immutable sets using a list-based data structure. In ListSet class elements are stored internally in a reversed insertion order, which means the newest element is at the head of the list. This collection is suitable only for a small number of elements. It maintains insertion order.Exampleimport scala.collection.immutable._ object MainObject{ def main(args:Array[String]){ var listset = ListSet(4,2,8,0,6,3,45) listset.foreach((element:Int) => println(element+" ")) } } For more information: Click here.52) What is Seq in Scala collection?Seq is a trait which represents indexed sequences that are guaranteed immutable. You can access elements by using their indexes. It maintains insertion order of elements.Sequences support many methods to find occurrences of elements or subsequences. It returns a list.Exampleimport scala.collection.immutable._ object MainObject{ def main(args:Array[String]){ var seq:Seq[Int] = Seq(52,85,1,8,3,2,7) seq.foreach((element:Int) => print(element+" ")) println("\nAccessing element by using index") println(seq(2)) } } For more information: Click here.53) What is Vector in Scala collection?Vector is a general-purpose, immutable data structure. It provides random access of elements. It is suitable for a large collection of elements.It extends an abstract class AbstractSeq and IndexedSeq trait.Exampleimport scala.collection.immutable._ object MainObject{ def main(args:Array[String]){ var vector:Vector[Int] = Vector(5,8,3,6,9,4) //Or var vector2 = Vector(5,2,6,3) var vector3 = Vector.empty println(vector) println(vector2) println(vector3) } } For more information: Click here.54) What is List in Scala Collection?The List is used to store ordered elements. It extends LinearSeq trait. It is a class for immutable linked lists. This class is useful for last-in-first-out (LIFO), stack-like access patterns. It maintains order, can contain duplicates elements.Exampleimport scala.collection.immutable._ object MainObject{ def main(args:Array[String]){ var list = List(1,8,5,6,9,58,23,15,4) var list2:List[Int] = List(1,8,5,6,9,58,23,15,4) println(list) println(list2) } } For more information: Click here.55) What is the Queue in the Scala Collection?Queue implements a data structure that allows inserting and retrieving elements in a first-in-first-out (FIFO) manner.In Scala, Queue is implemented as a pair of lists. One is used to insert the elements and second to contain deleted elements. Elements are added to the first list and removed from the second list.Exampleimport scala.collection.immutable._ object MainObject{ def main(args:Array[String]){ var queue = Queue(1,5,6,2,3,9,5,2,5) var queue2:Queue[Int] = Queue(1,5,6,2,3,9,5,2,5) println(queue) println(queue2) } } For more information: Click here.56) What is a stream in Scala?The stream is a lazy list. It evaluates elements only when they are required. This is a feature of Scala. Scala supports lazy computation. It increases the performance of your program.Exampleobject MainObject{ def main(args:Array[String]){ val stream = 100 #:: 200 #:: 85 #:: Stream.empty println(stream) } } For more information: Click here.57) What does Map in Scala Collection?The map is used to store elements. It stores elements in pairs of key and values. In Scala, you can create a map by using two ways either by using comma separated pairs or by using rocket operator.Exampleobject MainObject{ def main(args:Array[String]){ var map = Map(("A","Apple"),("B","Ball")) var map2 = Map("A"->"Aple","B"->"Ball") var emptyMap:Map[String,String] = Map.empty[String,String] println(map) println(map2) println("Empty Map: "+emptyMap) } } For more information: Click here.58) What does ListMap in Scala?This class implements immutable maps by using a list-based data structure. You can create empty ListMap either by calling its constructor or using ListMap.empty method. It maintains insertion order and returns ListMap. This collection is suitable for small elements.Exampleimport scala.collection.immutable._ object MainObject{ def main(args:Array[String]){ var listMap = ListMap("Rice"->"100","Wheat"->"50","Gram"->"500") // Creating listmap with elements var emptyListMap = new ListMap() // Creating an empty list map var emptyListMap2 = ListMap.empty // Creating an empty list map println(listMap) println(emptyListMap) println(emptyListMap2) } } For more information: Click here.59) What is a tuple in Scala?A tuple is a collection of elements in the ordered form. If there is no element present, it is called an empty tuple. You can use a tuple to store any data. You can store similar type of mixing type data. You can return multiple values by using a tuple in function.Exampleobject MainObject{ def main(args:Array[String]){ var tuple = (1,5,8,6,4) // Tuple of integer values var tuple2 = ("Apple","Banana","Gavava") // Tuple of string values var tuple3 = (2.5,8.4,10.50) // Tuple of float values var tuple4 = (1,2.5,"India") // Tuple of mix type values println(tuple) println(tuple2) println(tuple3) println(tuple4) } } For more information: Click here.60) What is a singleton object in Scala?Singleton object is an object which is declared by using object keyword instead by class. No object is required to call methods declared inside a singleton object.In Scala, there is no static concept. So Scala creates a singleton object to provide an entry point for your program execution.Exampleobject Singleton{ def main(args:Array[String]){ SingletonObject.hello() // No need to create object. } } object SingletonObject{ def hello(){ println("Hello, This is Singleton Object") } } For more information: Click here.61) What is a companion object in Scala?In Scala, when you have a class with the same name as a singleton object, it is called a companion class and the singleton object is called a companion object. The companion class and its companion object both must be defined in the same source file.Exampleclass ComapanionClass{ def hello(){ println("Hello, this is Companion Class.") } } object CompanoinObject{ def main(args:Array[String]){ new ComapanionClass().hello() println("And this is Companion Object.") } } For more information: Click here.62) What are case classes in Scala?Scala case classes are just regular classes which are immutable by default and decomposable through pattern matching. It uses the equal method to compare instance structurally. It does not use the new keyword to instantiate the object.Examplecase class CaseClass(a:Int, b:Int) object MainObject{ def main(args:Array[String]){ var c = CaseClass(10,10) // Creating object of case class println("a = "+c.a) // Accessing elements of case class println("b = "+c.b) } } For more information: Click here.63) What is file handling in Scala?File handling is a mechanism for handling file operations. Scala provides predefined methods to deal with the file. You can create, open, write and read the file. Scala provides a complete package scala.io for file handling.Exampleimport scala.io.Source object MainObject{ def main(args:Array[String]){ val filename = "ScalaFile.txt" val fileSource = Source.fromFile(filename) for(line
More detailsPublished - Tue, 06 Dec 2022
Created by - Admin s
A list of top frequently asked Control System interview questions and answers are given below.1) What is meant by System?When the number of elements connected performs a specific function then the group of elements is said to constitute a system or interconnection of various components for a specific task is called system. Example: Automobile.2) What is meant by Control System?Any set of mechanical or electronic devices that manages, regulates or commands the behavior of the system using control loop is called the Control System. It can range from a small controlling device to a large industrial controlling device which is used for controlling processes or machines.more details..Play Videox3) What are the types of control system?There are two types of Control System-Open loop control system.Closed loop control system.4) What is open loop and control loop systems?Open loop control System: An open-loop control system is a system in which the control action is independent of the desired output signal. Examples: Automatic washing machine, Immersion rod.Closed loop control System: A closed-loop control system is a system in which control action is dependent on the desired output. Examples: Automatic electric iron, Servo voltage stabilizer, an air conditioner.more details..5) What is time-invariant System?The time required to change from one state to another state is known as transient time, the value of current and voltage during this period is called transient response and the system in which the input and output characteristics of the system does not change with time is called the Time-Invariant System.6) What are linear and non-linear systems?Linear system: Linear systems are the systems which possess the property of homogeneity and superposition. The term superposition means that an input r1(t) gives an output c1(t) and r2(t) will give the output c2(t). If we apply both the input r1(t) and r2(t) together, then the output will be the sum of c1(t) and c2(t).r1 (t) + r2 (t) = c1 (t) + c2 (t) Non-Linear System: Non-linear systems are the systems which do not possess the property of superposition and homogeneity, and the output of these systems are not directly proportional to its input. In these types of systems, the stability of the system depends upon the input and initial state of the system.more details..7) What is meant by analogous System?When the two differential equations are of same order or form such type of systems is called analogous systems.8) What is the Transfer Function?Transfer function of a system is defined as the ratio of Laplace transform of output to the Laplace transform of input with all the initial conditions as zero.Where,T(S) = Transfer function of system. C(S) = output. R(S) = Reference output. G(S) = Gain. more details..9) What are the advantages and disadvantages of open loop control System?Advantages of the open-loop control systemOpen loop systems are simple.These are economical.Less maintenance is required and is not difficult.Disadvantages of the open-loop control systemOpen loop systems are inaccurate.These systems are not reliable.These are slow.Optimization is not possible.10) What are the advantages and disadvantages of closed-loop control System?Advantages of closed-loop systemsThe closed loop systems are more reliable.Closed loop systems are faster.Many variables can be handled simultaneously.Optimization is possible.Disadvantages of closed-loop systemsClosed loop systems are expensive.Maintenance is difficult.Installation is difficult for these systems.11) What are the necessary components of the feedback control system?The processing system (open loop system), feedback path element, an error detector, and controller are the necessary components of the feedback control system.12) What is the feedback in the control system?When the input is fed to the system and the output received is sampled, and the proportional signal is then fed back to the input for automatic correction of the error for further processing to get the desired output is called as feedback in control system.13) What is Gain Margin?Gain margin is the gain which varies before the system becomes stable because if we continuously increase the gain up to a certain threshold, the system will become marginally stable, and if the gain varies further then it leads to instability. Mathematically, it is the reciprocal of the magnitude of the G(jω)H(jω) at phase cross-over frequency.14) What is Signal Flow Graph?The graphical representation of the system's relationship between the variables of a set of linear equations is called SFG (Signal Flow Graph). Signal flow graphs do not require any reduction technique or process.more details..15) What is Mason's Gain Formula?The input and output variable relationship of a signal flow graph is given by Mason's Gain Formula.For the determination of the overall system, the gain of the system is given by:Where,Pk = forward path gain of the Kth forward path.∆ = 1 - [Sum of the loop gain of all individual loops] + [Sum of gain products of all possible of two non-touching loops] + [Sum of gain products of all possible three non-touching loops] + .......∆k = The value of ∆ for the path of the graph is the part of the graph that is not touching the Kth forward path.more details..16) What are the essential characteristics of Signal Flow Graphs?The essential characteristics of the signal flow graph are:It represents a network in which nodes are used for the representation of system variable which is connected by direct branches.SFG is a diagram which represents a set of equations. It consists of nodes and branches such that each branch of SFG having an arrow which represents the flow of the signal.It is only applicable to the linear system.17) What is the basic rule for block diagram reduction technique?The basic rule for block diagram reduction is that if we make any changes in the diagram, then that changes do not create any changes in the input-output relationship of the system.more details..18) What is an order of a system?Order of the system is the highest derivative of the order of its equation. Similarly, it is the highest power of 's' in the denominator of the transfer function.19) What is the resonant peak?The maximum value of the closed-loop transfer function is called the Resonant Peak. A large value of resonant peak means that it has large overshoot value in the transient response.20) What is the cut-off rate?The slope of the log-magnitude curve near the cut-off frequency is called the cut-off rate. It indicates the ability of the system to differentiate between the signal and the noise.21) What is phase cross-over frequency?When the phase of the open loop transfer function reaches 180? at a particular frequency then it is called as Phase crossover frequency.22) What is Phase Margin?When we have to bring the system to the edge of instability, the additional phase lag required at the gain crossover frequency is called the Phase Margin.23) What Is Pole Of The System?The value at which the function F(s) becomes infinite is called the Pole of the function F(s), where F(s) is a function of complex variables.24) What Is Zero Of The System?The value at which the function F(s) becomes zero is called the Zero of the function F(s), where F(s) is a function of complex variables.25) What Is The Use For Cable Entry In Control Room?When there is an emergency, i.e., fire/explosion takes place in the plant, and we have to restrict it from entering to the control room then MCT (Multiple Cable Transient) blocks are used, and the process control rooms are built for the non-hazardous area.26) What is the effect of positive feedback on the Stability of the systems?Positive feedback increases the error signal and drives the system to the instability that is why it is not generally used in the control system. Positive feedbacks are used in minor loop control systems to amplify internal signals and parameters.27) What is Servomechanism?When a specific type of motor known as servomotor is combined with a rotary encoder or a potentiometer, to form a Servomechanism. In this setup, a potentiometer provides an analog signal to indicate the position and an encoder provide position and speed feedback.28) Where is Servomechanism used?Servomechanism is used in the control system so that the mechanical position of a device can be varied with the help of output.The Servomechanism is widely used in a Governor value position control mechanism that is used in power plants to take the speed of turbine and process it using the transducer, and the final value is taken as a mechanical movement of the value. However, nowadays Governor value position control is done with Electronic controls that use power Thyristors. This mechanism is also used in robotic hand movement.29) How many types of instrument cables are there?The following types of instrument cables are there:IS cablesNIS cables.IS - Intrinsic safety and NIS - Non Intrinsic safety.Depending upon the condition of hazards the type of cable is decided.30) What are the temperature elements?The temperature elements are-Thermocouple.Resistance temperature detectors (RTDs).31) What is Cable Tray, its Type, and its Support?The media or way through which we lay the field cables in plants is called as cable tray. These are made of aluminum, steel or fiber reinforced plastic (FRP) and are available in six types-Ladder type Cable Tray(made of Rungs type construction)Solid Bottom Cable TrayTrough Cable TrayChannel Cable TrayWire Mesh Cable TraySingle Rail Cable TrayThe main points which we have to consider before laying the cables are the site conditions and the adequate space where we have to lay the cable.32) How to decide cable tray size?Based on the occupancy in the cable tray and a number of cables required we have to choose the size of the cable tray. These are available in all sizes like 80,150, 300, 450, 600 and 900.33) What is the cut-off Rate?The slope near the cut-off frequency of the log-magnitude curve is called the cut-off rate. The cut-off rate indicates the ability of the system to distinguish between the signal and the noise.34) Enlists the applications of Sampled Data Systems?Sampled data system has the following applications-Quantized data is used for controlling in High-speed tinplate rolling mills.Digitally controlled or pulse controlled electric drives.For machine tool operations which are numerically controlled.It is used in large systems using telemetry links based on pulse modulation (PM) translational data.35) What are DCS and PLC?DCS and PLC are the control systems which handles fields I/Os. DCS is Distributed control system, and PLC is the Programmable logic controller.36) What are stable systems?Stable systems are the system in which all the roots of the characteristic equations lie on the right half of the 'S' plane.37) What are marginally stable systems?Marginally stable systems are the system in which all the roots of the characteristic equations lie on the imaginary axis of the 'S' plane38) What are unstable systems?Unstable systems are the system in which all the roots of the characteristic equations lie on the left half of the 'S' plane.39) What is Routh Hurwitz Stability Criterion?Routh Hurwitz criterion states that a system is stable if and only if all the roots of the first column have the same sign and if all the signs are not same then number of time the sign changes in the first column is equal to the number of roots of the characteristic equation in the right half of the s-plane.more details..40) What is an Automatic Controller?Automatic Controllers are the device which compares the actual value of plant output with the desired value. These systems produce the control system that reduces the deviation to ?0? or to a small value and determines the deviation.41) What is the Control Action?Control action is the manner in which the automatic controller produces the control signal.
More detailsPublished - Tue, 06 Dec 2022
Created by - Admin s
A list of top frequently asked Digital Electronics Interview Questions and answers are given below.1) What is the difference between Latch And Flip-flop?The difference between latches and Flip-flop is that the latches are level triggered and flip-flops are edge triggered. In latches level triggered means that the output of the latches changes as we change the input and edge triggered means that control signal only changes its state when goes from low to high or high to low.Latches are fast whereas flip-flop is slow.2) What is the binary number system?The system which has a base 2 is known as the binary system and it consists of only two digits 0 and 1.Play VideoxFor Example: Take decimal number 625625 = 600 + 20 + 5That means,6×100 + 2×10 + 56 ×102 + 2×101 + 5×100In this 625 consist of three bits, we start writing the numbers from the rightmost bit power as 0 then the second bit as power 1 and the last as power 2. So, we can represent a decimal number as∑digit × 10corresponding position or bitHere 10 is the total number of digits from 0 to 9.3) State the De Morgan's Theorem?De Morgan's Theorem stated two theorems:1.The complement of a product of two numbers is the sum of the complements of those numbers.(A. B)' = A' + B'Truth Table:2. The complement of the sum of two numbers is equal to the product of the complement of two numbers.(A + B)' = A'B'Truth Table:4) Define Digital System?Digital systems are the system that processes a discrete or digital signal.5) What is meant by a bit?Bits are the binary digits like 0 and 1.6) What is the best Example of Digital system?Digital Computer.7) How many types of number system are there?There are four types of number system:Decimal Number System.Binary Number System.Octal Number System.Hexadecimal Number System.8) What is a Logic gate?The basic gates that make up the digital system are called a logic gate. The circuit that can operate on many binary inputs to perform a particular logic function is called an electronic circuit.9) What are the basic Logic gates?There are three basic logic gates-AND gate.OR gate.NOT gate.10) Which gates are called as Universal gate and what are its advantages?The Universal gates are NAND and NOR. The advantages of these gates are that they can be used for any logic calculation.11) What are the applications of the octal number system?The applications of the octal number system are as follows:For the efficient use of microprocessors.For the efficient use of digital circuits.It is used to enter binary data and display of information.12) What are the fundamental properties of Boolean algebra?The basic properties of Boolean algebra are:Commutative Property.Associative Property.Distributive Property.13) What are Boolean algebra and Boolean expression?14) What is meant by K-Map or Karnaugh Map?K-Map is a pictorial representation of truth table in which the map is made up of cells, and each term in this represents the min term or max term of the function. By this method, we can directly minimize the Boolean function without following various steps.15) Name the two forms of Boolean expression?The two forms of Boolean expression are:Sum of products (SOP) form.The Product of sum (POS) form.16) What are Minterm and Maxterm?A minterm is called Product of sum because they are the logical AND of the set of variables and Maxterm are called sum of product because they are the logical OR of the set of variables.17) Write down the Characteristics of Digital ICs?The characteristics of digital ICs are -Propagation delay.Power Dissipation.Fan-in.Fan-out.Noise Margin.18) What are the limitations of the Karnaugh Map?The limitations of Karnaugh Map are as follows:It is limited to six variable maps which means more than six variable involving expressions are not reduced.These are useful for only simplifying Boolean expression which is represented I standard form.19) What are the advantages and disadvantages of the K-Map Method?The advantages of the K-Map method are as follows-It is an excellent method for simplifying expression up to four variables.For the logical simplification, it gives us a visual method.It is suitable for both SOP and POS forms of reduction.It is more suitable for classroom teachings on logic simplification.The disadvantages of the K-Map method are as follows:It is not suitable when the number of variables exceeds more than four.For Computer reduction, it is not suitable.We have to take while entering the numbers in the cell-like 0, 1 and don't care terms.20) What are the advantages and disadvantages of Quine-MC Cluskey method?21) Define Pair, Quad, and Octet?Pair: Two adjacent cell of karnaugh map is called as Pair. It cancels one variable in a K-Map simplification.Quad: A Pair of Four adjacent pairs in a karnaugh map is called a quad. It cancels two variables in a K-Map simplification.Octet: A Pair of eight adjacent pair in a karnaugh map is called an octet. It cancels four variables in a K-map simplification.22) Define Fan-in and Fan-out?Fan-in- The Fan-in of the gate means that the number of inputs that are connected to the gate without the degradation of the voltage level of the system.Fan-out- The Fan-out is the maximum number of same inputs of the same IC family that a gate can drive maintaining its output levels within the specified limits.23) Write the definition of the Duality Theorem?Duality Theorem states that we can derive another Boolean expression with the existing Boolean expression by:Changing OR operation (+ Sign) to AND operation (. Dot Sign) and vice versa.Complimenting 0 and 1 in the expression by changing 0 to 1 and 1 to 0 respectively.24) What is Half-Adder?Half-adder is the circuits that perform the addition of two bits. It has two inputs A and B and two outputs S (sum) and C (carry). It is represented by XOR logic gate and an AND logic gate.Truth Table of Half adder:25) What is Full-Adder?Full-adder is the circuits that perform the addition of three bits. It has three inputs A, B and a carry bit. Full adders are represented with AND, OR and XOR logic gate.Truth Table of Full-Adder26) What is power dissipation?Period time is the electrical energy used by the logic circuits. It is expressed in milliwatts or nanowatts.Power dissipation = Supply voltage * mean current taken from the supply.27) What is a Multiplexer?The multiplexer is a digital switch which combines all the digital information from several sources and gives one output.28) What are the applications of Multiplexer (MUX)?The applications of the multiplexer are as follows:It is used as a data selector from many inputs to get one output.It is used as A/D to D/A Converter.These are used in the data acquisition system.These are used in time multiplexing system.29) What is a Demultiplexer?The demultiplexer is a circuit that receives the input on a single line and transmits this onto 2n possible output line. A Demultiplexer of 2n outputs has n select lines, which are used to select which output line is to be sent to the input. The demultiplexer is also called as Data Distributor.30) What are the applications of Demultiplexer?The applications of the demultiplexer are as follows:It is used in the data transmission system with error detection.It is used as a decoder for the conversion of binary to decimal.It is used as a serial to parallel converter.31) What are the differences between Combinational Circuits and Sequential Circuits?The differences between combinational and sequential circuits are as follows:S.NoCombinational CircuitsSequential Circuits1.These are faster in speed.These are slower.2.These are easy to design.These are difficult to design.3.The clock input is not required.The clock input is required.4.In this, the memory units are not required.In this, the memory units are required to store the previous values of inputs.5.Example: Mux, Demux, encoder, decoder, adders, subtractors.Example: Shift registers, counters.32) Define Rise Time?Rise time is the time that is required to change the voltage level from 10% to 90%.33) Define fall time?Fall time is the time that is required to change the voltage level from 90% to 10%.34) Define Setup time?The minimum time that is required to maintain the constant voltage levels at the excitation inputs of the flip-flop device before the triggering edge of the clock pulse for the levels to be reliably clocked in the flip flop is called the Setup time. It is denoted as tsetup.35) Define Hold time?The minimum time at which the voltage level becomes constant after triggering the clock pulse in order to reliably clock into the flip flop is called the Hold time. It is denoted by thold.36) What is the difference between Synchronous and Asynchronous Counters?The difference between Synchronous and Asynchronous Counters are as follows:S.NoAsynchronous CountersSynchronous Counters1.These are low-speed Counters.These are high-speed Counters.2.The Flip flops of these counters are not clocked simultaneously.In these counters, the flip-flops are clocked simultaneously.3.Simple logic circuits are there for more number of states.Complex logic circuits are there when the number of states increases.37) What are the applications of Flip-Flops?The applications of flip-flops are:Flip-flops are used as the delay element.These are used for Data transfer.Flip-flops are used in Frequency Division and Counting.Flip-Flops are used as the memory element.38) What is the difference between D-latch and D Flip-flop?D-latch is level sensitive whereas flip-flop is edge sensitive. Flip-flops are made up of latches.39) What are the applications of Buffer?Applications of buffer are as follows:Buffer helps to introduce small delays.Buffer helps for high Fan-out.Buffer are used to eliminate cross talks.
More detailsPublished - Tue, 06 Dec 2022
Created by - Admin s
A list of top frequently asked Digital Electronics Interview Questions and answers are given below.1) What is the difference between Latch And Flip-flop?The difference between latches and Flip-flop is that the latches are level triggered and flip-flops are edge triggered. In latches level triggered means that the output of the latches changes as we change the input and edge triggered means that control signal only changes its state when goes from low to high or high to low.Latches are fast whereas flip-flop is slow.2) What is the binary number system?The system which has a base 2 is known as the binary system and it consists of only two digits 0 and 1.Play VideoxFor Example: Take decimal number 625625 = 600 + 20 + 5That means,6×100 + 2×10 + 56 ×102 + 2×101 + 5×100In this 625 consist of three bits, we start writing the numbers from the rightmost bit power as 0 then the second bit as power 1 and the last as power 2. So, we can represent a decimal number as∑digit × 10corresponding position or bitHere 10 is the total number of digits from 0 to 9.3) State the De Morgan's Theorem?De Morgan's Theorem stated two theorems:1.The complement of a product of two numbers is the sum of the complements of those numbers.(A. B)' = A' + B'Truth Table:2. The complement of the sum of two numbers is equal to the product of the complement of two numbers.(A + B)' = A'B'Truth Table:4) Define Digital System?Digital systems are the system that processes a discrete or digital signal.5) What is meant by a bit?Bits are the binary digits like 0 and 1.6) What is the best Example of Digital system?Digital Computer.7) How many types of number system are there?There are four types of number system:Decimal Number System.Binary Number System.Octal Number System.Hexadecimal Number System.8) What is a Logic gate?The basic gates that make up the digital system are called a logic gate. The circuit that can operate on many binary inputs to perform a particular logic function is called an electronic circuit.9) What are the basic Logic gates?There are three basic logic gates-AND gate.OR gate.NOT gate.10) Which gates are called as Universal gate and what are its advantages?The Universal gates are NAND and NOR. The advantages of these gates are that they can be used for any logic calculation.11) What are the applications of the octal number system?The applications of the octal number system are as follows:For the efficient use of microprocessors.For the efficient use of digital circuits.It is used to enter binary data and display of information.12) What are the fundamental properties of Boolean algebra?The basic properties of Boolean algebra are:Commutative Property.Associative Property.Distributive Property.13) What are Boolean algebra and Boolean expression?14) What is meant by K-Map or Karnaugh Map?K-Map is a pictorial representation of truth table in which the map is made up of cells, and each term in this represents the min term or max term of the function. By this method, we can directly minimize the Boolean function without following various steps.15) Name the two forms of Boolean expression?The two forms of Boolean expression are:Sum of products (SOP) form.The Product of sum (POS) form.16) What are Minterm and Maxterm?A minterm is called Product of sum because they are the logical AND of the set of variables and Maxterm are called sum of product because they are the logical OR of the set of variables.17) Write down the Characteristics of Digital ICs?The characteristics of digital ICs are -Propagation delay.Power Dissipation.Fan-in.Fan-out.Noise Margin.18) What are the limitations of the Karnaugh Map?The limitations of Karnaugh Map are as follows:It is limited to six variable maps which means more than six variable involving expressions are not reduced.These are useful for only simplifying Boolean expression which is represented I standard form.19) What are the advantages and disadvantages of the K-Map Method?The advantages of the K-Map method are as follows-It is an excellent method for simplifying expression up to four variables.For the logical simplification, it gives us a visual method.It is suitable for both SOP and POS forms of reduction.It is more suitable for classroom teachings on logic simplification.The disadvantages of the K-Map method are as follows:It is not suitable when the number of variables exceeds more than four.For Computer reduction, it is not suitable.We have to take while entering the numbers in the cell-like 0, 1 and don't care terms.20) What are the advantages and disadvantages of Quine-MC Cluskey method?21) Define Pair, Quad, and Octet?Pair: Two adjacent cell of karnaugh map is called as Pair. It cancels one variable in a K-Map simplification.Quad: A Pair of Four adjacent pairs in a karnaugh map is called a quad. It cancels two variables in a K-Map simplification.Octet: A Pair of eight adjacent pair in a karnaugh map is called an octet. It cancels four variables in a K-map simplification.22) Define Fan-in and Fan-out?Fan-in- The Fan-in of the gate means that the number of inputs that are connected to the gate without the degradation of the voltage level of the system.Fan-out- The Fan-out is the maximum number of same inputs of the same IC family that a gate can drive maintaining its output levels within the specified limits.23) Write the definition of the Duality Theorem?Duality Theorem states that we can derive another Boolean expression with the existing Boolean expression by:Changing OR operation (+ Sign) to AND operation (. Dot Sign) and vice versa.Complimenting 0 and 1 in the expression by changing 0 to 1 and 1 to 0 respectively.24) What is Half-Adder?Half-adder is the circuits that perform the addition of two bits. It has two inputs A and B and two outputs S (sum) and C (carry). It is represented by XOR logic gate and an AND logic gate.Truth Table of Half adder:25) What is Full-Adder?Full-adder is the circuits that perform the addition of three bits. It has three inputs A, B and a carry bit. Full adders are represented with AND, OR and XOR logic gate.Truth Table of Full-Adder26) What is power dissipation?Period time is the electrical energy used by the logic circuits. It is expressed in milliwatts or nanowatts.Power dissipation = Supply voltage * mean current taken from the supply.27) What is a Multiplexer?The multiplexer is a digital switch which combines all the digital information from several sources and gives one output.28) What are the applications of Multiplexer (MUX)?The applications of the multiplexer are as follows:It is used as a data selector from many inputs to get one output.It is used as A/D to D/A Converter.These are used in the data acquisition system.These are used in time multiplexing system.29) What is a Demultiplexer?The demultiplexer is a circuit that receives the input on a single line and transmits this onto 2n possible output line. A Demultiplexer of 2n outputs has n select lines, which are used to select which output line is to be sent to the input. The demultiplexer is also called as Data Distributor.30) What are the applications of Demultiplexer?The applications of the demultiplexer are as follows:It is used in the data transmission system with error detection.It is used as a decoder for the conversion of binary to decimal.It is used as a serial to parallel converter.31) What are the differences between Combinational Circuits and Sequential Circuits?The differences between combinational and sequential circuits are as follows:S.NoCombinational CircuitsSequential Circuits1.These are faster in speed.These are slower.2.These are easy to design.These are difficult to design.3.The clock input is not required.The clock input is required.4.In this, the memory units are not required.In this, the memory units are required to store the previous values of inputs.5.Example: Mux, Demux, encoder, decoder, adders, subtractors.Example: Shift registers, counters.32) Define Rise Time?Rise time is the time that is required to change the voltage level from 10% to 90%.33) Define fall time?Fall time is the time that is required to change the voltage level from 90% to 10%.34) Define Setup time?The minimum time that is required to maintain the constant voltage levels at the excitation inputs of the flip-flop device before the triggering edge of the clock pulse for the levels to be reliably clocked in the flip flop is called the Setup time. It is denoted as tsetup.35) Define Hold time?The minimum time at which the voltage level becomes constant after triggering the clock pulse in order to reliably clock into the flip flop is called the Hold time. It is denoted by thold.36) What is the difference between Synchronous and Asynchronous Counters?The difference between Synchronous and Asynchronous Counters are as follows:S.NoAsynchronous CountersSynchronous Counters1.These are low-speed Counters.These are high-speed Counters.2.The Flip flops of these counters are not clocked simultaneously.In these counters, the flip-flops are clocked simultaneously.3.Simple logic circuits are there for more number of states.Complex logic circuits are there when the number of states increases.37) What are the applications of Flip-Flops?The applications of flip-flops are:Flip-flops are used as the delay element.These are used for Data transfer.Flip-flops are used in Frequency Division and Counting.Flip-Flops are used as the memory element.38) What is the difference between D-latch and D Flip-flop?D-latch is level sensitive whereas flip-flop is edge sensitive. Flip-flops are made up of latches.39) What are the applications of Buffer?Applications of buffer are as follows:Buffer helps to introduce small delays.Buffer helps for high Fan-out.Buffer are used to eliminate cross talks.
More detailsPublished - Tue, 06 Dec 2022
Fri, 16 Jun 2023
Fri, 16 Jun 2023
Fri, 16 Jun 2023
Write a public review