Posts

Showing posts from June, 2019

Interview Prep

06/03/19 Fizz Buzz Implementation Fizz Buzz is a very simple programming task, asked in software developer job interviews. A typical round of Fizz Buzz can be: Write a program that prints the numbers from 1 to 100 and for multiples of '3' print "Fizz" instead of the number and for the multiples of '5' print "Buzz". 1, 2, Fizz, 4, Buzz, Fizz, 7, 8, Fizz, Buzz, 11, Fizz, 13, 14, Fizz Buzz, 16, 17, Fizz, 19, Buzz, Fizz, 22, 23, Fizz, Buzz, 26, Fizz, 28, 29, Fizz Buzz, 31, 32, Fizz, 34, Buzz, Fizz, ... Corner case - Print FizzBuzz at multiples of 15  Bit reversal 

What's new for me ? JavaScript

05/05/19 Use of REGEX in printing vowels by consonants in different line from input string: const str = "The quick brown fox jumps over a lazy dog" ; const vowels = str . match ( /[aeiou]/ gi ); const consonants = str . match ( /[^aeiou]/ gi ); vowels . concat ([ '' ], consonants ). forEach ( k => { console . log ( k ); } );

What's new for me ? Java

05/05/2019 Types to read input from user: Input a string and a number using BufferedReader: InputStream inputStream = System . in ; Reader inputStreamReader = new InputStreamReader ( inputStream ) ; BufferedReader bufferedReader = new BufferedReader ( inputStreamReader ) ; String name = bufferedReader . readLine ( ) ; //Read a string from the keyboard String sAge = bufferedReader . readLine ( ) ; //Read a string from the keyboard int nAge = Integer . parseInt ( sAge ) ; //Convert the string to a number.   A more compact version of the previous example: BufferedReader reader = new BufferedReader ( new InputStreamReader ( System . in ) ) ; String name = reader . readLine ( ) ; String sAge = reader . readLine ( ) ; int nAge = Integer . parseInt ( sAge ) ;   Even more compact using Scanner : Scanner scanner = new Scanner ( System . in ) ; String name = scanner . nextLine ( ) ; int age = scanner . nextInt ( ) ; Shortcuts in Int

Random Knowledge

07/05/19 Nib File A resource file used to store user interfaces of iOS and Mac apps. It is an interface builder used to design the virtual parts of the app - such as windows and views - and sometimes to configure non-visual objects, such as the controller objects that your app uses to manage its windows and views. The object graph is crated when we edit this file and archived when it is saved. When we load the file the object graph is unarchived. This fie contains static GUI design and it's relationship to other program resources. Things needed to open Nib file: The NIB file cannot be opened in Windows as the Apple Interface Builder(used to develop applications for iPhone), installed on a Mac, is required. Steps to open Nib file: 1. Open the Apple Interface Builder on a Mac. 2. Click the “File” option on the top navigation bar, then click “Open.” A file navigation window opens. 3. Navigate to and click on the NIB file. The file appears in the left pane,