Posts

Interview Question and Answer - Convert a C++ variable name into a java variable name or vice versa

Q  1.  Modify Variable Names In every programming language variable naming conventions are different Like In C++   :  this_is_a variable In JAVA : thisIsAVariable You have to convert a C++ variable name into a java variable name or vice versa. Assume that Java variable name never contains '_' before any alphabet. In other words , if the given variable name contains '_' before any alphabet, treat the given variable name as C++variable name and generate the result as a Java variable name otherwise vice versa. Example 1 : input1 : modify_variableName output : modifyVariableName C# language Solution :  public static string ToConvertVariableName(string str)         {             string result;             if(str.Contains('_'))                 result= ToJava(str);             else                 result = ToCplus(str);             return result;         }         public static string ToCplus(this string str)         {             return

Create Angular 6 Application and Deploy on Firebase

Prerequisite to create Angular App Install the latest version of Node.js from  here Install Visual Studio Code from  here Install Angular6 CLI  Run the following command in a command prompt. npm i -g @angular/cli Now execute the following command to start the web server. ng serve Check website on local server using  http://localhost:4200 Now Angular CLI will create our dist files after execute below command in terminal : ng build --prod Link and Deploy Angular App to Firebase We need to first link the application with firebase then deploy 1. Open firebase console from  here 2. Click on Add Project and create it. 3. Copy code from Add Firebase to your web app from Console 4. Follow below steps to link application Download the firebase tools             npm install -g firebase-tools Login to Firebase using the firebase tools           firebase login Link our local app to our Firebase app            firebase init